Issue on page /notebooks/06.04-Soft-Landing-Apollo-11-on-the-Moon.html
alex-kling opened this issue · 3 comments
First , let me say thank you for your work with Pyomo, amazing software!
In the Soft landing example : 6.4.3. Version 2: Rescaled model, the boundary conditions are provided for the altitude (h_initial = 100000.0 m) and the orbital velocity (v_initial = 1520 m/s)
m.h[0].fix(h_initial)
m.v[0].fix(-v_initial)
I noticed that for the normalized formulation above, v(tau)=v(t)*T (T=final time) so the initial velocity provided is not scaled appropriately. That result in a velocity profile:
vsim = np.array([m.v[t]()/m.T() for t in m.t])
that does not match the 1520 m/s boundary conditions at t=0.
I suggest updating the example. (Also, is there an obvious work-around to specify boundary condition for the derivatives in a normalized setting?).
Best,
Actually, (answering my own question), something along the lines of :
m.h[0].fix(h_initial)
m.v_tf = pye.Constraint(m.t, rule=lambda m, t: pye.Constraint.Skip if t != m.t.first() else m.v[t] == v_initial*m.T)
for the initial conditions produces a solution.
@alex-kling Thank you. In case you did not know, @jckantor passed away during the summer. I plan on maintaining this cookbook here: https://github.com/ndcbe/ND-Pyomo-Cookbook
If you want to open a pull request, I'd love to have you as a contributor.