Skip to content

Commit f7bfc1e

Browse files
docs: import SciCompDSL for @mtkmodel and use symbolic map for ODEProblem
ModelingToolkit 11 no longer re-exports SciCompDSL, so `@mtkmodel` is not in scope after `using ModelingToolkit` alone — every doc tutorial that defines an `@mtkmodel` block was failing during docs build with `UndefVarError: @mtkmodel`. Add `using SciCompDSL` to each affected tutorial (and to docs/Project.toml). Also fix `connections.md`: the electrical example called `ODEProblem(sys, [1.0], (0, 10.0))`, which the v3 problem constructor rejects with `The operating_point passed to the problem constructor must be a symbolic map.` Replace with `[capacitor.v => 1.0]`. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
1 parent dc6ae8b commit f7bfc1e

9 files changed

Lines changed: 10 additions & 1 deletion

File tree

docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
88
ModelingToolkitStandardLibrary = "16a59e39-deab-5bd0-87e4-056b12336739"
99
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
1010
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
11+
SciCompDSL = "91a8cdf1-4ca6-467b-a780-87fda3fff15e"
1112

1213
[compat]
1314
ControlSystemsBase = "1.1"
@@ -18,3 +19,4 @@ IfElse = "0.1"
1819
ModelingToolkit = "11"
1920
OrdinaryDiffEq = "6, 7"
2021
Plots = "1.36"
22+
SciCompDSL = "1"

docs/src/connectors/connections.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ nothing # hide
113113
The solution shows what we would expect, a non-linear dissipation of voltage and related decrease in current flow…
114114

115115
```@example connections
116-
prob = ODEProblem(sys, [1.0], (0, 10.0))
116+
prob = ODEProblem(sys, [capacitor.v => 1.0], (0, 10.0))
117117
sol = solve(prob)
118118
119119
p1 = plot(sol, idxs = [capacitor.v])

docs/src/connectors/sign_convention.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ The flow variable (i.e. force) input component for the `Mechanical` domain is
6161
using ModelingToolkit
6262
using ModelingToolkitStandardLibrary.Mechanical.Translational
6363
using ModelingToolkit: t_nounits as t
64+
using SciCompDSL
6465
6566
@mtkmodel ConstantForce begin
6667
@parameters begin

docs/src/tutorials/MOSFET_calibration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ using ModelingToolkitStandardLibrary.Electrical
1010
using ModelingToolkitStandardLibrary.Blocks: Constant
1111
using OrdinaryDiffEq
1212
using Plots
13+
using SciCompDSL
1314
```
1415

1516
Here we just connect the source pin to ground, the drain pin to a voltage source named `Vcc`, and the gate pin to a voltage source named `Vb`.

docs/src/tutorials/custom_component.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ using ModelingToolkit: t_nounits as t
1212
using ModelingToolkitStandardLibrary.Electrical
1313
using OrdinaryDiffEq
1414
using Plots
15+
using SciCompDSL
1516
```
1617

1718
## Custom Component

docs/src/tutorials/dc_motor_pi.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ using ModelingToolkitStandardLibrary.Mechanical.Rotational
2020
using ModelingToolkitStandardLibrary.Blocks
2121
using OrdinaryDiffEq
2222
using Plots
23+
using SciCompDSL
2324
```
2425

2526
The actual model can now be composed.

docs/src/tutorials/input_component.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ using DataInterpolations
3232
using OrdinaryDiffEq
3333
using DataFrames
3434
using Plots
35+
using SciCompDSL
3536
3637
function MassSpringDamper(; name)
3738
@named input = RealInput()

docs/src/tutorials/rc_circuit.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ using ModelingToolkit, OrdinaryDiffEq, Plots
1111
using ModelingToolkitStandardLibrary.Electrical
1212
using ModelingToolkitStandardLibrary.Blocks: Constant
1313
using ModelingToolkit: t_nounits as t
14+
using SciCompDSL
1415
1516
@mtkmodel RC begin
1617
@parameters begin

docs/src/tutorials/thermal_model.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ from dividing the total initial energy in the system by the sum of the heat capa
99
```@example
1010
using ModelingToolkitStandardLibrary.Thermal, ModelingToolkit, OrdinaryDiffEq, Plots
1111
using ModelingToolkit: t_nounits as t
12+
using SciCompDSL
1213
1314
@mtkmodel HeatConductionModel begin
1415
@parameters begin

0 commit comments

Comments
 (0)