HWSol9_2 - for n=1:20

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

View Full Document Right Arrow Icon
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 time, t u 2 (L/2,t) One Dimensional Wave Motion, t = L/2c , L=1, c=10 Newmark Exact Solution Extended Solution to Homework Problem 9-2 ρ = = / , 1 2 2 2 2 2 E c t u c x u 0 ) 0 , ( , sin ) 0 , ( , 0 ) , ( ) , 0 ( =  π = = = x u l x x u t L u t u  π  π = L ct L x t x u cos sin ) , ( : Solution Exact n n n n n u c L u c L u t L u u ) ( 18 ) ( 3 ) ( 3 2 ) , 2 / ( ) ( : Solution FEA Newmark 2 2 2 2 2 1 1 2 + + = = + + % MCE 561 Spring 2011 Prof. Sadd % Extended Solution to Problem 9-2 clc;clear all;clf u=[];ut=[];utt=[]; c=10;L=1;dt=L/(2*c); u(1)=1;ut(1)=0;utt(1)=-12*(c^2)/(L^2);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for n=1:20 u(n+1)=(2/3)*u(n)+(L/(3*c))*ut(n)+((L^2)/(18*c^2))*utt(n); utt(n+1)=-(12*(c^2)/(L^2))*u(n+1); ut(n+1)=ut(n)+(0.5*utt(n)+0.5*utt(n+1))*dt; end n=[1:21];t=dt*(n-1); plot(t,u,'ko-','linewidth',2) xlabel('time, t');ylabel('u_2(L/2,t)') title('One Dimensional Wave Motion, \Deltat = L/2c') hold on; grid on; te=0:0.01:1; ue=cos(pi*c*te/L); plot(te,ue,'k--','linewidth',2) legend('Newmark','Exact Solution')...
View Full Document

This note was uploaded on 10/03/2011 for the course MCE 561 taught by Professor Sadd during the Spring '11 term at Rhode Island.

Ask a homework question - tutors are online