- #1
Niles
- 1,866
- 0
Hi
I am trying to solve a simple set of coupled ODE's by ODE45. The coupled system is given by:
I solve it using the following command:
However when I compile MatLAB just keeps calculating, it doesn't give me a result. Maybe it is due to the very rapid rates in the equations. Do I have any options here, or am I not able to solve for the transient behavior?
Thanks in advance.
Niles.
I am trying to solve a simple set of coupled ODE's by ODE45. The coupled system is given by:
Code:
function xprime = eoms(t, x)
xprime = [
1e9 + 5.0e4*x(3) - 50*x(1);
4.0e1*x(1) - 3.3e3*x(2);
2.0e3*x(2) - 5e4*x(3) + 3.5e7*heaviside(t-1)*x(4);
1.0e3*x(2) - heaviside(t-1)*5.0e7*x(4)];
I solve it using the following command:
Code:
x0 = [0 0 0 0];
tspan = [0, 2];
[t, x] = ode45(@eoms, tspan, x0);
Thanks in advance.
Niles.