We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c811119 + 640606f commit 7b5021dCopy full SHA for 7b5021d
1 file changed
test/extras/plot_variable.jl
@@ -7,17 +7,16 @@ import CTParser: CTParser, @def
7
CTParser.set_prefix(:CTModels); # code generated by @def is prefixed by CTModels (not by OptimalControl - the default)
8
9
ocp = @def begin
10
-
11
- tf ∈ R, variable
12
- t ∈ [0, tf], time
+ tf ∈ R, variable
+ t ∈ [0, tf], time
13
x = (q, v) ∈ R², state
14
- u ∈ R, control
+ u ∈ R, control
15
16
tf ≥ 0
17
-1 ≤ u(t) ≤ 1
18
19
- q(0) == -1
20
- v(0) == 0
+ q(0) == -1
+ v(0) == 0
21
q(tf) == 0
22
v(tf) == 0
23
@@ -26,8 +25,7 @@ ocp = @def begin
26
25
ẋ(t) == [v(t), u(t)]
27
28
tf → min
29
30
end
31
32
sol = CTDirect.solve(ocp; print_level=4)
33
-plot(sol, ocp)
+plot(sol, ocp)
0 commit comments