Azzera filtri
Azzera filtri

How to change values during the solving ode

2 visualizzazioni (ultimi 30 giorni)
Cécile Moulin
Cécile Moulin il 19 Ott 2016
Hi,
I want to know how I can change the value of a vector during the integration. For instance, every 5 minutes, add 3 to y(2)...
I found a solution for t==t1 : use events in the ode options (see the file test_ball.m the name comes from ballode.m) but if I want to do the same for 5, 10, 15 etc it doesn't work... I changed value = t -5 in mod(t,5) and in (t>0 && mod(t,5)==0)-1 without success.
Thanks and sorry for the mistakes.
Ccile

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by