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

I have made up this code in an attempt to find the response time a 4 dof problem. However, I do not get an oscillatory response as I expect, instead I get a straight line which drops off towards the end. Not sure what is happening..any ideas..?

function f = Simple_Planetary(t,y)

f = zeros(8, 1);

f(1) = y(2);

f(2) = -y(7)+2*y(1);

f(3) = y(4);

f(4) = -y(7)+2*y(3);

f(5) = y(6);

f(6) = -y(7)+2*y(5);

f(7) = y(8);

f(8) = 3*y(7)-y(1)-y(2)-y(3)+10*cos(t);

y0 = [1;1;1;1;1;1;1;1];

[t,y] = ode45('Simple_Planetary', tspan, y0);

subplot (211)

plot (t,y (: , 1));

xlabel ('t');

ylabel ('x1 (t)');

subplot (212)

plot (t,y (: , 3));

xlabel ('t');

ylabel ('x2 (t)');

Regards

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

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

# Ode45 for solution of 4 d.o.f. problem

Tags:

Loading...

Similar Threads - Ode45 solution problem | Date |
---|---|

Matlab Parameter fitting with a numerical solution | Feb 9, 2018 |

Matlab Plotting the tragectory of an asteroid in MATLAB | Mar 2, 2017 |

Matlab Passing variables out of ODE45 | Jan 18, 2017 |

Matlab Finite difference numerical integration or ode45? | May 17, 2016 |

Projectile motion with friction in MATLAB (ODE45) | Apr 26, 2014 |

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