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 - The Fusion of Science and Community**

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

Loading...

Similar Threads - MatLAB problems ODE45 | Date |
---|---|

Does anyone had this plotting problem with MATLAB? | Dec 23, 2017 |

Matlab map representation problems | Feb 11, 2017 |

Matlab Problem with Generating Barnsley Fern Fractal in MATLAB | Sep 21, 2016 |

Problem of plotting picture and video in Linux HPC | Dec 3, 2015 |

Problem with Matlab | Sep 4, 2015 |

**Physics Forums - The Fusion of Science and Community**