2DOF question and other things...help me...
1 回表示 (過去 30 日間)
古いコメントを表示
2 件のコメント
Ameer Hamza
2020 年 4 月 16 日
This is a homework question. Show us what you have already tried. Also read this: https://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer
回答 (1 件)
Ameer Hamza
2020 年 4 月 19 日
Since you haven't posted the equation in mathematical form, so I can only guess. The following code will not give any error, but I am not sure if it is what you want?
t=0:0.1:20;
X0=[0,0];
[t,X]=ode45(@HW5,t,X0);
function Homework5 =HW5(t, X)
m=10;
c=1000;
k=100000;
e=0.001;
w=100;
R=0.5;
F1=m*e*w^2*cos(w*t);
Homework5=[X(2); -c/m*X(2)-k/m*X(1)+F1/m];
end
4 件のコメント
Ameer Hamza
2020 年 4 月 19 日
Considering the ODEs you wrote, the function appears to be correct. However, the ODEs seems to be independent of each other? One would expect that for such a system, the system of ODEs should be coupled.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!