I have 15 equations with 15 unknowns describing a dynamic process. I would like to know how I can conbine solving non-linear equations together with ordinary differential equations (1st and 2nd order) simultaneously, without using ode45, but Euler's method.

I have 15 equations with 15 unknowns describing a dynamic process. I would like to know how I can conbine solving non-linear equations together with ordinary differential equations (1st and 2nd order) simultaneously, without using ode45, but Euler's method.

Why would you want to do that? Are you doing a real time application or something or a homework question. Do you require very fast integration? Anyway, you can always write your own function. Euler's method is pretty basic.

Thanks John, I will try that!
My program is based the dynamic response of a system in the time domain. It was for an assignment last year, but I never quite got it to work so I thought I would try again. My prof told us ODE 45 would not work, he didn't say why though.

Thanks John, I will try that!
My program is based the dynamic response of a system in the time domain. It was for an assignment last year, but I never quite got it to work so I thought I would try again. My prof told us ODE 45 would not work, he didn't say why though.

Did he say the Eular's method would work? If so I'm surprised. You know that you can give ODE45 a set of points to calculate the state values at.

Yeah, MATLAB has some stiff solvers as well. One thing that could happen with ODE45 is it could take too long to integrate if it ends up needing to take too small a step size to get the required error tolerance. One way to get around this is to decrease the error tolerances in ODE45. Eular's method may get you a solution but I don't know how you can be sure it is sufficiently accurate.