File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ number of animals at each time?
52
52
using ModelingToolkit, DifferentialEquations, Plots
53
53
54
54
# 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)
56
56
57
57
# Define our parameters
58
58
@parameters α=1.5 β=1.0 γ=3.0 δ=1.0
@@ -113,12 +113,14 @@ variables:
113
113
114
114
``` @example first_sim
115
115
# 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)
117
117
```
118
118
119
119
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:
122
124
123
125
``` @example first_sim
124
126
# Define our parameters
You can’t perform that action at this time.
0 commit comments