Ex5_3 - omega2 = sqrt-b sqrt(b^2-4*a*c(2*a r1 =-m1*omega1^2 k1 k2/k2 r2 =-m1*omega2^2 k1 k2/k2 disp'Natural frequency Mode shape disp[omega1[1 r1

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% This program calculate forced response of an underdamped system % under harmonic base excitation. % global m1 m2 k1 k2 k3; g m1 = 10; m2 = 1; k1 = 30; k2 = 5; k3 = 0; k t0 = 0; tf = 200; dt = 0.1; tspan = [t0:dt:tf]; x0 = [1.0; 0; 0; 0]; [t, x] = ode23('dfunc5_3',tspan, x0); [ a = m1*m2; b = -(m1*(k2+k3)+m2*(k1+k2)); c = (k1+k2)*(k2+k3)-k2^2; omega1 = sqrt((-b-sqrt(b^2-4*a*c))/(2*a));
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: omega2 = sqrt((-b+sqrt(b^2-4*a*c))/(2*a)); r1 = (-m1*omega1^2+k1+k2)/k2; r2 = (-m1*omega2^2+k1+k2)/k2; disp('Natural frequency Mode shape') disp([omega1,[1 r1]]); disp([omega2,[1 r2]]); d subplot(211) plot(t, x(:, 1)); xlabel('t'); ylabel('x(1)'); subplot(212) plot(t, x(:,2)); xlabel('t'); ylabel('x(2)'); title('Rao Example 5.3');...
View Full Document

This note was uploaded on 06/29/2011 for the course MAE 315 taught by Professor Wu during the Spring '08 term at N.C. State.

Ask a homework question - tutors are online