Skip to content

Commit 6606f7a

Browse files
more improvements
1 parent 3045cb1 commit 6606f7a

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

docs/src/basics/Validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ second argument.
8383
```@example validation2
8484
using ModelingToolkit, Unitful
8585
# Composite type parameter in registered function
86-
@parameters t
86+
@variables t
8787
D = Differential(t)
8888
struct NewType
8989
f::Any

docs/src/basics/Variable_metadata.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ Descriptive strings can be attached to variables using the `[description = "desc
1010

1111
```@example metadata
1212
using ModelingToolkit
13+
using ModelingToolkit: t_nounits as t, D_nounits as D
1314
@variables u [description = "This is my input"]
1415
getdescription(u)
1516
```
1617

1718
When variables with descriptions are present in systems, they will be printed when the system is shown in the terminal:
1819

1920
```@example metadata
20-
@parameters t
2121
@variables u(t) [description = "A short description of u"]
2222
@parameters p [description = "A description of p"]
2323
@named sys = ODESystem([u ~ p], t)
@@ -62,6 +62,8 @@ Designate a variable as either an input or an output using the following
6262

6363
```@example metadata
6464
using ModelingToolkit
65+
using ModelingToolkit: t_nounits as t, D_nounits as D
66+
6567
@variables u [input = true]
6668
isinput(u)
6769
```
@@ -137,8 +139,6 @@ For systems that contain parameters with metadata like described above, have som
137139
In the example below, we define a system with tunable parameters and extract bounds vectors
138140

139141
```@example metadata
140-
@parameters t
141-
Dₜ = Differential(t)
142142
@variables x(t)=0 u(t)=0 [input = true] y(t)=0 [output = true]
143143
@parameters T [tunable = true, bounds = (0, Inf)]
144144
@parameters k [tunable = true, bounds = (0, Inf)]

docs/src/examples/higher_order.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ eqs = [D(D(x)) ~ σ * (y - x),
2222
D(y) ~ x * (ρ - z) - y,
2323
D(z) ~ x * y - β * z]
2424
25-
@named sys = ODESystem(eqs)
25+
@named sys = ODESystem(eqs,t)
2626
```
2727

2828
Note that we could've used an alternative syntax for 2nd order, i.e.

docs/src/examples/modelingtoolkitize_index_reduction.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pendulum_prob = ODEProblem(pendulum_fun!, u0, tspan, p)
3131
traced_sys = modelingtoolkitize(pendulum_prob)
3232
pendulum_sys = structural_simplify(dae_index_lowering(traced_sys))
3333
prob = ODEProblem(pendulum_sys, [], tspan)
34-
sol = solve(prob, Tsit5(), abstol = 1e-8, reltol = 1e-8)
34+
sol = solve(prob, Rodas5P(), abstol = 1e-8, reltol = 1e-8)
3535
plot(sol, idxs = unknowns(traced_sys))
3636
```
3737

@@ -71,7 +71,7 @@ u0 = [1.0, 0, 0, 0, 0];
7171
p = [9.8, 1];
7272
tspan = (0, 10.0);
7373
pendulum_prob = ODEProblem(pendulum_fun!, u0, tspan, p)
74-
solve(pendulum_prob, Rodas4())
74+
solve(pendulum_prob, Rodas5P())
7575
```
7676

7777
However, one will quickly be greeted with the unfortunate message:
@@ -151,7 +151,7 @@ numerical solver. Let's try that out:
151151
traced_sys = modelingtoolkitize(pendulum_prob)
152152
pendulum_sys = structural_simplify(dae_index_lowering(traced_sys))
153153
prob = ODEProblem(pendulum_sys, Pair[], tspan)
154-
sol = solve(prob, Rodas4())
154+
sol = solve(prob, Rodas5P())
155155
156156
using Plots
157157
plot(sol, idxs = unknowns(traced_sys))

docs/src/tutorials/ode_modeling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ function fol_factory(separate = false; name)
256256
D(x) ~ RHS] :
257257
D(x) ~ (f - x) / τ
258258
259-
ODESystem(eqs; name)
259+
ODESystem(eqs, t; name)
260260
end
261261
```
262262

@@ -277,7 +277,7 @@ again are just algebraic relations:
277277
connections = [fol_1.f ~ 1.5,
278278
fol_2.f ~ fol_1.x]
279279
280-
connected = compose(ODESystem(connections, name = :connected), fol_1, fol_2)
280+
connected = compose(ODESystem(connections, t, name = :connected), fol_1, fol_2)
281281
```
282282

283283
All equations, variables, and parameters are collected, but the structure of the

0 commit comments

Comments
 (0)