Skip to content

Commit 85e144a

Browse files
Update first_simulation.md to not be overdetermined
Fixes #281
1 parent e5f683a commit 85e144a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/src/getting_started/first_simulation.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ number of animals at each time?
5252
using ModelingToolkit, DifferentialEquations, Plots
5353
5454
# Define our state variables: state(t) = initial condition
55-
@variables t x(t)=1 y(t)=1 z(t)=2
55+
@variables t x(t)=1 y(t)=1 z(t)
5656
5757
# Define our parameters
5858
@parameters α=1.5 β=1.0 γ=3.0 δ=1.0
@@ -113,12 +113,14 @@ variables:
113113

114114
```@example first_sim
115115
# Define our state variables: state(t) = initial condition
116-
@variables t x(t)=1 y(t)=1 z(t)=2
116+
@variables t x(t)=1 y(t)=1 z(t)
117117
```
118118

119119
Notice here that we use the form `state = default`, where on the right-hand side the default
120-
value of a state is interpreted to be its initial condition. This is then done similarly
121-
for parameters, where the default value is now the parameter value:
120+
value of a state is interpreted to be its initial condition. Note that since `z` will be given
121+
by an algebraic equation, we do not need to specify its initial condition.
122+
123+
This is then done similarly for parameters, where the default value is now the parameter value:
122124

123125
```@example first_sim
124126
# Define our parameters

0 commit comments

Comments
 (0)