@ocots @PierreMartinon Same kind of error with AD as in #384 tough here the problem seems to be directly related to using a constant in the computation: this fails (Cannot determine ordering of Dual tags ForwardDiff.Tag)
using OptimalControl
using NLPModelsIpopt
o = @def begin
v ∈ R, variable
t ∈ [0, 1], time
x ∈ R², state
u ∈ R, control
-1 ≤ v ≤ 1
x(0) - [-1, v] == [0, 0] # OK: the boundary contraint may involve the variable
x(1) == [0, 0]
ẋ(t) == [x₂(t), u(t)]
∫( 0.5u(t)^2 ) → min
end
s = solve(o)
this also fails (same error)
o = @def begin
v ∈ R, variable
t ∈ [0, 1], time
x ∈ R², state
u ∈ R, control
-1 ≤ v ≤ 1
x(0) - [-one(v), v] == [0, 0] # OK: the boundary contraint may involve the variable
x(1) == [0, 0]
ẋ(t) == [x₂(t), u(t)]
∫( 0.5u(t)^2 ) → min
end
while this is OK
o = @def begin
v ∈ R, variable
t ∈ [0, 1], time
x ∈ R², state
u ∈ R, control
-1 ≤ v ≤ 1
x(0) - [-1 + 0v, v] == [0, 0] # OK: the boundary contraint may involve the variable
x(1) == [0, 0]
ẋ(t) == [x₂(t), u(t)]
∫( 0.5u(t)^2 ) → min
end
@PierreMartinon I thought that using one as above (second version; see also zero) solved the problem, but this is not the case. any clue?
@ocots @PierreMartinon Same kind of error with AD as in #384 tough here the problem seems to be directly related to using a constant in the computation: this fails (
Cannot determine ordering of Dual tags ForwardDiff.Tag)this also fails (same error)
while this is OK
@PierreMartinon I thought that using
oneas above (second version; see alsozero) solved the problem, but this is not the case. any clue?