File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
ModelicaByExample/BasicEquations/LotkaVolterra Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change
1
+ within ModelicaByExample.BasicEquations.LotkaVolterra;
2
+ model ClassicModelFixedStartValues "This is the typical equation-oriented model"
3
+ parameter Real alpha= 0.1 "Reproduction rate of prey" ;
4
+ parameter Real beta= 0.02 "Mortality rate of predator per prey" ;
5
+ parameter Real gamma= 0.4 "Mortality rate of predator" ;
6
+ parameter Real delta= 0.02 "Reproduction rate of predator per prey" ;
7
+ parameter Real x0= 10 "Initial prey population" ;
8
+ parameter Real y0= 10 "Initial predator population" ;
9
+ Real x(
10
+ start= x0,
11
+ fixed= true ) "Prey population" ;
12
+ Real y(
13
+ start= y0,
14
+ fixed= true ) "Predator population" ;
15
+ equation
16
+ der (x) = x* (alpha- beta* y);
17
+ der (y) = y* (delta* x- gamma);
18
+ end ClassicModelFixedStartValues;
You can’t perform that action at this time.
0 commit comments