-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Future: declaration of time, state, control and variable in the abstract syntax #257
Comments
PreliminariesTo define an optimal control problem with the abstract syntax, one must use the Line 504 in e77f83a
The key internal function is the one which in one pass parse the code: Line 75 in e77f83a
Every line of the code is parsed to in order to call the right functional method to construct the model of For instance, ocp = @def t ∈ [0, 1], time is transformed into time!(ocp, t0=0, tf=1) from
thanks to the internal function Line 99 in e77f83a
and Line 201 in e77f83a
|
Current possibilitiesVariableIn order to declare a variable we have: :( $v ∈ R^$q, variable )
:( $v ∈ R , variable ) Example. @def begin
v ∈ R², variable
end Aliases @def begin
v = (a, b) ∈ R², variable
end A one dimensional variable can be declared according to @def begin
v ∈ R, variable
end TimeIn order to declare the time we have: :( $t ∈ [$t0, $tf], time ) The independent variable or time is a scalar bound to a given interval. Its name is arbitrary. t0 = 1
tf = 5
@def begin
t ∈ [t0, tf], time
end One (or even the two bounds) can be variable, typically for minimum time problems (see Mayer cost section): @def begin
v = (T, λ) ∈ R², variable
t ∈ [0, T], time
end State:( $x ∈ R^$n, state )
:( $x ∈ R , state ) The state declaration defines the name and the dimension of the state: @def begin
x ∈ R⁴, state
end As for the variable, there are automatic aliases ( @def begin
x = (q₁, q₂, v₁, v₂) ∈ R⁴, state
end Control:( $u ∈ R^$m, control )
:( $u ∈ R , control ) The control declaration defines the name and the dimension of the control: @def begin
u ∈ R², control
end As before, there are automatic aliases ( @def begin
u = (α, β) ∈ R², control
end Constraints:( $e1 == $e2 )
:( $e1 ≤ $e2 ≤ $e3 )
:( $e2 ≤ $e3 )
:( $e3 ≥ $e2 ≥ $e1 )
:( $e2 ≥ $e1 ) Admissible constraints can be
Boundary conditions are detected when the expression contains evaluations of the state at initial and / or final time bounds (e.g.,
@def begin
tf ∈ R, variable
t ∈ [0, tf], time
x ∈ R², state
u ∈ R, control
x(0) == [-1, 0]
x(tf) == [0, 0]
ẋ(t) == [x₂(t), u(t)]
tf ≥ 0
x₂(t) ≤ 1
u(t)^2 ≤ 1
end Note Symbols like |
TodoTo declare the time, state, control and variable, I propose the following possibilities: @def begin
t ∈ [ 0, 1 ], time
x ∈ R³, state
u ∈ R², control
end
# or
@def begin
(t, x, u) ∈ [ 0, 1 ] × R³ × R²
end @def begin
v ∈ R², variable
t ∈ [ 0, v₂ ], time
x ∈ R³, state
u ∈ R², control
end
# or
@def begin
(t, x, u, v) ∈ [ 0, v₂ ] × R³ × R² × R²
end @def begin
t ∈ [ 0, 1 ], time
x = (a, b, c) ∈ R³, state
u ∈ R², control
u₁(t) ≥ 0
0 ≤ c(t) ≤ 1
end
# or
@def begin
t ∈ [ 0, 1 ], time
x = (a, b, c) ∈ R² × [ 0, 1 ] , state
u ∈ R₊ × R, control
end
# or
@def begin
t ∈ [ 0, 1 ], time
x = (a, b, c) ∈ R × R × [ 0, 1 ] , state
u ∈ [ 0, +∞) × R, control
end |
Need also to add: |
@ocots not a big fan of everything in the same line as in (t, x, u, v) ∈ [ 0, v₂ ] × R³ × R² × R² and not at all top priority I would say... but: if you want it, add it 🙂! |
The idea of this issue is to add possibilities of declaration of time, state, control and variable.
For instance, this current declaration
must be equivalent to
In the comments below, you will find:
The text was updated successfully, but these errors were encountered: