Borrar filtros
Borrar filtros

Cell input to ode45 function

3 visualizaciones (últimos 30 días)
R SIVAKUMAR
R SIVAKUMAR el 27 de Ag. de 2022
Editada: R SIVAKUMAR el 27 de Ag. de 2022
Hey Folks!
Please help me out with the problem below.
I've been trying to run a ode45 function that simulates 4 variables simulataneously. one among the 4, by itself has 7 variables inside it.
Like supposed say, I need to simulate this cell, y = {X(t),S(t),P(t),V(t)} where X,P & V are doubles. And S is a vector with values for 7 variables.
i.e. S(t) = [s1(t),s2(t),..,s7(t)].
So, is it by any means possible for me to simulate as below?
y0 = {X(t),S(t),P(t),V(t)} % Initial conditions
[t,y] = ode45(dydt, tspan, y0}
where the resulting "y" is cell output.

Respuesta aceptada

Chunru
Chunru el 27 de Ag. de 2022
You can take all variables as an vector instead of cell array. For example,
y = [X(t), S_1(t), ... S_7(t), P(t), V(t)]'.
Then you need to define dydt accordingly.
ode45 does not support cell input.

Más respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by