How to code a toggling behavior in ODEs
Mostrar comentarios más antiguos
Hi,
What I am trying to do is that, suppose I have 3 ODEs, i.e:
dy1/dt = (c1*y1*y2) + (c2*y2) - (c3*y3);
dy2/dt = (c3*y3) + (c4*y1);
dy3/dt = (c1*y1) - (c5*y2) + (c3*y3);
I have y4 as well. But this y4 is not interfering till 9th mint of simulation.
dy1/dt = (c1*y1*y2) + (c2*y2) - (c3*y3) + (c2*y4);
dy2/dt = (c3*y3) + (c4*y1);
dy3/dt = (c1*y1) - (c5*y2) + (c3*y3) + (c8*y2*y3*y4);
dy4/dt = -(c6*y3) -(c7*y1*y2*y3)
Suppose it (i.e. simulation of y1, y2 & y3) is giving some finite value at 9th mint. Now at 10th mints, I want my system to toggle the value of y1 from original finite value to some another finite value, and include y4 (like disturbance) automatically to simulation.
Note: As you can see now dy1 and dy3 has one new component with old ones.
The data value are as follows for 1st system (i.e. when y1, y2 & y3 are running)
xdata = [0 1 2 3 4 5 6 7 8 9];
ydata (for y1) = [3 17 9 4 8 2 4 4 4 4].
Now xdata continues (after inclusion of y4):
xdata = [10 11 12 13 14 15 16 17 18 19];
ydata (for y1) = [0.01 0.03 0.05 0.07 0.1 0.08 0.06 0.06 0.06 0.06]
I don't know how can I do that, please help me out.
Thanks in advance.
1 comentario
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Ordinary Differential Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!