FISHTANK.MOD

From Support

Jump to: navigation, search

Back to Model Library

See also: How to read .MOD pages

Contents

Description

FISHTANK.MOD is an example of how a continuous time simulation (where the values of state variables are modeled as changing continuously) can be simulated using event graphs and the SIGMA software. See Continuous Time Simulations.

A realistic but simple example of a continuous time simulation is a model of a large fish breeding aquarium by Jean-Didier Opsomer. This model is FISHTANK.MOD. The population dynamics of a tropical fish called a discus is modeled. The simplified food chain in this ecosystem model consists of phytoplankton (algae), zooplankton, daphnia, and small fish. Several fish may be purchased and introduced into the system at once; they are typically sold one at a time. Each population in the food chain is modeled with a linear feeding and piece-wise linear growth rate that depends on the relative sizes of each population. In addition to feeding rates, a rate-limiting nutrient, phosphate, is used. Termination events for this system are eutrophication (explosive algae growth) and extinction.

Using this model, the effects of fish introduction, feeding rate, and phosphate introduction are studied with the objective of determining appropriate target populations for the plankton and daphnia.

State Variables

State Variables in FISHTANK.MOD
Variable Name Variable Description Size Type
FISH Number of fish 1 Integer
XP Phosphates 1,1 Real
XA Phytoplanton 1,1 Real
XZ Zooplankton 1,1 Real
XD Daphnia 1,1 Real
NOW Beginning of step 1,1 Real
F1 Change in fish 1,1 Integer
MX Feeding rate 1,1 Real
GX Growth rate 1,1 Real
STEP Size of step 1,1 Real
TMIN Maximum allowable step size 1,1 Real
XPRBAR Mean phosphate level 1,1 Real
M Smoothing parameter 1,1 Integer
XABAR Target Phytopl. level 1,1 Integer
XZBAR Target Zoopl. level 1,1 Integer
XDBAR Target Daphnia level 1,1 Integer
PF Probability of fish increase 1,1 Real
XPRNEW New phosphate rate 1,1 Real
XPR Phosphate input rate 1,1 Real

Vertices

Vertices in FISHTANK.MOD
Vertex Name Vertex Description State Changes
RUN Initialization of the run XA=5000, XZ=1500, XD=200, FISH=75, GX=.5, XPRBAR=500000, XP=50000, PF=.5, XABAR=XA, XZBAR=XZ, XDBAR=XD, M=20
FISH Change in fish population PF=.5+.4*((2*FISH*10<XD)-(2*FISH*10>XD)), F1=1-2*(RND>PF), F1=F1*(1+9*(2*FISH*10<XD)+10*(2*FISH*20<XD))
EQUIL Compute new equilibrium STEP=CLK-NOW, XP=XP+STEP*XPR-(XA*2*STEP), XPR=XPRNEW, XA=XA*(1+GX*STEP*(1+(XA-0<XABAR)*(M-1))/(1+(XA-0>XABAR)*(M-1))/(1+(STEP==XP/XA/2)*(M-1)))-0, XZ=XZ*(1+GX*STEP*(1+(XZ-(XD*2*STEP)<XZBAR)*(M-1))/(1+(XZ-(XD*2*STEP)>XZBAR)*(M-1))/(1+(STEP==XA/XZ/2)))-(XD*2*STEP), XD=XD*(1+GX*STEP*(1+(XD-(FISH*2*STEP)<XDBAR)*(M-1))/(1+(XD-(FISH*2*STEP)>XDBAR)*(M-1))/(1+(STEP==XZ/XD/2)*(M-1)))-(FISH*2*STEP), FISH=MAX{FISH+F1;1}, F1=0
EUTRO Ecosystem eutrophication None
PO4 Phosphate changes XPRNEW=XPRBAR*0.9+RND*XPRBAR*0.2
END End full step TMIN=0
DONE Done None
BEGIN Begin full step TMIN=MIN{XP/XA;XA/XZ}, TMIN=MIN{TMIN;XZ/XD}, TMIN=MIN{TMIN;XD/FISH}, TMIN=MIN{1;TMIN/2}, NOW=CLK
EXTIN Ecosystem extinctions None

Initialization Conditions

This model has no initialization conditions.

Event Relationship Graph

FISHTANK.MOD
FISHTANK.MOD

English Translation

An English translation is a verbal description of a model, automatically generated by SIGMA.

The SIGMA Model, FISHTANK.MOD, is a discrete event simulation. 
It models FISHTANK WITH FEED RATE OF 2.
I. STATE VARIABLE DEFINITIONS.
For this simulation, the following state variables are defined:
XP: PHOSPHATES  (real valued)
XA: PHYTOPLANKTON  (real valued)
XZ: ZOOPLANKTON  (real valued)
XD: DAPHNIA  (real valued)
NOW: BEGINNING OF STEP  (real valued)
F1: CHANGE IN FISH   (integer valued)
MX: FEEDING RATE  (real valued)
GX: GROWTH RATE  (real valued)
STEP: SIZE OF STEP  (real valued)
TMIN: MAXIMUM ALLOWABLE STEP SIZE  (real valued)
XPRBAR: MEAN PHOSPHATE LEVEL  (real valued)
M: SMOOTHING PARAMETER   (integer valued)
XABAR: TARGET PHYTOPL. LEVEL   (integer valued)
XZBAR: TARGET ZOOPL. LEVEL   (integer valued)
XDBAR: TARGET DAPHNIA LEVEL   (integer valued)
PF: PROBABILITY OF FISH INCREASE  (real valued)
XPRNEW: NEW PHOSPHATE RATE  (real valued)
XPR: PHOSPHATE INPUT RATE  (real valued)
FISH: NUMBER OF FISH   (integer valued)
II. EVENT DEFINITIONS.
Simulation state changes are represented by event vertices (nodes or balls) in a SIGMA graph.  
Event vertex parameters, if any, are given in parentheses. Logical and dynamic relationships 
between pairs of events are represented in a SIGMA graph by edges (arrows) between event vertices.  
Unless otherwise stated, vertex execution priorities, to break time ties, are equal to 5.
1. The RUN() event occurs when INITIALIZE.
   This event causes the following state change(s):
   XA=5000
   XZ=1500
   XD=200
   FISH=75
   GX=.5
   XPRBAR=500000
   XP=50000
   PF=.5
   XABAR=XA
   XZBAR=XZ
   XDBAR=XD
   M=20
   After every occurrence of the RUN event:
   Unconditionally, INITIALIZE FIRST FULL STEP;
   that is, schedule the BEGIN() event to occur without delay.
   (Time ties are broken by an execution priority of 3.)
   Unconditionally, INITIALIZE FISH CHANGES;
   that is, schedule the FISH() event to occur without delay.
   Unconditionally, INITIALIZE PHOSPHATE RATE CHANGES;
   that is, schedule the PO4() event to occur without delay.
