Simulink model parameter update and observations at discrete times

조회 수: 1 (최근 30일)
EA
EA 2024년 9월 11일
댓글: Paul 2024년 9월 13일
I have a Simulink model M which includes a parameter p. Assume that I want to simulate M over the the time period [0, T]. Also assume that I get an output y from the model M.
Now consider discrete time points [0 t_1, t_2, ..., t_n] in the time interval [0, T]. At each t_i I want to change p in the model and want to get the value of y.
How can I do this?

답변 (1개)

Paul
Paul 2024년 9월 11일
I think you can do exactly what you want using the new (since 2024a) simulation object.
  댓글 수: 4
EA
EA 2024년 9월 13일
Simulation uses a variable step solver. t_i's sare time steps determined by the user in the interval [0, T]. t_i's can be assumed to be larger than the the minimum time step required for numerical simulation.
Paul
Paul 2024년 9월 13일
If the t_i values are not currently forced to be at major time steps, the you can change add logic to the model to force that to be the case and adjust p at those times. What happens after that depends on what p actually is and how it's used in the model. Or, if you force t_i to occur at major time steps then you can use the simulation object.
Or, you can use the workflow desribed at Use Model Operating Point for Faster Simulation Workflow to simulate up t_1, adjust p programatically, simulate to t_2, etc.

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

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by