You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
α =5@def ocp begin
t ∈ [ 0, 1 ], time
v ∈ R, variable
x ∈ R², state
u ∈ R, control
x(0) == [ -1, 0 ]
x(1) == [ 0, v ]
ẋ(t) == [ x₂(t), x₁(t) + α*x₁(t)^2+u(t) ]
v^2+∫( 0.5u(t)^2 ) → min
end
Why?
Here is the error message:
Line 6: x(1) == [0, v]
UndefVarError: `v` not defined
Stacktrace:
[1] macro expansion
@ [~/.julia/packages/CTBase/rsUEs/src/onepass.jl:50](https://file+.vscode-resource.vscode-cdn.net/Users/ocots/Boulot/recherche/logiciels/dev/control-toolbox/OptimalControl/docs/src/~/.julia/packages/CTBase/rsUEs/src/onepass.jl:50) [inlined]
[2] top-level scope
@ [~/Boulot/recherche/logiciels/dev/control-toolbox/OptimalControl/docs/src/init.ipynb:8](https://file+.vscode-resource.vscode-cdn.net/Users/ocots/Boulot/recherche/logiciels/dev/control-toolbox/OptimalControl/docs/src/~/Boulot/recherche/logiciels/dev/control-toolbox/OptimalControl/docs/src/init.ipynb:8)
The text was updated successfully, but these errors were encountered:
@ocots Right-hand sides or, more generally, lower and upper values of box contraints, must be evaluable by Julia (must not contain variables, etc.) So this problem should be defined according to:
α =5@def ocp begin
t ∈ [ 0, 1 ], time
v ∈ R, variable
x ∈ R², state
u ∈ R, control
x(0) == [ -1, 0 ]
x(1) - [ 0, v ] == [ 0, 0 ]
ẋ(t) == [ x₂(t), x₁(t) + α*x₁(t)^2+u(t) ]
v^2+∫( 0.5u(t)^2 ) → min
end
This definition is not authorized:
Why?
Here is the error message:
Line 6: x(1) == [0, v] UndefVarError: `v` not defined Stacktrace: [1] macro expansion @ [~/.julia/packages/CTBase/rsUEs/src/onepass.jl:50](https://file+.vscode-resource.vscode-cdn.net/Users/ocots/Boulot/recherche/logiciels/dev/control-toolbox/OptimalControl/docs/src/~/.julia/packages/CTBase/rsUEs/src/onepass.jl:50) [inlined] [2] top-level scope @ [~/Boulot/recherche/logiciels/dev/control-toolbox/OptimalControl/docs/src/init.ipynb:8](https://file+.vscode-resource.vscode-cdn.net/Users/ocots/Boulot/recherche/logiciels/dev/control-toolbox/OptimalControl/docs/src/~/Boulot/recherche/logiciels/dev/control-toolbox/OptimalControl/docs/src/init.ipynb:8)
The text was updated successfully, but these errors were encountered: