Skip to content

Commit 05f7e49

Browse files
refactor: update for MTKv9
1 parent 2736e2d commit 05f7e49

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
@@ -50,7 +50,7 @@ ForwardDiff = "0.10.26"
5050
LinearAlgebra = "1.10"
5151
Logging = "1.10"
5252
LoggingExtras = "0.4, 1"
53-
ModelingToolkit = "8.74"
53+
ModelingToolkit = "8.74, 9"
5454
Pkg = "1"
5555
Printf = "1.10"
5656
ProgressLogging = "0.1"

lib/OptimizationMOI/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Ipopt = "1"
1919
Ipopt_jll = "300.1400"
2020
Juniper = "0.9"
2121
MathOptInterface = "1"
22-
ModelingToolkit = "8.74"
22+
ModelingToolkit = "9"
2323
NLopt = "1"
2424
Optimization = "3.21"
2525
Reexport = "1.2"

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
@@ -183,13 +183,13 @@ end
183183
"""
184184
convert_to_expr(eq, sys; expand_expr = false, pairs_arr = expr_map(sys))
185185
186-
Converts the given symbolic expression to a Julia `Expr` and replaces all symbols, i.e. states and
186+
Converts the given symbolic expression to a Julia `Expr` and replaces all symbols, i.e. unknowns and
187187
parameters with `x[i]` and `p[i]`.
188188
189189
# Arguments:
190190
191191
- `eq`: Expression to convert
192-
- `sys`: Reference to the system holding the parameters and states
192+
- `sys`: Reference to the system holding the parameters and unknowns
193193
- `expand_expr=false`: If `true` the symbolic expression is expanded first.
194194
"""
195195
function convert_to_expr(eq, expr_map; expand_expr = false)
@@ -208,7 +208,7 @@ function convert_to_expr(eq, expr_map; expand_expr = false)
208208
end
209209

210210
function get_expr_map(sys)
211-
dvs = ModelingToolkit.states(sys)
211+
dvs = ModelingToolkit.unknowns(sys)
212212
ps = ModelingToolkit.parameters(sys)
213213
return vcat(
214214
[ModelingToolkit.toexpr(_s) => Expr(:ref, :x, i)

0 commit comments

Comments
 (0)