Solution-MATLAB m file

Solution-MATLAB m file - % Struct Mech 3 - Assignment 3 -...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
% Struct Mech 3 - Assignment 3 - MDOF dynamics disp('---------------------------------------------------------------'); disp('PRELIMINARY FREE VIBRATION ANALYSIS FOR PERIODS, MODES, ETC'); disp('---------------------------------------------------------------'); format short g % set numerical format for convenience clear all k1=205000; k2=205000; k3=205000; k4=155000; K=[k1+k2 -k2 0 0;-k2 k2+k3 -k3 0;0 -k3 k3+k4 -k4;0 0 -k4 k4]; M=diag([158.532 158.532 158.532 117.431]); [mode wsq]=eig(K,M); % Sort frequencies and modes into ascending order and normalise modes [w index]=sort(sqrt(diag(wsq))); T=2*pi./w; for i=1:4; PHI(:,i)=mode(:,index(i))/mode(4,index(i));end; % Modal participation factors i=ones(4,1); P=PHI\i; % Modal mass participation factors, followed by cumulative values Mp=(PHI'*M*PHI)*(P.^2)./trace(M); tri=triu(ones(4)); %(upper triangular matrix of all 1's) Mpcumu=tri'*Mp.*100; disp('Natural Periods (s)'); disp(T); disp('Modes'); disp(PHI); disp('Modal Participation Factors'); disp(P); disp('Mass Participation Factors'); disp(Mp); disp('Cumulative Mass Participation Factors, %');disp(Mpcumu); disp('---------------------------------------------------------------'); disp('STEP-BY-STEP RESPONSE TO EL-CENTRO GROUND MOTION'); disp('---------------------------------------------------------------'); % Get ground acceleration record, turn it into a row vector and scale units to m/s/s % Solve time-history for modal amplitudes (Y) using step-by-step integration load elcen1940ns.txt; elcen=0.01*elcen1940ns'; dt=0.02; %(Set damping ratio to 0.05 for all modes) xi=0.05*i; nout=1; [Y,Ymax,Vmax,Amax]=th(w,xi,elcen,dt,P,nout); % Convert Y's back to natural coords (u's) u=PHI*Y; % Plot roof displacement figure(1); timebase=[0:nout*dt:size(elcen,2)*dt-dt]; plot(timebase,u(4,:)'); xlabel('Time (s)'); ylabel('Roof Displacement (m)'); % Compute maximum displacements, shears and drifts umax(2:5)=max(u'); umax(1)=0; % (Add a zero at ground level for plotting)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/09/2008 for the course CIVIL ENGI Civil 416 taught by Professor Butterworth during the Fall '05 term at Auckland.

Page1 / 4

Solution-MATLAB m file - % Struct Mech 3 - Assignment 3 -...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online