• No se han encontrado resultados

wave

N/A
N/A
Protected

Academic year: 2020

Share "wave"

Copied!
20
0
0

Texto completo

(1)

Numerical approximation of the wave equation

Grado en Ing. Civil y Territorial

(Univ. Polit´ecnica de Madrid)

(2)

The wave equation

Consider a string of lengthL.

Letu(x,t) be the displacement at the pointx∈ string, and time

t>0.

(3)

The following equation describes the small displacements of the string

∂2u

∂t2(x,t)− ∂2u

∂x2(x,t) = 0, x∈(0,L), t>0,

or, abreviated

(4)

To obtain a unique solution, we have to include:

1 Boundary conditions at the extremes (ex. fixed)

u(0,t) = 0, t>0, u(L,t) = 0, t >0,

2 Initial conditions

u(x,0) =u0(x), x∈(0,L)

ut(x,0) =v0(x), x ∈(0,L),

(5)

The complete system of equations is given by

    

    

utt −uxx = 0, x ∈(0,L), t >0,

u(0,t) = 0, t >0, u(L,t) = 0, t >0,

u(x,0) =u0(x), x ∈(0,L), ut(x,0) =v0(x), x∈(0,L).

(6)

The Fourier method to obtain solutions

We search for solutions of the form,

u(x,t) =ϕ(x)T(t)

RemarkIfϕ(x) is solution of the eigenvalue problem

ϕ00(x) +λϕ(x) = 0, ϕ(0) = 0, ϕ(L) = 0,

for someλ, then

u(x,t) =ϕ(x) cos(

λt) and u(x,t) =ϕ(x) sin(

λt)

are solutions of the wave equationutt −uxx = 0 and the boundary

(7)

The eigenvalues of this problem areλk = k

2π2

L2 with k = 1,2,3, ...

and the associated eigenfunctions are

ϕk = sin(

kπx L ).

Therefore, all these functions are solutions of the heat equation and boundary conditions

uk(1)(x,t) = cos(kπ

L t) sin( kπx

L )

u(2)k (x,t) = sin(kπ

L t) sin( kπx

(8)

first eigenfunction second eigenfunction third eigenfunction

(9)

first eigenfunction second eigenfunction third eigenfunction

(10)

Matlab code

dx=1/100; % space mesh step

x=0:dx:1; % space mesh

dt=1/100;% time mesh step

t=0:dt:2; % time mesh

k=3; % number of eigenvalue

[xx,tt]=meshgrid(x,t); % (x,t) coordinates of the mesh

(11)

Initial conditions

Assume that we can write the initial conditionsu0(x) andv0(x) as

u0(x) =

N X

k=1 cksin(

kπx L ), v

0(x) =

N X

k=1 dksin(

kπx L ),

for some coefficientsck,dk ∈R. Then

u(x,t) =

N X

k=1

ckcos(

kπ L t) sin(

kπx L ) +

Ldk

kπ sin( kπ

L t) sin( kπx

L )

,

(12)

As we know, anyL2(0,1)-function can be approximated with a

finite number of terms of the Fourier series and this allows to find approximations of wave solutions.

initial displacement solution of wave equation

Main drawback: Eigenfunctions are only easily computed in few

(13)

initial displacement solution of wave equation

(14)

Finite differences approximation

     

    

utt −uxx = 0, x ∈(0,L), t >0,

u(0,t) = 0, t >0, u(L,t) = 0, t >0,

u(x,0) =u0(x), x (0,L). ut(x,0) =v0(x), x∈(0,L).

Two steps:

1 Space discretization.

(15)

Space discretization

Take a partition of [0,L]

with steph. Defineun(t)∼u(xn,t),and replace

−uxx(x,t) by

−un−1(t) + 2un(t)−un+1(t) h2

Then, we have the system

          

un00(t) +−un−1(t)+2un(t)−un+1(t)

h2 = 0, n= 1,2, ...,N t >0, u0(t) = 0, t >0,

uN+1(t) = 0, t>0,

un(0) =u0(xn), n = 1,2, ...,N−1,

(16)

Matrix formulation

U00(t) +KU(t) = 0, U(0) =U0

where

K = 1

h2

  

2 −1 0 0 ... 0 0

−1 2 −1 0 ... 0 0

... ... ... ... ... ... ...

0 0 0 0 ... −1 2

  

, U =

    u1 u2 ... uN−1

  

U0 =

  

u0(x1) u0(x2) ... u0(xN−1)

  

, V0 =

  

v0(x1) v0(x2) ... v0(xN−1)

(17)

Time discretization

U00(t) +KU(t) = 0, U(0) =U0, U0(0) =V0

Chose a time mesh{tj}J

j=0 with time step ∆t and any method for

initial value systems:

1 Euler (∆t/h≤1 for stability!),

U0 =V

V0 =−KU U(0) =U

0, V(0) =V0

Uj+1 =Uj + ∆tVj,

Vj+1 =Vj−∆t KUj+1, j = 0,1, ...,J−1

(18)

Newmark method

 

U0, V0

Uj+1 =Uj+ ∆tVj −h2 βKUj+1+ (12 −β)KUj,

Vj+1 =Vj−∆t(γKUj+1+ (1−γ)KUj), j = 0, ...,J−1,

In matrix form,

I+ ∆t2βK 0

∆tγK I

Uj+1 Vj+1

=

Uj + ∆tVj j2(1/2β)KUj

Vj −∆t(1−γ)KUj

(19)

Solution with Euler method

(20)

Matlab code for Euler explicit

L = 1; dx=1/40; N=L/dx; % space mesh

K = 2*diag(ones(1,N-1))-diag(ones(1,N-2),1)-diag(ones(1,N-2),-1); K = (1/dx2)∗K; % matrix formulation−uxx

x=dx:dx:L-dx; U=max(0,(1-8*abs(x-1/2)))’; V=0*x’;% initial datum

mu=1; T=2;dt =mu∗dx; t=0:dt:T; % time mesh

sol(1,:)=[0 U’ 0]; % solution at time t=0

for j=1:length(t)-1 % time loop

U =U+dt∗V;

V =V −dt∗K ∗U;

sol(j+1,:)=[0 U’ 0]; % save solution in ’sol’ variable

end % time loop

x1=0:dx:L;

[xx,tt]=meshgrid(x1,t); % (x,t) coordinates of the mesh

Referencias

Documento similar

The broad “WHO-ICF” perspective on HrWB provided at Figure 1 has a significant implication also for HRQoL. The develop- ment of ICF and its conceptual approach has challenged to

Following this technique, the leaky wave complex solutions are found to match only the dominant modal function and, most importantly, are taken as the initial point of the real

Some of them include the importance of heritage and cultural tourism for sustainability of destinations, the raising wave of religious travels in Arab countries recently opening

For each wave period of the above mentioned range, there will be a maximum wave height expected according to the linear water waves theory.. To find this information, the

No obstante, como esta enfermedad afecta a cada persona de manera diferente, no todas las opciones de cuidado y tratamiento pueden ser apropiadas para cada individuo.. La forma

We show that the electric field promotes sustained Bloch oscillations of an initial Gaussian wave packet whose amplitude reflects the band- width of extended states.. The frequency

The main finding reported is the existence of a particular travelling wave speed a = 1.212 for which the analytical solution is close to the actual numerical solution with

Developing the weakly nonlinear resonant triad amplitude equations, and numerically integrating this system, we find some " explosive" triads and some