Professional Documents
Culture Documents
clc
clear all
m=input('Enter the value of mass m= ');
k=input('Enter the value of stiffness k= ');
wn=sqrt(k/m);
z=input('Enter the value of zeta = ');
wd=wn*sqrt(1-(z*z));
if z<1
fprintf('\nThe case is of under damped system');
a=input('\nEnter the value of A = ');
o=input('\nEnter the value of angle O (inrad) =');
t=0:0.01:4;
y=a.*(exp(-z*wn*t)).*sin(wd*t+o);
plot (t,y)
else if (z==1)
fprintf('\nThe case is of critically damped system');
a=input('\nEnter the value of A = ');
b=input('\nEnter the value of B = ');
t=0:0.01:4;
x=(a+(b*t)).*exp(-wn*t);
plot (t,x)
else (z>1)
fprintf('\nThe case is of over damped system');
a=input('\nEnter the value of A = ');
b=input('\nEnter the value of B = ');
s1=-z+sqrt(z*z-1);
s2=-z-sqrt(z*z-1);
t=0:0.01:4;
x=a.*exp(s1*t)+b.*exp(s2*t);
plot (t,x)
end
end
Overdamped Problem
Ex.1 An overdamped system, with mass 10kgs, stiffness 20kN/m and zeta = 2.5.
Plot the graph for the following conditions.