OptimalControl news #19
Replies: 2 comments 4 replies
-
Goddard functionalAgain, since the control is one dimensional and the usage is scalar, cf. f(x, u) = F0(x) + u*F1(x) You can compare the height of the control plot with the basic case: plot(direct_sol) Remark. The direct method is very slow! In the indirect method, we have a scalar usage too: u0(x, p) = 0. # instead of u0(x, p) = [0.]
u1(x, p) = 1.
us(x, p) = -H001(x, p) / H101(x, p)
ub(x, _) = -Ad(F0, g)(x) / Ad(F1, g)(x) Remark. For the moment, when we have a saturated state constraint, we have to pass to fb = Flow(ocp, ub, (x, _) -> g(x), μb) In this new version of t = direct_sol.times
x = direct_sol.state # it a function of time
u = direct_sol.control # it a function of time
p = direct_sol.adjoint # it a function of time
H1(t) = H1(x(t), p(t)) # the switching function
u_plot = plot(t, t -> u(t)[1], xlabel = "t", ylabel = "u", legend = false)
H1_plot = plot(t, H1, xlabel = "t", ylabel = "H1", legend = false)
g_plot = plot(t, g∘x, xlabel = "t", ylabel = "g", legend = false)
display(plot(u_plot, H1_plot, g_plot, layout=(3,1), size=(400,300)))
t13 = t[ abs.(H1.(t)) .≤ η ]
t23 = t[ 0 .≤ (g∘x).(t) .≤ η ]
p0 = p(t0) Finally, for the moment, there is no automatic plot of a solution of a flow: f1sb0 = f1 * (t1, fs) * (t2, fb) * (t3, f0) # concatenation of the Hamiltonian flows
flow_sol = f1sb0((t0, tf), x0, p0)
r_plot = plot(flow_sol, idxs=(0, 1), xlabel="t", label="r")
v_plot = plot(flow_sol, idxs=(0, 2), xlabel="t", label="v")
m_plot = plot(flow_sol, idxs=(0, 3), xlabel="t", label="m")
pr_plot = plot(flow_sol, idxs=(0, 4), xlabel="t", label="p_r")
pv_plot = plot(flow_sol, idxs=(0, 5), xlabel="t", label="p_v")
pm_plot = plot(flow_sol, idxs=(0, 6), xlabel="t", label="p_m")
plot(r_plot, pr_plot, v_plot, pv_plot, m_plot, pv_plot, layout=(3, 2), size=(600, 300)) |
Beta Was this translation helpful? Give feedback.
-
Also the basic integrator
…
On Mar 19, 2023 at 14:24, joseph-gergaud ***@***.***> wrote:
The only case where it should be possible is the case of a ''smooth'' optimal control , so without singular arc, active path constraints, ...
For the moment we have the case of the Goddard problem
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
OptimalControl v0.3.0
To have a look at the new version of OptimalControl, see
Basic functional
By default, the
Model
is autonomous and the usage is scalar, that is the user has to treat one dimensional state, control, adjoint and others asscalar
and notVector
of dimension 1.Remark.
u
byu[1]
in the example above.u
is one dimensional:If you take a look at the output of the direct solver, you can see that I have removed the
Ipopt
header:produces
See also the plot of a solution. A solution from a direct or a direct shooting method is of same Type which is
OptimalControlSolution
. I have written a plot of anOptimalControlSolution
that you can find in CTBase.plot(sol)
Remark. The height of the
control
plot depends on the number of controls and states.Beta Was this translation helpful? Give feedback.
All reactions