File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,11 @@ function modelingtoolkitize(prob::DiffEqBase.OptimizationProblem;
7979
8080 if DiffEqBase. isinplace (prob) && ! isnothing (prob. f. cons)
8181 lhs = Array {Num} (undef, num_cons)
82- prob. f. cons (lhs, vars, params)
82+ if p isa MTKParameters
83+ prob. f. cons (lhs, vars, params... )
84+ else
85+ prob. f. cons (lhs, vars, params)
86+ end
8387 cons = Union{Equation, Inequality}[]
8488
8589 if ! isnothing (prob. lcons)
@@ -108,7 +112,8 @@ function modelingtoolkitize(prob::DiffEqBase.OptimizationProblem;
108112 or pass the lower and upper bounds for inequality constraints." ))
109113 end
110114 elseif ! isnothing (prob. f. cons)
111- cons = prob. f. cons (vars, params)
115+ cons = p isa MTKParameters ? prob. f. cons (vars, params... ) :
116+ prob. f. cons (vars, params)
112117 else
113118 cons = []
114119 end
You can’t perform that action at this time.
0 commit comments