@@ -52,10 +52,10 @@ function modelingtoolkitize(prob::DiffEqBase.SDEProblem)
52
52
else
53
53
p = prob. p
54
54
end
55
- var (x, i) = Sym {FnType{Tuple{symtype(t)}, Real}} (nameof (Variable (: x , i)))
55
+ var (x, i) = Num ( Sym {FnType{Tuple{symtype(t)}, Real}} (nameof (Variable (x, i) )))
56
56
vars = reshape ([var (:x , i)(value (t)) for i in eachindex (prob. u0)],size (prob. u0))
57
57
params = p isa DiffEqBase. NullParameters ? [] :
58
- reshape ([Variable (:α ,i ) for i in eachindex (p)],size (p))
58
+ reshape ([Num ( Sym {Real} ( nameof ( Variable (:α , i))) ) for i in eachindex (p)],size (p))
59
59
60
60
@derivatives D' ~ t
61
61
@@ -102,10 +102,9 @@ function modelingtoolkitize(prob::DiffEqBase.OptimizationProblem)
102
102
p = prob. p
103
103
end
104
104
105
- vars = reshape ([Variable (:x , i) for i in eachindex (prob. u0)],size (prob. u0))
105
+ vars = reshape ([Num ( Sym {Real} ( nameof ( Variable (:x , i))) ) for i in eachindex (prob. u0)],size (prob. u0))
106
106
params = p isa DiffEqBase. NullParameters ? [] :
107
- reshape ([Variable (:α ,i) for i in eachindex (p)],size (Array (p)))
108
-
107
+ reshape ([Num (Sym {Real} (nameof (Variable (:α , i)))) for i in eachindex (p)],size (Array (p)))
109
108
110
109
eqs = prob. f (vars, params)
111
110
de = OptimizationSystem (eqs,vec (vars),vec (params))
0 commit comments