-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbeam.jl
More file actions
31 lines (26 loc) · 814 Bytes
/
beam.jl
File metadata and controls
31 lines (26 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Beam optimal control problem definition used by tests and examples.
#
# Returns a NamedTuple with fields:
# - ocp :: the CTParser-defined optimal control problem
# - obj :: reference optimal objective value (Ipopt / MadNLP, Collocation)
# - name :: a short problem name
# - init :: NamedTuple of components for CTSolvers.initial_guess
function Beam()
ocp = @def begin
t ∈ [0, 1], time
x ∈ R², state
u ∈ R, control
x(0) == [0, 1]
x(1) == [0, -1]
0 ≤ x₁(t) ≤ 0.1
-10 ≤ u(t) ≤ 10
∂(x₁)(t) == x₂(t)
∂(x₂)(t) == u(t)
∫(u(t)^2) → min
end
init = @init ocp begin
x(t) := [0.05, 0.1]
u(t) := 0.1
end
return (ocp=ocp, obj=8.898598, name="beam", init=init)
end