Skip to content

Commit 4c47599

Browse files
refactor: update for MTKv9
1 parent 4da7756 commit 4c47599

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ForwardDiff = "0.10.26"
5151
LinearAlgebra = "1.10"
5252
Logging = "1.10"
5353
LoggingExtras = "0.4, 1"
54-
ModelingToolkit = "8.74"
54+
ModelingToolkit = "8.74, 9"
5555
Pkg = "1"
5656
Printf = "1.10"
5757
ProgressLogging = "0.1"

lib/OptimizationMOI/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
1717
Ipopt_jll = "=300.1400.400"
1818
Juniper = "0.9"
1919
MathOptInterface = "1"
20-
ModelingToolkit = "8.74"
20+
ModelingToolkit = "9"
2121
Optimization = "3.21"
2222
Reexport = "1.2"
2323
SymbolicIndexingInterface = "0.3"

lib/OptimizationMOI/src/OptimizationMOI.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using MathOptInterface
66
using Optimization.SciMLBase
77
using SymbolicIndexingInterface
88
using SparseArrays
9-
import ModelingToolkit: parameters, states, varmap_to_vars, mergedefaults, toexpr
9+
import ModelingToolkit: parameters, unknowns, varmap_to_vars, mergedefaults, toexpr
1010
import ModelingToolkit
1111
const MTK = ModelingToolkit
1212
using Symbolics
@@ -182,12 +182,12 @@ end
182182
"""
183183
convert_to_expr(eq, sys; expand_expr = false, pairs_arr = expr_map(sys))
184184
185-
Converts the given symbolic expression to a Julia `Expr` and replaces all symbols, i.e. states and
185+
Converts the given symbolic expression to a Julia `Expr` and replaces all symbols, i.e. unknowns and
186186
parameters with `x[i]` and `p[i]`.
187187
188188
# Arguments:
189189
- `eq`: Expression to convert
190-
- `sys`: Reference to the system holding the parameters and states
190+
- `sys`: Reference to the system holding the parameters and unknowns
191191
- `expand_expr=false`: If `true` the symbolic expression is expanded first.
192192
"""
193193
function convert_to_expr(eq, expr_map; expand_expr = false)
@@ -206,7 +206,7 @@ function convert_to_expr(eq, expr_map; expand_expr = false)
206206
end
207207

208208
function get_expr_map(sys)
209-
dvs = ModelingToolkit.states(sys)
209+
dvs = ModelingToolkit.unknowns(sys)
210210
ps = ModelingToolkit.parameters(sys)
211211
return vcat([ModelingToolkit.toexpr(_s) => Expr(:ref, :x, i)
212212
for (i, _s) in enumerate(dvs)],

0 commit comments

Comments
 (0)