-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathObject COLLECT_FISH.msl
175 lines (132 loc) · 9.63 KB
/
Object COLLECT_FISH.msl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
// ---------------------------------------------------------------------------
// HEMMIS - Ghent University, BIOMATH - Université Laval, modelEAU
// Implementation: Peter Vanrolleghem, Frederik De Laender, Ludiwine Clouzot.
// Description: MSL-USER/ELAFish
// ---------------------------------------------------------------------------
#ifndef OBJECTCOLLECT_FISH
#define OBJECTCOLLECT_FISH
CLASS COLLECT_FISH (* class = "Collect" *)
SPECIALISES PhysicalDAEModelType :=
{:
interface <-
{
OBJ PD_epi (* terminal = "in_3" *) "": Concentration:= {: causality <- "CIN" :};
OBJ PD_in (* terminal = "in_3" *) "": Concentration:= {: causality <- "CIN" :};
OBJ PD_out (* terminal = "out_2" *) "": Concentration:= {: causality <- "COUT" :};
OBJ MORTALITY_1 (* terminal = "in_1" *) "" : SRateProcess := {: causality <- "CIN" :};
OBJ MORTALITY_2 (* terminal = "in_1" *) "" : SRateProcess := {: causality <- "CIN" :};
OBJ MORTALITY_in (* terminal = "in_3" *) "" : RateProcess := {: causality <- "CIN" :};
OBJ MORTALITY_out (* terminal = "out_2" *) "" : RateProcess := {: causality <- "COUT" :};
OBJ EXCRETION_1 (* terminal = "in_1" *) "" : SRateProcess := {: causality <- "CIN" :};
OBJ EXCRETION_2 (* terminal = "in_1" *) "" : SRateProcess := {: causality <- "CIN" :};
OBJ EXCRETION_in (* terminal = "in_3" *) "" : RateProcess := {: causality <- "CIN" :};
OBJ EXCRETION_out (* terminal = "out_2" *) "" : RateProcess := {: causality <- "COUT" :};
OBJ INGESTION_PD_1 (* terminal = "in_1" *) "" : SRateProcess := {: causality <- "CIN" :};
OBJ INGESTION_PD_2 (* terminal = "in_1" *) "" : SRateProcess := {: causality <- "CIN" :};
OBJ INGESTION_PD_in (* terminal = "in_3" *) "" : RateProcess := {: causality <- "CIN" :};
OBJ INGESTION_PD_out (* terminal = "out_2" *) "" : RateProcess := {: causality <- "COUT" :};
OBJ DEFECATION_1 (* terminal = "in_1" *) "" : SRateProcess := {: causality <- "CIN" :};
OBJ DEFECATION_2 (* terminal = "in_1" *) "" : SRateProcess := {: causality <- "CIN" :};
OBJ DEFECATION_in (* terminal = "in_3" *) "" : RateProcess := {: causality <- "CIN" :};
OBJ DEFECATION_out (* terminal = "out_2" *) "" : RateProcess := {: causality <- "COUT" :};
OBJ RESPIRATION_1 (* terminal = "in_1" *) "" : SRateProcess := {: causality <- "CIN" :};
OBJ RESPIRATION_2 (* terminal = "in_1" *) "" : SRateProcess := {: causality <- "CIN" :};
OBJ RESPIRATION_in (* terminal = "in_3" *) "" : RateProcess := {: causality <- "CIN" :};
OBJ RESPIRATION_out (* terminal = "out_2" *) "" : RateProcess := {: causality <- "COUT" :};
OBJ Bio_1 (* terminal = "in_1" *) "" : SurfaceDensity := {: causality <- "CIN" :};
OBJ Bio_2 (* terminal = "in_1" *) "" : SurfaceDensity := {: causality <- "CIN" :};
OBJ Bio_species_out (* terminal = "out_2" *) "" : SurfaceDensity := {: causality <- "COUT" :};
OBJ Bio_1_in (* terminal = "in_3" *) "" : Concentration [5;]:= {: causality <- "CIN" :};
OBJ Bio_1_out (* terminal = "out_2" *) "" : Concentration [5;]:= {: causality <- "COUT" :};
OBJ Bio_2_in (* terminal = "in_3" *) "" : Concentration [5;]:= {: causality <- "CIN" :};
OBJ Bio_2_out (* terminal = "out_2" *) "" : Concentration [5;]:= {: causality <- "COUT" :};
OBJ INGESTION_prey1_1 (* terminal = "in_1" *) "": SRateProcess[5;]:= {: causality <- "CIN" :};
OBJ INGESTION_prey1_2 (* terminal = "in_1" *) "": SRateProcess[5;]:= {: causality <- "CIN" :};
OBJ INGESTION_prey1_in (* terminal = "in_3" *) "": RateProcess[5;]:= {: causality <- "CIN" :};
OBJ INGESTION_prey1_out (* terminal = "out_2" *) "": RateProcess[5;]:= {: causality <- "COUT" :};
OBJ INGESTION_prey2_1 (* terminal = "in_1" *) "": SRateProcess[5;]:= {: causality <- "CIN" :};
OBJ INGESTION_prey2_2 (* terminal = "in_1" *) "": SRateProcess[5;]:= {: causality <- "CIN" :};
OBJ INGESTION_prey2_in (* terminal = "in_2" *) "": RateProcess[5;]:= {: causality <- "CIN" :};
OBJ INGESTION_prey2_out (* terminal = "out_2" *) "": RateProcess[5;]:= {: causality <- "COUT" :};
OBJ Bio_prey1_epi (* terminal = "in_3" *) "": Concentration[5;]:= {: causality <- "CIN" :};
OBJ Bio_prey1_in (* terminal = "in_3" *) "": Concentration[5;]:= {: causality <- "CIN" :};
OBJ Bio_prey1_out (* terminal = "out_2" *) "": Concentration[5;]:= {: causality <- "COUT" :};
OBJ Bio_prey2_epi (* terminal = "in_3" *) "": Concentration[5;]:= {: causality <- "CIN" :};
OBJ Bio_prey2_in (* terminal = "in_3" *) "": Concentration[5;]:= {: causality <- "CIN" :};
OBJ Bio_prey2_out (* terminal = "out_2" *) "": Concentration[5;]:= {: causality <- "COUT" :};
OBJ Bio_fish1_in (* terminal = "in_3" *) "": Concentration[5;]:= {: causality <- "CIN" :};
OBJ Bio_fish1_out (* terminal = "out_2" *) "": Concentration[5;]:= {: causality <- "COUT" :};
OBJ Bio_fish2_in (* terminal = "in_3" *) "": Concentration[5;]:= {: causality <- "CIN" :};
OBJ Bio_fish2_out (* terminal = "out_2" *) "": Concentration[5;]:= {: causality <- "COUT" :};
OBJ PREDATION_fish1_in (* terminal = "in_3" *) "": SRateProcess[5;]:= {: causality <- "CIN" :};
OBJ PREDATION_fish1_out (* terminal = "out_2" *) "": SRateProcess[5;]:= {: causality <- "COUT" :};
OBJ PREDATION_fish2_in (* terminal = "in_3" *) "": SRateProcess[5;]:= {: causality <- "CIN" :};
OBJ PREDATION_fish2_out (* terminal = "out_2" *) "": SRateProcess[5;]:= {: causality <- "COUT" :};
OBJ GameteLoss_1 (* terminal = "in_1" *) "" : SRateProcess := {: causality <- "CIN" :};
OBJ GameteLoss_in (* terminal = "in_3" *) "" : RateProcess := {: causality <- "CIN" :};
OBJ GameteLoss_out (* terminal = "out_2" *) "" : RateProcess := {: causality <- "COUT" :};
OBJ PROMOTION_in (* terminal = "in_1" *) "" : SRateProcess := {: causality <- "CIN" :};
OBJ PROMOTION_out (* terminal = "out_2" *) "" : SRateProcess := {: causality <- "COUT" :};
OBJ RECRUITMENT_in (* terminal = "in_1" *) "" : SRateProcess := {: causality <- "CIN" :};
OBJ RECRUITMENT_out (* terminal = "out_2" *) "" : SRateProcess := {: causality <- "COUT" :};
};
parameters <-
{
OBJ Nr "fish nr NECESSARY TO FILL IN" : Real:={:value<-0:};
OBJ ZPred "mean depth where fish live" : Length:={:value<-4.5:};
};
independent <- { OBJ t "Time" : Time; };
state <-
{
OBJ PD "" : Concentration;
OBJ MORTALITY "" : RateProcess;
OBJ EXCRETION "" : RateProcess;
OBJ DEFECATION "" : RateProcess;
OBJ RESPIRATION "" : RateProcess;
OBJ Bio_1 "" : Concentration[5;];
OBJ Bio_2 "" : Concentration[5;];
OBJ INGESTION_prey1 "" : RateProcess[5;];
OBJ INGESTION_prey2 "" : RateProcess[5;];
OBJ INGESTION_PD "" : RateProcess;
OBJ Bio_prey1 "" : Concentration[5;];
OBJ Bio_prey2 "" : Concentration[5;];
OBJ GameteLoss "" : RateProcess;
};
equations <-
{
state.PD = interface.PD_epi * parameters.ZPred;
interface.PD_out = interface.PD_in + state.PD;
state.MORTALITY = (interface.MORTALITY_1 + interface.MORTALITY_2) / parameters.ZPred;
interface.MORTALITY_out = interface.MORTALITY_in + state.MORTALITY;
state.EXCRETION = (interface.EXCRETION_1 + interface.EXCRETION_2) / parameters.ZPred;
interface.EXCRETION_out = interface.EXCRETION_in + state.EXCRETION;
state.DEFECATION = (interface.DEFECATION_1 + interface.DEFECATION_2) / parameters.ZPred;
interface.DEFECATION_out = interface.DEFECATION_in + state.DEFECATION;
state.RESPIRATION = (interface.RESPIRATION_1 + interface.RESPIRATION_2) / parameters.ZPred;
interface.RESPIRATION_out = interface.RESPIRATION_in + state.RESPIRATION;
interface.Bio_species_out = interface.Bio_1 + interface.Bio_2;
state.Bio_1[parameters.Nr] = interface.Bio_1;
{FOREACH count IN {1 .. 5}:interface.Bio_1_out[count] = interface.Bio_1_in[count] + state.Bio_1[count];};
state.Bio_2[parameters.Nr] = interface.Bio_2;
{FOREACH count IN {1 .. 5}:interface.Bio_2_out[count] = interface.Bio_2_in[count] + state.Bio_2[count];};
{FOREACH count IN {1 .. 5}:state.INGESTION_prey1[count] = (interface.INGESTION_prey1_1[count] + interface.INGESTION_prey1_2[count]) / parameters.ZPred;};
{FOREACH count IN {1 .. 5}:interface.INGESTION_prey1_out[count] = interface.INGESTION_prey1_in[count] + state.INGESTION_prey1[count];};
{FOREACH count IN {1 .. 5}:state.INGESTION_prey2[count] = (interface.INGESTION_prey2_1[count] + interface.INGESTION_prey2_2[count]) / parameters.ZPred;};
{FOREACH count IN {1 .. 5}:interface.INGESTION_prey2_out[count] = interface.INGESTION_prey2_in[count] + state.INGESTION_prey2[count];};
{FOREACH count IN {1 .. 5}:state.Bio_prey1[count] = interface.Bio_prey1_epi[count] * parameters.ZPred;};
{FOREACH count IN {1 .. 5}: interface.Bio_prey1_out[count] = interface.Bio_prey1_in[count] + state.Bio_prey1[count];};
{FOREACH count IN {1 .. 5}:state.Bio_prey2[count] = interface.Bio_prey2_epi[count] * parameters.ZPred;};
{FOREACH count IN {1 .. 5}: interface.Bio_prey2_out[count] = interface.Bio_prey2_in[count] + state.Bio_prey2[count];};
{FOREACH count IN {1 .. 5}: interface.Bio_fish1_out[count] = interface.Bio_fish1_in[count];};
{FOREACH count IN {1 .. 5}: interface.Bio_fish2_out[count] = interface.Bio_fish2_in[count];};
{FOREACH count IN {1 .. 5}: interface.PREDATION_fish1_out[count] = interface.PREDATION_fish1_in[count];};
{FOREACH count IN {1 .. 5}: interface.PREDATION_fish2_out[count] = interface.PREDATION_fish2_in[count];};
state.INGESTION_PD = (interface.INGESTION_PD_1 + interface.INGESTION_PD_2) / parameters.ZPred;
interface.INGESTION_PD_out = interface.INGESTION_PD_in + state.INGESTION_PD;
state.GameteLoss = interface.GameteLoss_1 / parameters.ZPred;
interface.GameteLoss_out = interface.GameteLoss_in + state.GameteLoss;
interface.PROMOTION_out = interface.PROMOTION_in;
interface.RECRUITMENT_out = interface.RECRUITMENT_in;
};
:};
#endif