Question

In: Computer Science

matlab code of Free Vibration Response of the System as a Continuous/ Distributed/Infinite DOF System

matlab code of Free Vibration Response of the System as a Continuous/ Distributed/Infinite DOF System

Solutions

Expert Solution

Following is the code, sample input and sample out for the MATLAB code for Free Vibration Response of a System as a Continuous/ Distributed/ Infinite Degree of Freedom System:

Code:

function Result=MDOF_simulation(M,C,K,f,fs)

if size(f,1)>size(f,2)

f=f';

end

n=size(f,1);

dt=1/fs; %sampling rate

[Vectors Values]=eig(K,M);

Freq=sqrt(diag(Values))/(2*pi); % undamped natural frequency

steps=size(f,2);

Mn=diag(Vectors'*M*Vectors); % uncoupled mass

Cn=diag(Vectors'*C*Vectors); % uncoupled damping

Kn=diag(Vectors'*K*Vectors); % uncoupled stifness

wn=sqrt(diag(Values));

zeta=Cn./(sqrt(2.*Mn.*Kn)); % damping ratio

wd=wn.*sqrt(1-zeta.^2);

fn=Vectors'*f; % generalized input force matrix

t=[0:dt:dt*steps-dt];

%forced vibration

for i=1:1:n

h(i,:)=(1/(Mn(i)*wd(i))).*exp(-zeta(i)*wn(i)*t).*sin(wd(i)*t); %transfer function of displacement

hd(i,:)=(1/(Mn(i)*wd(i))).*(-zeta(i).*wn(i).*exp(-zeta(i)*wn(i)*t).*sin(wd(i)*t)+wd(i).*exp(-zeta(i)*wn(i)*t).*cos(wd(i)*t)); %transfer function of velocity

hdd(i,:)=(1/(Mn(i)*wd(i))).*((zeta(i).*wn(i))^2.*exp(-zeta(i)*wn(i)*t).*sin(wd(i)*t)-zeta(i).*wn(i).*wd(i).*exp(-zeta(i)*wn(i)*t).*cos(wd(i)*t)-wd(i).*((zeta(i).*wn(i)).*exp(-zeta(i)*wn(i)*t).*cos(wd(i)*t))-wd(i)^2.*exp(-zeta(i)*wn(i)*t).*sin(wd(i)*t)); %transfer function of acceleration

qq=conv(fn(i,:),h(i,:))*dt;

qqd=conv(fn(i,:),hd(i,:))*dt;

qqdd=conv(fn(i,:),hdd(i,:))*dt;

q(i,:)=qq(1:steps); % modal displacement

qd(i,:)=qqd(1:steps); % modal velocity

qdd(i,:)=qqdd(1:steps); % modal acceleration

end

x=Vectors*q; %displacement

v=Vectors*qd; %vecloity

a=Vectors*qdd; %vecloity

% Free vibration

xi=zeros(n,1); % displacement initial condition

vi=zeros(n,1); % velocity initial condition

xno=Vectors'*M*xi./Mn;

vno=Vectors'*M*vi./Mn;

for i=1:1:n

AA=(vno(i)+xno(i).*zeta(i).*wn(i))./wd(i);

BB=xno(i);

qf(i,:)=exp(-zeta(i)*wn(i)*t).*(AA.*sin(wd(i)*t)+BB.*cos(wd(i)*t));

qdf(i,:)=wd(i)*exp(-zeta(i)*wn(i)*t).*(AA.*cos(wd(i)*t)-BB.*sin(wd(i)*t))-zeta(i).*wn(i).*exp(-zeta(i)*wn(i)*t).*(AA.*sin(wd(i)*t)+BB.*cos(wd(i)*t));

qddf(i,:)=wd(i)^2*exp(-zeta(i)*wn(i)*t).*(-AA.*sin(wd(i)*t)-BB.*cos(wd(i)*t))-2*zeta(i).*wn(i).*wd(i).*exp(-zeta(i)*wn(i)*t).*(AA.*cos(wd(i)*t)-BB.*sin(wd(i)*t))+zeta(i)^2.*wn(i)^2*exp(-zeta(i)*wn(i)*t).*(-AA.*sin(wd(i)*t)-BB.*cos(wd(i)*t));

end

x=x+Vectors*qf;

v=v+Vectors*qdf;

a=a+Vectors*qddf;

Result.Displacement=x;

Result.Velocity=v;

Result.Acceleration=a;

Result.Parameters.Freq=Freq;

Result.Parameters.DampRatio=zeta*100;

Result.Parameters.ModeShape=Vectors;

end

Input:

M:mass matrix (n*n)
C:damping matrix (n*n)
K:stiffness matrix (n*n)
f:external force matrix(n,N)
fs: sampling frequency
where n is the number of degrees of freedom, N is the length of data points of dynamic force

Output:
Result: is a structure consist of
Result.Displacement: Displacement (n*N)
Result.Velocity: Velocity (n*N)
Result.Acceleration: Acceleration (n*N)
Result.Parameters.Freq=Natural Frequency (n*1)
Result.Parameters.DampRatio=Damping Ratio (n*1)
Result.Parameters.ModeShape=Mode Shapes Matrix (n*n)


Related Solutions

Matlab code fr natural frequency of lateral vibration of beams...using PDE solver method
Matlab code fr natural frequency of lateral vibration of beams...using PDE solver method
Free Response: An electron is fired at a negatively charged infinite plane with an initial speed...
Free Response: An electron is fired at a negatively charged infinite plane with an initial speed of 6.5 × 107 m/s. The plane has a surface charge density of σ = −2.0 µC/m2 . a) How far does the electron travel before it stops? b) Which point is at a higher potential, the starting point or the ending point? c) Do a) and b) for a proton with the same initial speed fired at a positively charged plane with a...
write a matlab code to simulate fiber optics communication system on matlab simulink
write a matlab code to simulate fiber optics communication system on matlab simulink
matlab code to calculate cost of generator in power system
matlab code to calculate cost of generator in power system
in viscous damping free vibration response what has the most powerful effect among m, c, k...
in viscous damping free vibration response what has the most powerful effect among m, c, k and initial condition? please write the reason.
What is the difference between free vibration and forced vibration? Derive the necessary equations and draw...
What is the difference between free vibration and forced vibration? Derive the necessary equations and draw necessary pictures.
Write a MATLAB code for the conjugate gradient method and apply it to solve the system...
Write a MATLAB code for the conjugate gradient method and apply it to solve the system Hx = b, where H is the n×n Hilbert matrix, and b is A times the vector of all ones, for (a) n = 4; (b) n = 8. Compare your numerical solutions with the exact solution (which is the vector of all ones), and report your numerical errors.
The response time of a distributed computer system is an important quality characteristic. The system manager...
The response time of a distributed computer system is an important quality characteristic. The system manager wants to know whether the mean response time to a specific type of command exceeds 82 millisec. The computer systems are known to have a mean response time of 84.25 millisec and standard deviation of 10 millisec. The command is executed 25 times. Test the hypothesis that the mean response time is 82 millisec versus the alternative that the mean exceeds 82 millisec. Use...
1. a) Compute the impulse response of the following filters. If the impulse response is infinite,...
1. a) Compute the impulse response of the following filters. If the impulse response is infinite, feel free to stop once a pattern becomes apparent. i. y[n] = 2/3 · x[n − 1] − 1/3 x[n − 2] ii. y[n] = x[n − 1] − x[n − 2] − 1/3 y[n − 2] b) What are the feed-back (b[k]) and feed-forward (a[k]) coefficients of the following filters? You may assume that a starts at delay of k = 1 (i.e.,...
Matlab code for Gauss Siedel with solved example in Matlab
Matlab code for Gauss Siedel with solved example in Matlab
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT