Skip to content

Commit 7f821e2

Browse files
committed
Use t_nounits, D_nounits
1 parent aaae59d commit 7f821e2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/src/tutorials/change_independent_variable.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ Consider a projectile shot with some initial velocity in a vertical gravitationa
1818

1919
```@example changeivar
2020
using ModelingToolkit
21-
@independent_variables t
22-
D = Differential(t)
21+
using ModelingToolkit: t_nounits as t, D_nounits as D
2322
@variables x(t) y(t)
2423
@parameters g=9.81 v # gravitational acceleration and horizontal velocity
2524
eqs = [D(D(y)) ~ -g, D(x) ~ v]
@@ -128,7 +127,7 @@ Unlike the original, notice that this system is *non-autonomous* because the ind
128127
This means that to change the independent variable from $a$ to $b$, we must provide not only the rate of change relation $db(a)/da = \exp(-b)$, but *also* the equation $a(b) = \exp(b)$ so $a$ can be eliminated in favor of $b$:
129128

130129
```@example changeivar
131-
a = M2.a
130+
a = M2.a # get independent variable of M2
132131
Da = Differential(a)
133132
@variables b(a)
134133
M3 = change_independent_variable(M2, b, [Da(b) ~ exp(-b), a ~ exp(b)])

0 commit comments

Comments
 (0)