Finite Difference Methods to Solve the Wave Equation u ma AE

advertisement
Finite Difference Methods to Solve the Wave Equation
To develop the governing equation, Sum the Forces
 u  2u 
u
 2u
AE
 AE   2   AE 2  ma
x
x
 x x 
u
u
AE 2  A 2
x
t
E
c2 
2
2

u
2  u

c
t 2
x 2
2
2
Equations of
Motion
The Wave
Equation
Explicit Method Formulation
Must first start with Initial Conditions
u(0, t )  u( , t )  0
Fixed Ends
u( x,0)  f ( x )
Initial Displacement
u
( x,0)  g ( x )
Initial Velocity
t
Finite Difference Equation to Predict U(x,t1)
u( xi , t1 )  (1   ) f ( xi ) 
2
2
2
( f ( xi 1 )  f ( xi 1 ))  kg( xi )
Finite Difference Equation to Predict U(x,t2), etc.
ck
h
u( xi , t j 1 )  2(1  2 )u( xi , t j )  2 (u( xi 1 , t j )  u( xi 1 , t j ))  u ( xi , t j 1 )

Explicit Method Results
Pick f(x) and g(x) such that exact solution can be found.
f ( x )  sin
x

 g ( x )  0  u( x, t )  sin
Summary of Results
x

cos
ct

Relative Error vs. 
N=16,E=1e11,=1000
1) Error related to number Time Steps
2) Error decreases with Length Steps
3) Error decreases to zero as  approaches 1
4) Explicit Method is unstable for  > 1
Relative Error
a) Individual step error decreases
b) Total error increases
0
0.2
0.4
0.6
0%
-4%
-8%
-12%
-16%

0.8
1
1.2
Implicit Method Results
The following implicit equation is used to find values of U(x,t2), etc
u( xi 1 , t j 1 )  u( xi 1 , t j 1 ) 
1  12 2
1
4

2
u( xi , t j 1 )  2u( xi 1 , t j ) 
 u( xi 1 , t j 1 ) 
1  12 2
1
4

2
2  2
1
4

2
u( xi , t j )  2u( xi 1 , t j )
u( xi , t j 1 )  u( xi 1 , t j 1 )
Equation provides M-2 equations with M Unknowns.
System of linear equations easily solved.
Provides stability for values of  higher than 1.
Explicit m=36,n=15,=3
Implicit m=36,n=15,=3
u(x,t)
Actual
Prediction
Rel. Error
Abs. Error
Prediction
Rel. Error
Abs. Error
u(40,.03)
-0.35355339
2.68E+05
-
-
-0.36103448
-2.12% -0.00748108
u(80,.03)
-0.61237244
8.73E+05
-
-
-0.62461579
-2.00% -0.01224336
u(120,.03)
-0.70710678
8.00E+05
-
-
-0.72224551
-2.14% -0.01513873
u(160,.03)
-0.61237244
-1.49E+06
-
-
-0.62497079
-2.05% -0.01255464
u(200,.03)
-0.35355339
-2.73E+06
-
-
-0.36086871
-2.07% -0.00731532
Conclusions
• Explicit method is stable for   1
• Error will decrease to zero as  approaches 1
• Total error increases with number of time steps, N
• Total error decreases with number of length steps, M
• The implicit method will converge for  > 1
Download