Recursive modeling in Simulink

12 views (last 30 days)
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
Yannick Ongena
Yannick Ongena on 18 Mar 2024
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.
Yannick Ongena
Yannick Ongena on 24 Mar 2024
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
Sam Chak
Sam Chak on 18 Mar 2024
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?
Yannick Ongena
Yannick Ongena on 19 Mar 2024
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
Sam Chak
Sam Chak on 18 Mar 2024
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.

Tags

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!