using ODE to solve coupled equations
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Josh
el 1 de Jul. de 2016
Comentada: Star Strider
el 1 de Jul. de 2016
Hi,
I am trying to solve a set of coupled equations but keep getting the error, "Attempted to access x(5); index out of bounds because numel(x)=1."
0 comentarios
Respuesta aceptada
Star Strider
el 1 de Jul. de 2016
You need to define ‘x’ as a (7x1) vector of initial conditions in your call to your ODE solver.
Also, you’re going to encounter problems with ‘x’ in these lines, because you have defined it as a vector:
dxdt(1,:) = x*(Vs - vC)/L + y*(vj1 - vC)/L; % diL/dt
dxdt(2,:) = x*(-Vs - vj1)/Lp1 + y*(-vj1 - L*(vj1 - vC) - vC)/(L*Lp1); % diLp1/dt
dxdt(3,:) = x*(-Vs - vj2)/Lp2 + y*(-vj2 - L*(vj1 - vC) - vC)/(L*Lp2); % diLp2/dt
I suspect that will throw one of may possible errors about dimensions not agreeing. I have no idea what you’re doing, so I can’t offer a solution.
4 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!