How can I implement an impulse function in simulink?
11 views (last 30 days)
Show older comments
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
0 Comments
Answers (0)
See Also
Categories
Find more on Stress and Strain in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!