Index exceeds matrix dimensions when solving for ODE system.
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
nanana sehaa
el 27 de Sept. de 2017
Comentada: nanana sehaa
el 27 de Sept. de 2017
Hi. Im trying to solve this system of equation. But it gives me this error. What does it mean and how to solve this? Thank you.
function dphidz = Pphiode(z,phi,Ro,Eta,Lambda)
Co=2.0-Ro-Ro^2; % Coriolis number
dphidz = [phi(2)
Ro.*(phi(1)^2+phi(2).*phi(5)-phi(3)^2+1)-Co*(phi(3)-1.0)
phi(4)
Ro*(2.0*phi(1)*phi(3) + phi(4)*phi(5))+Co*phi(1)
-2.0*phi(1)];
end
Error:
Trial>> Pphiode(20,2,-1,1,1)
Index exceeds matrix dimensions.
Error in Pphiode (line 3)
dphidz = [phi(2)
Let say
z=12, phi=1, R0=-1, Eta=0, Lambda=1
0 comentarios
Respuesta aceptada
KSSV
el 27 de Sept. de 2017
The input
phi = 1 ;
should be a vector with elements 5. Try with:
phi = rand(5,1) ;
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Ordinary Differential Equations 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!