Skip to content

Commit bf73684

Browse files
Update optimizationsystem.jl
Adds documentation following up from #1943 , if `cons_j` and `cons_h` are set by default to `false`, it is necessary to document that the user may need to set them to `true`. Otherwise, certain solvers such as `IPNewton()` with `OptimizationOptimJL` fail with no documentation.
1 parent 4ab3846 commit bf73684

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/systems/optimization/optimizationsystem.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,16 @@ function DiffEqBase.OptimizationProblem{iip}(sys::OptimizationSystem,u0map,
191191
parammap=DiffEqBase.NullParameters();
192192
grad = false,
193193
hess = false, sparse = false,
194+
cons_j = false, cons_h = false,
194195
checkbounds = false,
195196
linenumbers = true, parallel=SerialForm(),
196197
kwargs...) where iip
197198
```
198199
199200
Generates an OptimizationProblem from an OptimizationSystem and allows for automatically
200201
symbolically calculating numerical enhancements.
202+
203+
Certain solvers require setting `cons_j`, `cons_h` to `true` for constrained-optimization problems.
201204
"""
202205
function DiffEqBase.OptimizationProblem(sys::OptimizationSystem, args...; kwargs...)
203206
DiffEqBase.OptimizationProblem{true}(sys::OptimizationSystem, args...; kwargs...)

0 commit comments

Comments
 (0)