plugin-math245lab08

# plugin-math245lab08 - Math245 Computer Lab set#8 Spring...

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

Math245 Computer Lab set #8, Spring 2009 Beat and resonance We consider the undamped linear, forced 2nd-order ODE in the form: y 00 + ω 2 0 y = F 0 cos ω f t (1) where ω 0 is the natural frequency of the system, ω f is the forcing frequency, and F 0 is the forcing amplitude. Example let ω 0 = 1, F 0 = 1 / 2. y 00 + y = 1 2 cos ω f t. Simulate the system for ω f = 4 / 5 , 7 / 8 , 1 for 0 t 100. Step #1: Let y = y 1 and y 0 = y 2 , and rewriting the equation into a set of ﬁrst order ODEs. y 0 1 = y 2 , (2) y 0 2 = - y 1 + 1 2 cos ω f t. (3) Step #2: Deﬁne RHS of above ODEs in a function ﬁle. function dy=odefun(t,y,omgf) dy=[ y(2) -y(1)+0.5*cos(omgf*t) ]; Step #3: Write the main program, and run it for diﬀerent value of ω f . omgf=4/5; tspan=[0,100]; y0=[0,0]; [t, y]=ode45(@odefun,tspan,y0,[],omgf); figure plot(t,y(:,1)) Solution plot is shown in ﬁgure below. Analytical solution Analytical solution to Eqn(1) is written y ( t ) = F 0 ω 2 0 - ω 2 f (cos ω f t - cos ω 0 t ) .

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 06/01/2009 for the course MATH 245 taught by Professor Alexander during the Spring '07 term at USC.

### Page1 / 2

plugin-math245lab08 - Math245 Computer Lab set#8 Spring...

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

View Full Document
Ask a homework question - tutors are online