Forced vibration response Ode45

6 ビュー (過去 30 日間)
Ryan
Ryan 2014 年 4 月 24 日
回答済み: Mohammed Siraj 2021 年 9 月 23 日
I am suck on a question for an assignment. I can not get matlab to work the following function I keep getting error messages.
function f=t
F=940*sin(10*pi*t);
k=50000;
damping=0.05;
r=3.224;
x(1+t)=(F/k)/sqrt((1-R^2)^2+4*(damping^2)*r^2);
t=1/(10*pi);
[x,t]=ode45('f',[T,T*50],0);
plot(x)
  4 件のコメント
A Jenkins
A Jenkins 2014 年 4 月 25 日
編集済み: A Jenkins 2014 年 4 月 25 日
Perhaps you should start with an example that works and slowly make modifications to it until you get to your final result?
Then you will know exactly what change you made and therefore only one line will be incorrect at a time.
(We try not to do people's homework for them, so we only answer specific questions here.)
Ryan
Ryan 2014 年 4 月 26 日
I didn't ask for you to do it for me as you don't have the assignment question. I asked for help with the code I wrote. I have figured out how to do the problem any way.
function [du]=QuestionE(t,u);
du=zeros(2,1);
Damping=0.05;
wn=9.74;
du(1)=-2*Damping*wn*u(1)-u(2)*(wn^2)+(940/530)*sin(10*pi*t);
du(2)=u(1);
end
Damping=0.05;
wn=9.75;
omega=10*pi;
k=50000
m=527.1;
g=9.81;
r=omega/wn;
F=940
wd=wn.*sqrt(1-Damping.^2);
timespan=(50*2*pi)/omega
xst=-(m*g)/k;
v0=0;
A=xst;
B=(v0+Damping*wn*xst)/wd;
[t,u]=ode45(@QuestionE1,[0 timespan],[v0,xst]);
u=exp(-Damping.*wn.*t).*(A.*cos(wd.*t)+B.*sin(wd.*t));
y=(2*Damping*r)/(1-r^2);
fi=atan(y);
X=((F/k)/(sqrt((1-(r^2))^2+4*(Damping^2)*(r^2))))
u1=X.*cos(omega.*t-fi)+u;
plot(t,u,'k')
hold on
plot(t,u1,'b')
title('Forced Vibration Responce')
xlabel('Time')
ylabel('x(t)')

サインインしてコメントする。

回答 (1 件)

Mohammed Siraj
Mohammed Siraj 2021 年 9 月 23 日
Write the program for the task given: The motion of the forced vibratory system with spring-
mass system is modeled by the following equation, solve the differential equation and find the
displacement, velocity with respect to time (from 0 to 120 seconds).Analyze the system by
MATLAB Programming and validate the solution by using SIMULINK. Assume m=1 kg, k=2
N/m, F=120N and ω=1 rad/sec.

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by