How can I implement an impulse function in simulink?

11 visualizaciones (últimos 30 días)
Raulonido
Raulonido el 21 de Mzo. de 2016
I've been trying to make a simulation giving a series of ODE running in simulink, but at certain times I need some variables to change abruptly, something like S(t_i + ) =S(t_i -)(1-x). I've tried to insert a matlab block function, given a series of points in time t_i , such that
for i=length(t_i)
if round(ti100)==round(t100)
dS=aux-x S;
else
dS=aux;
end
end
Such that the aux is the S'(t) without the impulse. However it does not work except for the last value of t_i, and also during the first moments of the simulation. I know there must be some other way, more easy and simple, I just haven't found it (I also tried to stop the simulation, change the initial values and start again, but I don't find this very elegant).
Can anybody illuminate me? Please? This has been quite stressful for long time and I just can't find the right help in any tutorial/previous question

Respuestas (0)

Categorías

Más información sobre Stress and Strain en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by