2. The FISH() event occurs when CHANGE IN FISH POPULATION.
   This event causes the following state change(s):
   PF=.5+.4*((2*FISH*10<XD)-(2*FISH*10>XD))
   F1=1-2*(RND>PF)
   F1=F1*(1+9*(2*FISH*10<XD)+10*(2*FISH*20<XD))
   After every occurrence of the FISH event:
   Unconditionally, USE NEW FISH POPULATION IN COMPUTE EQUILIBRIUM;
   that is, schedule the EQUIL() event to occur without delay.
   If TMIN>0, then CANCEL ONGOING FULL STEP;
   that is, immediately cancel the next scheduled occurrence of the END event.
   (Time ties are broken by an execution priority of 4.)
   Unconditionally, FISH POPULATION CHANGE DELAY;
   that is, schedule the FISH() event to occur in 0.5*ERL{1} time units.
3. The BEGIN() event occurs when BEGIN FULL STEP.
   This event causes the following state change(s):
   TMIN=MIN{XP/XA;XA/XZ}
   TMIN=MIN{TMIN;XZ/XD}
   TMIN=MIN{TMIN;XD/FISH}
   TMIN=MIN{1;TMIN/2}
   NOW=CLK
   After every occurrence of the BEGIN event:
   If TMIN>0.001, then WAIT FOR TMIN STEP SIZE;
   that is, schedule the END() event to occur in TMIN time units.
   If TMIN<=0.001, then SCHEDULE EXTINCTIONS;
   that is, schedule the EXTIN() event to occur without delay.
4. The PO4() event occurs when PHOSPHATE CHANGES.
   This event causes the following state change(s):
   XPRNEW=XPRBAR*0.9+RND*XPRBAR*0.2
   After every occurrence of the PO4 event:
   If F1==0, then USE NEW PHOSPHATE LEVEL IN COMPUTE EQUILIBRIUM;
   that is, schedule the EQUIL() event to occur without delay.
   (Time ties are broken by an execution priority of 6.)
   If TMIN>0 and F1==0, then CANCEL ONGOING FULL STEP;
   that is, immediately cancel the next scheduled occurrence of the END event.
   (Time ties are broken by an execution priority of 4.)
   Unconditionally, PHOSPHATE CHANGE REPLENISHMENT;
   that is, schedule the PO4() event to occur in 3*ERL{1} time units.
5. The END() event occurs when END FULL STEP.
   This event causes the following state change(s):
   TMIN=0
   After every occurrence of the END event:
   Unconditionally, schedule the EQUIL() event to occur without delay.
6. The EQUIL() event occurs when COMPUTE NEW EQUILIBRIUM.
   This event causes the following state change(s):
   STEP=CLK-NOW
   XP=XP+STEP*XPR-(XA*2*STEP)
   XPR=XPRNEW
   XA=XA*(1+GX*STEP*(1+(XA-0<XABAR)*(M-1))/(1+(XA-0>XABAR)*(M-1))/(1+(STEP==XP/XA/2)*(M-1)))-0
   XZ=XZ*(1+GX*STEP*(1+(XZ-(XD*2*STEP)<XZBAR)*(M-1))
    /(1+(XZ-(XD*2*STEP)>XZBAR)*(M-1))/(1+(STEP==XA/XZ/2)))-(XD*2*STEP)
   XD=XD*(1+GX*STEP*(1+(XD-(FISH*2*STEP)<XDBAR)*(M-1))
    /(1+(XD-(FISH*2*STEP)>XDBAR)*(M-1))/(1+(STEP==XZ/XD/2)*(M-1)))-(FISH*2*STEP)
   FISH=MAX{FISH+F1;1}
   F1=0
   After every occurrence of the EQUIL event:
   If XA<200000 and FISH>0, then SCHEDULE NEW BEGIN FULL STEP;
   that is, schedule the BEGIN() event to occur without delay.
   If XA>=200000, then SCHEDULE EUTROPHICATION;
   that is, schedule the EUTRO() event to occur without delay.
7. The EXTIN() event occurs when ECOSYSTEM EXTINCTIONS.
   After every occurrence of the EXTIN event:
   Unconditionally, schedule the DONE() event to occur without delay.
   (Time ties are broken by an execution priority of 6.)
8. The EUTRO() event occurs when ECOSYSTEM EUTROPHICATION.
   After every occurrence of the EUTRO event:
   Unconditionally, schedule the DONE() event to occur without delay.
   (Time ties are broken by an execution priority of 3.)
9. The DONE() event occurs when DONE.
   No additional events are scheduled here.

Comments

This model is not available using the educational version of SIGMA.




Back to top

Back to Model Library

Personal tools
Navigation