Hi(adsbygoogle = window.adsbygoogle || []).push({});

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:Code (Text):

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)];

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?Code (Text):

x0 = [0 0 0 0];

tspan = [0, 2];

[t, x] = ode45(@eoms, tspan, x0);

Thanks in advance.

Best,

Niles.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MatLAB: problems with ODE45

**Physics Forums | Science Articles, Homework Help, Discussion**