2DOF question and other things...help me...
1 view (last 30 days)
Show older comments
2 Comments
Ameer Hamza
on 16 Apr 2020
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
Answers (1)
Ameer Hamza
on 19 Apr 2020
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 Comments
Ameer Hamza
on 19 Apr 2020
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.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!