User Tools

Site Tools


tutorial_15-implementing_using_one_compartment

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
tutorial_15-implementing_using_one_compartment [2020/02/19 18:10]
ecoloco
tutorial_15-implementing_using_one_compartment [2023/04/03 17:34]
dmytroh
Line 3: Line 3:
 ===== 3/3 ===== ===== 3/3 =====
  
-When implementing the Lotka-Volterra model using one [[Compartment|Compartment]] block (one for both the predator and prey), the compartment needs to be vectorized. I.e. the rabbit and fox species needs to be added as modelled materials. Then either one can use the same approach as in the two Compartment solution, using Source/Sink and Transfer blocks as means to model the dynamic behaviour or just explicitly define the differential equation inside the Compartment. +When implementing the Lotka-Volterra model using one [[Compartment|Compartment]] block (one for both the predator and prey), the compartment needs to be vectorized. I.e. the rabbit and fox species needs to be added as modelled materials or created as indexes from Index-list. Then either one can use the same approach as in the two Compartment solution, using Source/Sink and Transfer blocks as means to model the dynamic behaviour or just explicitly define the differential equation inside the Compartment. 
-<HTML> + 
-<table xmlns="http://www.w3.org/1999/xhtml" style="height: 240px; width: 240px; text-align: center; font-weight: bold;"> +====Option 1==== 
- <tr> +{{rabbitfoxmodel3.png?600}} 
-  <td style="width: 68px; height: 68px; background-color: #CAEACA;">Ecosystem</td> + 
-  <td style="width: 68px; height: 68px;"> </td> +Equations for Transfers: 
-  <td style="width: 68px; height: 68px;"> </td> +  * //AnimalBirth[Rabbits]=Animals·a// 
- </tr> +  * //AnimalBirth[Foxes]=Animals[Rabbits]·Animals[Foxes]·e·b/
- <tr> +  * //AnimalDeath[Rabbits]=b·Animals[Rabbits]·Animals[Foxes]/
-  <td style="width: 68px; height: 68px;"> </td> +  * //AnimalDeath[Foxes]=c·Animals// 
-  <td style="width: 68px; height: 68px; background-color: #C0C0C0;"> </td> + 
-  <td style="width: 60px; height: 60px;"> </td> +**Initial Conditions** for compartment: 
- </tr> +  * For //Animals[Rabbits] Init_population/
- <tr> +  * For //Animals[Foxes] Init_population/
-  <td style="width: 68px; height68px;"> </td> + 
-  <td style="width: 68px; height: 68px;"> </td> +Values for parameter Initial population: 
-  <td style="width68px; height68px; background-color: #C0C0C0;"> </td> +  * //Init_population[Rabbits]1000/
- </tr> +  * //Init_population[Foxes]= 4/
-</table> + 
-</HTML>+ 
 +====Option 2==== 
 +Create only one compartment with name Animals. Create parameters 
 + 
 +{{rabbitfoxmodel4.png}} 
 + 
 +**Initial Conditions** for compartment
 +  * For //Animals[Rabbits] 1000/
 +  * For //Animals[Foxes] 4// 
 + 
 + 
 +**dy/dt** for compartment: 
 +  * Rabbits//dAnimals/dt=Animals[Rabbits]·a-b·Animals[Rabbits]·Animals[Foxes]// 
 +  * Foxes: //dAnimals/dt=Animals[Rabbits]·Animals[Foxes]·e·b-c·Animals[Foxes]//
  
-//''%%Figure 1 Ecolego matrix of one Compartment approach%%''//\\ 
  
  
Line 30: Line 42:
  
 **Solution to the excersise** **Solution to the excersise**
- +  * {{lotka-volterra.eco}} 
-  * {{tutorial:Lotka-Volterra.eco?linkonly}}+  * old one {{tutorial:Lotka-Volterra.eco?linkonly}}
  
  
tutorial_15-implementing_using_one_compartment.txt · Last modified: 2023/04/03 17:38 by dmytroh