First I did my m.file
% creating the m file to solve the EDO
function wdot= EOM(t,o)
%%%%%o= omega
j1=6000; j2=3000; j3=3000;
y=40; z=40; alfa=0
area=40*40;
f=1.8*(100)*((cos(2*alfa)+1)/2)*area;
f1=1.8*(100)*((cos(2*alfa)+1)/2)*(area/2);
ycp=-f1*z/f; zcp=-f1*y/f;
t1=0 t2=f*ycp; t3=f*zcp;_
o=[w1;w2;w3]; MY VECTOR OMEGA
wdot=[((t1+(j2-j3)*w2*w3)/j1);((t2+(j3-j1)*w3*w1)/j2);((t3+(j1-j2)*w1*w2)/j3)]; end
WHEN I CALL MY ODE45, it keeps asking for w1 w2 w3, AND i wanted that the ODE45 solve this for me
[t,o]=ode45(@EOM,[0 100],[0,0,0]);

 채택된 답변

Star Strider
Star Strider 2017년 4월 19일

1 개 추천

Try this instead of your ‘o’ assignment:
w1 = o(1);
w2 = o(2);
w3 = o(3);
I would caution you about the variable names. The letter ‘o’ can be confused with the number 0 (and similarly the lower-case ‘l’ can be confused with ‘1’, especially if you are tired). (Personal experience.)

댓글 수: 2

adriele rocha
adriele rocha 2017년 4월 19일
Thank you so much!!!!
Star Strider
Star Strider 2017년 4월 19일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

질문:

2017년 4월 19일

댓글:

2017년 4월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by