Recursive modeling in Simulink

I am learning Simulink. I've done around 50% of the onramp course so I tried modeling something on my own.
One of the reasons I wanted to learn simulink is to model population models so that's what I started with. The problem is, however that it's a recursive model and I don't know how to make this work in simulink...
The below is what I tried:

5 Comments

The model appears to resemble an algebraic loop since I cannot identify any dynamic time-components. Isn't it typical for a population model to exhibit growth or decline over time until it reaches an equilibrium, where the number of births equals the number of deaths?
Yes that's correct.
In this simplified model, the births and deaths are constants. A fixed percentage of the population will die, and another fixed percentage will reproduce. So it should result in a fixed exponential growth.
This is only the first step, to familiarize myself with modeling in simulink but the idea is to make birth and death much more dynamic.
What components do I need to look for in the library to introduce these time components so I can model this?
I'm not certain if the remaining 50% of the Simulink Onramp course will cover it, but I believe that modeling differential equations using the recursive formula in Simulink might be a bit too advanced. To my knowledge, there isn't a specific Simulink block available for performing the user-defined recursive formula.
I just figured it out. I looked at the different blocks in the library under the discrete section and the memory block was exactly what I needed. As shown in my answer below, little changes are required to my currrent model to make it work as expected.
just a follow-up... The onramp actually covers this technique using the unit step block. It was exactly what I needed to model this approach.
So for anybody in the future, just follow the onramp and you will understand

Sign in to comment.

 Accepted Answer

Sam Chak
Sam Chak on 18 Mar 2024
If the population model can be represented as a discrete state-space system, then the appropriate approach would be to utilize the Discrete State-Space block.

3 Comments

Ah yes that also seems to be a viable block.
On my notes, that's actually how I wrote down the formulas to implement so it makes a lot of sense to use them.
where λ is
So the state space block more accuratly models that approach as well.
If you found the suggestion regarding the Discrete State-Space block and the rounding issue helpful, please consider clicking 'Accept' ✔️ on the answer. Do you primarily deal with discrete systems?
I'm not really primarily dealing with discrete systems... A few months ago I started with a pre-master environmental science and topics like this raised my interest so I bought a few books and wanted to play with these concepts. Next year, I will have a class focussed on simulating population and the effect of humans on population. Meanwhile I still have to brush up on a lot of the math concepts. But things like mathematical modeling and simulation is definitly something that raised my interest a lot.

Sign in to comment.

More Answers (1)

Yannick Ongena
Yannick Ongena on 18 Mar 2024
I browsed through the discrete section in the library and played a bit with the memory component. This seemed to do the trick.
The starting population is now the initial condition of the memory block. The rest is somewhat identical except the order in which they are in the model.

2 Comments

By the way, is your population model continuous or discrete? For instance, if the current population count is 34, it wouldn't make sense to have 3.4 births (where 0.4 represents half-alive individuals) or 6.8 deaths (where 0.8 indicates individuals on the brink of death), correct?
Yannick Ongena
Yannick Ongena on 18 Mar 2024
Edited: Yannick Ongena on 18 Mar 2024
Good point. I would need to do some rounding to make it more accurate.
The model is discrete. The time steps represent a year.

Sign in to comment.

Products

Release

R2023b

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!