ode45 for solution of 4 dof problem

조회 수: 1 (최근 30일)
deltanabla
deltanabla 2015년 1월 29일
댓글: Torsten 2015년 1월 30일
Hi Folks,
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
  댓글 수: 2
deltanabla
deltanabla 2015년 1월 30일
can ode45 be used for n degree of freedoms?
Torsten
Torsten 2015년 1월 30일
Sure. Where do you define tspan ?
Best wishes
Torsten.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by