User Tools

Site Tools


tutorial_15-implementing_using_one_compartment

This is an old revision of the document!


Tutorial 15 - Implementing using one compartment

3/3

When implementing the Lotka-Volterra model using one 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.

Option 1

Equations for Transfers:

  • AnimalBirth[Rabbits]=Animals·a
  • AnimalBirth[Foxes]=Animals[Rabbits]·Animals[Foxes]·e·b
  • AnimalDeath[Rabbits]=b·Animals[Rabbits]·Animals[Foxes]
  • AnimalDeath[Foxes]=c·Animals

Initial Conditions for compartment:

  • For Animals[Rabbits] = Init_population
  • For Animals[Foxes] = Init_population

Values for parameter Initial population:

  • Init_population[Rabbits]= 1000
  • Init_population[Foxes]= 4
Ecosystem

Figure 1 Ecolego matrix of one Compartment approach


Solution to the excersise

Previous

References

tutorial_15-implementing_using_one_compartment.1680531221.txt.gz · Last modified: 2023/04/03 16:13 by dmytroh