Skip to content

Commit c484844

Browse files
Pass zero bounds for constraints when mtkizing
1 parent 613ddde commit c484844

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/function/mtk.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AutoModelingToolkit() = AutoModelingToolkit(false, false)
88
function instantiate_function(f, x, adtype::AutoModelingToolkit, p, num_cons = 0)
99
p = isnothing(p) ? SciMLBase.NullParameters() : p
1010

11-
sys = ModelingToolkit.modelingtoolkitize(OptimizationProblem(f, x, p), num_cons = num_cons)
11+
sys = ModelingToolkit.modelingtoolkitize(OptimizationProblem(f, x, p; lcons = fill(0.0, num_cons), ucons = fill(0.0, num_cons)))
1212
sys = ModelingToolkit.structural_simplify(sys)
1313
f = OptimizationProblem(sys, x, p, grad = true, hess = true, obj_sparse = adtype.obj_sparse, cons_j = true, cons_h = true, cons_sparse = adtype.cons_sparse).f
1414

0 commit comments

Comments
 (0)