Arrowstar / ksptot

KSP Trajectory Optimization Tool
Other
87 stars 13 forks source link

LVD fails optimization with tank mass as variable #29

Closed EpicSpaceTroll139 closed 2 years ago

EpicSpaceTroll139 commented 2 years ago

Earlier today I optimized an ascent steering profile for a Tylo lander, and noticed it had quite a bit of delta-v leftover once in orbit. In the interest of efficiency, I decided to let LVD optimize the tank mass to make the lander as light as possible while still reaching orbit with some minimum periapsis. The optimizer popped up the score card almost immediately with a supposed constraint violation of zero. However, a quick look at the tanks for the two stages showed it had just drained both of them almost exactly to half full, and when I exited the vehicle config tab, the script updated to show the lander didn't even get close to orbit. I thought perhaps I was optimizing too many variables at once (in total there were 11 I think), but through testing I figured out the issue was just from the tank optimization, and could be triggered with a very trivial mission

Step 1) Create new LVD mission Step 2) Go to Scenario->Edit Vehicle Configuration->Tanks->First Stage Tank, check optimize, and give it some wiggle room (I did 0 to 8 mT, nicely balanced around the 4 mT default). Step 3) Set the single event to have a termination condition of the duration being 0 seconds, if it does not have this already. Step 4) Set the objective function to be to minimize total spacecraft mass at the end of the single event. Step 5) Run the optimizer.

The optimizer will "converge," but when you go to Scenario->Vehicle Configuration, you will see that the tank mass has not been minimized, but instead been either unchanged or set to something near the middle of the available range. I have so far tested this with FMINCON (interior point and SQP), NOMAD, and Pattern Search, with similar end results

ksptot.log

Arrowstar commented 2 years ago

Fix implemented and there's a new build in work! :)

Arrowstar commented 2 years ago

New build is live, please check it out and let me know if the issue is resolved! And thank you for your patience and all the bug reports so far, this is all super helpful!

EpicSpaceTroll139 commented 2 years ago

New build is live, please check it out and let me know if the issue is resolved! And thank you for your patience and all the bug reports so far, this is all super helpful!

Alright, I'll do that now. No problem at all with dealing with the bugs. Glad I can help you improve LVD! :)

EpicSpaceTroll139 commented 2 years ago

New build is live, please check it out and let me know if the issue is resolved! And thank you for your patience and all the bug reports so far, this is all super helpful!

Whoops, forgot to respond: Yes, the tank mass optimization issue has been fixed!. Thanks!