Closed SeanMatthewNolan closed 5 years ago
I actually think I just solved this problem. Or rather the reverse of the problem. See 9-moonlander. You should still implement your solution with epsilon-trig because I used UTM + ICRM.
That's a good problem and solution. The problem is pretty similar, but somewhat different from the Goddard rocket.
@msparapa We can easily use this example as a comparison to pseudospectral methods. We obtain a higher quality solution in a fraction of the time.
Best comparison right now would be against opengoddard's solution. Pseudospectral still uses my slow npnlp package.
That was the comparison I was talking about
Between time 0.025 and 0.075, is the control on a singular arc? I'm not too certain what's going on here. Making epsilon not so small kind of reveals a bit more about what the control is doing.
Oh, I was adding the plots last night. I just didn't get a chance to push them. In this case, the control should be bang-bang. As epsilon goes to 0, it mathematically will converge to the original problem.
BOCOP seems to think that, unconstrained (black line in plot below), there's a singular arc between 0.025 and 0.075. With really small epsilon for us, it appears as if the thrust is off between 0.025 and 0.075, but velocity is increasing albeit increasing slower than <0.025.
Looking at opengoddard's solution, it sorta resolved this same shape as well, but not nearly as smooth.
That problem has a dynamic pressure constraint. I was actually going to add that as a variation in that folder. It's described in this article: https://arc-aiaa-org.ezproxy.lib.purdue.edu/doi/pdf/10.2514/3.21080
As long as the problem solves, the epsilon should be as small as possible.
It's not active though with their C=0.8. I tried with drag max = 0.5 and here's what I got. Thrust is essentially off but we're still gaining velocity and losing mass. Making epsilon, not so small, changest the thrust history a lot and I can sort of see the curve from BOCOP's solution, but velocity and mass don't change.
epsilon = 0.001
And here's eps = 0.005. The other plots are pretty much identical.
Check the final altitude. See which is optimal.
Same for both. The velocity is integrated correctly but I don't think it's representing the singular arc correctly. Changing epsilon also changes thrust, but not velocity. I honestly have no idea where the problem is.
No, it isn't. There shouldn't be a singular arc here. If they show a singular arc, it's either a difference in the numbers or they are incorrect. With epsilon as low as possible, a greater altitude is achieved. The difference isn't large because everything is normalized by the radius of the Earth, but the difference is there. Mathematically, epsilon being smaller will approach the original problem and result in a lower cost. I think if the problem is posed without the normalization, it would show the difference even clearer.
Maybe I'm not understanding the problem. Why does velocity increase between 0.025 and 0.075 if thrust is off?
I figured it out. It's our old friend scaling. Running with autoscale=False
gives more reasonable answers for thrust, save for the singular arc.
I was going to say, that the problem wouldn't be the epsilon. It had to be something else.
Pretty confident this is a larger issue dealing with scaling, maybe even the math behind epsilon-trig. I think the issues here are the same that are preventing me from solving constrained hypersonic problems. Otherwise Goddard seems to be working fine. Should we close this and make a new issue to fix this?
The scaling should be turned off in that the problem is already scaled. I was going to add some sub problems, but that is so low on my list that I'll close this now.
Not really an issue, but I like referencing something.