Recursive modeling in Simulink

조회 수: 11 (최근 30일)
Yannick Ongena
Yannick Ongena 2024년 3월 18일
댓글: Yannick Ongena 2024년 3월 24일
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
Yannick Ongena
Yannick Ongena 2024년 3월 18일
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 2024년 3월 24일
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

댓글을 달려면 로그인하십시오.

채택된 답변

Sam Chak
Sam Chak 2024년 3월 18일
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
Sam Chak
Sam Chak 2024년 3월 18일
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 2024년 3월 19일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Yannick Ongena
Yannick Ongena 2024년 3월 18일
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
Sam Chak
Sam Chak 2024년 3월 18일
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 2024년 3월 18일
편집: Yannick Ongena 2024년 3월 18일
Good point. I would need to do some rounding to make it more accurate.
The model is discrete. The time steps represent a year.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by