Skip to content

Commit 33dbf2e

Browse files
author
jcaillau
committed
debugging Lift calls
1 parent e0785b7 commit 33dbf2e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/goddard.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ savefig("goddard_fig1.png")
8484
u0 = 0
8585
u1 = 1
8686

87-
H0(x, p) = Lift(F0)(x, p)
88-
H1(x, p) = Lift(F1)(x, p)
87+
H0 = Lift(F0); H1 = Lift(F1)
88+
#H0(x, p) = Lift(F0)(x, p); H1(x, p) = Lift(F1)(x, p) # debug
8989
H01 = @Poisson { H0, H1 }
9090
H001 = @Poisson { H0, H01 }
9191
H101 = @Poisson { H1, H01 }
@@ -120,16 +120,16 @@ t = direct_sol.times
120120
x = direct_sol.state
121121
u = direct_sol.control
122122
p = direct_sol.costate
123-
H1(t) = H1(x(t), p(t))
123+
φ(t) = H1(x(t), p(t))
124124

125125
u_plot = plot(t, t -> u(t)[1], label = "u(t)" )
126-
H1_plot = plot(t, H1 , label = "H₁(x(t), p(t))")
126+
H1_plot = plot(t, φ , label = "H₁(x(t), p(t))")
127127
g_plot = plot(t, g x , label = "g(x(t))" )
128128
display(plot(u_plot, H1_plot, g_plot, layout=(3,1), size=(700,600)))
129129
savefig("goddard_fig2.png")
130130

131131
η = 1e-3
132-
t13 = t[ abs.(H1.(t)) .≤ η ]
132+
t13 = t[ abs.(φ.(t)) .≤ η ]
133133
t23 = t[ 0 .≤ (g x).(t) .≤ η ]
134134
p0 = p(t0)
135135
t1 = min(t13...)

examples/goddard_fig3.png

-5.93 KB
Loading

0 commit comments

Comments
 (0)