ODE for the driven oscillator with damping

Size: px
Start display at page:

Download "ODE for the driven oscillator with damping"

Transcription

1 ODE for he driven oscillaor wih damping K m g R Simple oscillaor composed of a mass m, a spring wih spring consan K. The exernal force g drives he sysem, where is he ime, while R is he inernal damping coefficien (fricion). x c Paola Gervasio - Numerical Mehods - 1 1

2 The displacemen x of he mass m a ime is he soluion of he ode mx + Rx + K(x L) = g where L is he res lengh of he spring. I is a nd-order ode. Two iniial condiions are needed: x( ) = x iniial posiion x ( ) = iniial velociy Case 1. Se g (no driven force), R = (no fricion), K = 1, m = 1, L = 1 x =, T = 1. Compue he numerical soluion wih he explici Runge-Kua scheme of order 4 and wih h =.1, h = 1, h =, h = 4. In a second ime, solve he problem by FE wih h =.1, h =.1 and h =.1. Commen on he resuls. c Paola Gervasio - Numerical Mehods - 1

3 Soluion. The explici Runge-Kua scheme of order 4 is: - explici, - one-sep, - fourh-order accurae, - absoluely sable under condiions on h. Is sabiliy region is: 3 RK4 1 Im(h λ) Re(h λ) Download: hp://dm.ing.unibs.i/gervasio/nummeh/malab/rk4.m c Paola Gervasio - Numerical Mehods - 1 3

4 Inpu and oupu are as in he previous funcions: [n,un]=rk4(odefun,span,y,nh) Le us reduce he nd-order ode mx + Rx + K(x L) = g in a sysem of 1s-order equaions: y 1 = x, y = x = y 1 hen explici x, so ha x = (R/m)x (K/m)(x L) + g/m: y 1 = y y = (R/m)y (K/m)(y 1 L) + g/m y 1 ( ) = x y ( ) = v c Paola Gervasio - Numerical Mehods - 1 4

5 By seing: y = [y 1,y ], y = [y 1,y ], y( ) = [y 1 ( ),y ( )], F(,y) = [ y (R/m)y (K/m)(y 1 L) + g/m, he vecor form of he ode reads: { y = F(,y) y( ) = y ] c Paola Gervasio - Numerical Mehods - 1 5

6 Numerical resuls for RK4 1.5 h=.1 y 1 y 1.5 h=1 y 1 y h= y 1 y 1 x h=4 y 1 y c Paola Gervasio - Numerical Mehods - 1 6

7 Commens on he numerical resuls The soluion is good only when h =.1, i is periodic wihou damping. When h = 1, h = he soluions vanishes when grows, bu i is no a physical soluion, we have no damping in our sysem. The soluion dies since here is a numerical damping ha acs as he fricion does. The unphysical behavior is due o large h (no accurae resuls). When h = 4 he numerical soluion blows up, in his case he absolue sabiliy is missed ou. c Paola Gervasio - Numerical Mehods - 1 7

8 Absolue sabiliy for periodic soluions The absolue sabiliy concep can be exended o periodic soluions. We say ha he scheme is absoluely sable if he numerical soluion reflecs he behavior of he exac soluion when. When h =.1,1, he absolue sabiliy is saisfied and he soluion remains bounded. When h = 4 he absolue sabiliy is missed ou: he soluion shows oscillaions wih increasing ampliude. c Paola Gervasio - Numerical Mehods - 1 8

9 Validaion of he resuls The given problem is linear, since F(,y) = Ay + g where A = [ 1 K/m R/m ] The eigenvalues of A are λ 1 = i, λ = i. In using RK4, we have no a formula ha gives explici bounds on h as for FE, bu we have o compare he posiion of λ i wih he absolue sabiliy region. c Paola Gervasio - Numerical Mehods - 1 9

10 Absolue sabiliy region of RK4 and FE 3 RK4 3 Im(h λ) 1 1 FE Im(h λ) Re(h λ) 3 Re(h λ) The eigenvalues λ 1 = ±i A RK4 and hλ i A RK4 for any < h.8, coherenly wih our numerical resuls: oscillaions arised only when h = 4. c Paola Gervasio - Numerical Mehods - 1 1

11 Numerical resuls for FE h=.1 1 y 1 y h=.1 4 y 1 y h=.1 4 y 1 y Even if we use a very small h, he numerical soluion shows oscillaions wih increasing ampliude. This is explained by he fac ha A FE does no inersec he imaginary axis and here is no h ha leads λ i inside A FE. Recall ha A FE is open. When he ode sysem has pure imaginary eigenvalues, FE is no a candidae o solve such a sysem. c Paola Gervasio - Numerical Mehods

12 Case. Se R and/or g and ry o solve he same problem as before, analyzing all properies. c Paola Gervasio - Numerical Mehods - 1 1