How to change initial value of Simulink Integrator at each time step?

10 Ansichten (letzte 30 Tage)
Anup
Anup am 20 Dez. 2022
Beantwortet: Fangjun Jiang am 22 Dez. 2022
I have differential equation like this,
with initial value of 298, the T value starts increasing with time.
After T > 350, some cooling mechanism comes into act decreases the value of T to 350. So, every time T goes beyond the 350 value, T is pulled back down to T=350.
So, the problem is if I just set the value of 298, the value of T goes on increasing. I want additional change in T to be added on new initial condition of 350, not to the previous output.
for eg,
model is started with 298 initial condition
at t= 1, T =305,
at t=2, T=315,
.
.
.
at t=6, T = 355
Now here, a cooling mechanism will change the temperature to T= 350
so at t=7, T should be T= 350+ delT
but with default setting I am getting at t=7, T= T(at t=6) + delT;

Antworten (1)

Fangjun Jiang
Fangjun Jiang am 22 Dez. 2022
double click the Integrator block to open the dialog, turn on "reset" and "initial condition" input port and work it out.

Kategorien

Mehr zu Schedule Model Components finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by