Skip to content

Commit e8335be

Browse files
author
Michael Tiller
committed
Merge pull request #221 from tbeu/add-ClassicModelFixedStartValues
Add ClassicModelFixedStartValues
2 parents 7a5ae4f + e9298ee commit e8335be

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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;

0 commit comments

Comments
 (0)