Skip to content

Commit 6f2d5cc

Browse files
Merge pull request #786 from AayushSabharwal/as/mtkv10
refactor: update to ModelingToolkitv10
2 parents 79cc603 + 2a71ca6 commit 6f2d5cc

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ FiniteDiff = "2"
6060
ForwardDiff = "0.10, 1"
6161
IncompleteLU = "0.2"
6262
JLD2 = "0.4, 0.5.1"
63-
ModelingToolkit = "9"
63+
ModelingToolkit = "10"
6464
NonlinearSolve = "3.15, 4"
6565
ODEProblemLibrary = "0.1"
6666
Optimization = "3, 4"

docs/src/basics/faq.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ DAE solvers will not be able to accurately solve the equation without rewriting
194194
ModelingToolkit is able to automatically detect this kind of condition and perform the equation
195195
transformation automatically. As such, if you are having difficulties with a DAE system, it is
196196
highly recommended to try `modelingtookitize` to transform the system to MTK's formulation and
197-
running `structural_simplify` to see how it would change the equations, simply convert the model
198-
to MTK.
197+
running `mtkcompile` to see how it would change the equations, simply convert the model to MTK.
199198

200199
## [Performance](@id faq_performance)
201200

docs/src/examples/outer_solar_system.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The data is taken from the book “Geometric Numerical Integration” by E. Hair
1616

1717
```@example outersolarsystem
1818
using Plots, OrdinaryDiffEq, ModelingToolkit
19+
using ModelingToolkit: t_nounits as t, D_nounits as D
1920
gr()
2021
2122
G = 2.95912208286e-4
@@ -47,9 +48,8 @@ Here, we want to solve for the motion of the five outer planets relative to the
4748
```@example outersolarsystem
4849
const ∑ = sum
4950
const N = 6
50-
@variables t u(t)[1:3, 1:N]
51+
@variables u(t)[1:3, 1:N]
5152
u = collect(u)
52-
D = Differential(t)
5353
potential = -G *
5454
∑(
5555
i -> ∑(j -> (M[i] * M[j]) / √(∑(k -> (u[k, i] - u[k, j])^2, 1:3)), 1:(i - 1)),
@@ -71,8 +71,7 @@ Thus, $\dot{q}$ is defined by the masses. We only need to define $\dot{p}$, and
7171
```@example outersolarsystem
7272
eqs = vec(@. D(D(u))) .~ .-ModelingToolkit.gradient(potential, vec(u)) ./
7373
repeat(M, inner = 3)
74-
@named sys = ODESystem(eqs, t)
75-
ss = structural_simplify(sys)
74+
@mtkcompile sys = System(eqs, t)
7675
prob = ODEProblem(ss, [vec(u .=> pos); vec(D.(u) .=> vel)], tspan)
7776
sol = solve(prob, Tsit5());
7877
```

0 commit comments

Comments
 (0)