Final Assignment Solutions - Time Dependent Probabilities | AMATH 586, Assignments of Mathematics

Material Type: Assignment; Class: TIME DEPNDT PROBS; Subject: Applied Mathematics; University: University of Washington - Seattle; Term: Spring 2005;

Typology: Assignments

Pre 2010

Uploaded on 03/19/2009

koofers-user-8nm
koofers-user-8nm 🇺🇸

5

(1)

8 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Amath-Math 586/Atm S 581 Spring 2005
Final Assignment Solution
1) Consider a FEM using an arbitrary monotone increasing set of nodes xj, j = 0,…, N, based on
piecewise linear chapeau functions ()
j
x
ϕ
, each of which is 1 at xj and 0 at all other nodes:
.
0
(,) () ()
N
jj
j
qxt q t x
ϕ
=
=
The node x0 = 0 is chosen to be the left boundary, so its expansion coefficient is
determined by the left BC to be = sin(50t). The node x
0()qt
0()qt N is chosen to be the right
boundary; its expansion coefficient is unknown. Let xj+1/2 = xj+1 - xj. As in class, the FEM
equations are found by zeroing the projection of the residual onto each basis function that has
an unknown expansion coefficient:
00
0(),(,) ,1,,
NN
n
jjnjnn
nn
da
x
Rxt I J a j N
dt
ϕ
==
==+=
∑∑ .
The required inner products are easily computed for the interior nodes:
1/2
1/2 1/ 2
1/2
1
1
(), () 2( ) , 1, , 1
61
j
jn j n j j
j
xnj
Ixx xxnjjN
xnj
ϕϕ
−+
+
∆=
==+==
∆=+
,
1/ 2 1
(), 0 , 1, , 1
1/2 1
n
jn j
nj
d
Jx njjN
dx nj
ϕ
ϕ
−=
====
=+
N
.
For the right boundary node, only the projections with the node to its left and the self-
projection between 1N
x
xx
<< contribute, altering the inner products to:
1/2
1/2
,1
1
(), () 2,
6
N
Nn N n
N
xnN
Ixx
x
nN
ϕϕ
∆=
==
∆=
,
1/2, 1
(), 1/ 2,
n
Nn N
nN
d
Jx nN
dx
ϕ
ϕ
−=
==
=
.
Defining the solution vector q(t) = {qj(t), j = 1,…,N}, the tridiagonal inner product matrices
I, J = {Ijn, Jjn, j, n = 1,…, N), and the vectors i0, j0 = {I0n, J0n, j, n = 1,…, N), we can write the
FEM in matrix form as
10 0 10 0
/1
01
I
dq dt J q j
d+= j
dt
−−
>
q
IJq =
.
Using trapezoidal time differencing, we obtain the desired time-discretized FEM:
pf2

Partial preview of the text

Download Final Assignment Solutions - Time Dependent Probabilities | AMATH 586 and more Assignments Mathematics in PDF only on Docsity!

Amath-Math 586/Atm S 581 Spring 2005

Final Assignment Solution

  1. Consider a FEM using an arbitrary monotone increasing set of nodes x j

, j = 0,…, N , based on

piecewise linear chapeau functions ( )

j

ϕ x , each of which is 1 at x

j

and 0 at all other nodes:

0

N

j j

j

q x t q t ϕ x

=

The node x

0

= 0 is chosen to be the left boundary, so its expansion coefficient is

determined by the left BC to be = sin(50 t ). The node x

0

q ( ) t

0

q ( ) t

N

is chosen to be the right

boundary; its expansion coefficient is unknown. Let ∆ x

j +1/

= x

j +

  • x

j

. As in class, the FEM

equations are found by zeroing the projection of the residual onto each basis function that has

an unknown expansion coefficient:

0 0

N N

n

j jn jn n

n n

da

x R x t I J a j N

dt

= =

∑ ∑

The required inner products are easily computed for the interior nodes:

1/ 2

1/ 2 1/ 2

1/ 2

j

jn j n j j

j

x n j

I x x x x n j j N

x n j

− +

n

jn j

n j

d

J x n j j N

dx

n j

N

For the right boundary node, only the projections with the node to its left and the self-

projection between

N 1

x x x

< < contribute, altering the inner products to:

1/ 2

1/ 2

N

Nn N n

N

x n N

I x x

x n N

n

Nn N

n N d

J x

dx n N

Defining the solution vector q ( t ) = { q

j

( t ), j = 1,…, N }, the tridiagonal inner product matrices

I , J = { I

jn

, J

jn

, j , n = 1,…, N ), and the vectors i 0

, j 0

= { I

0 n

, J

0 n

, j , n = 1,…, N ), we can write the

FEM in matrix form as

10 0 10 0

I dq dt J q j

d

j dt

q

I Jq

Using trapezoidal time differencing, we obtain the desired time-discretized FEM:

1 1 1 1

01 10 0 0 10 0 0

n n n n n n n n

r I q q t J q q j

t

j

= − − ∆ − + 2 1 − + 

q q q q

I J

01 1

n n

r j

t t j

I J I J

q q.

The Matlab script finalp1.m on the class web page implements this tridiagonal system for

time-marching the advection equation with the specified IC and BC. The first part uses the

matrices I and J computed for constant grid spacing ∆ x = 0.01 (problem 1); the second part

recalculates these matrices for the stretched grid x j

j

1/

j

= 0.02 j , j = 1,…,50.

Fig. 1 compares these two solutions at t = 0.9 with the exact solution

[ ]

q x t ( , ) = sin 50 max( tx , 0). Both do a decent job near the left boundary, where the wave

is being forced and where even the stretched grid has a resolution sufficient to resolve the

wave well. The uniform-grid solution is quite respectable throughout the domain, but the

stretched-grid solution starts to degrade near the right boundary where it no longer has

sufficient resolution to adequately resolve a wave of wavelength 2π/50.

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

−1.

−0.

0

1

2

x

u(x,t=0.75)

Exact

FEM(unif dx)

FEM(var dx)

Fig. 1. FEM solutions to advection equation with uniform and stretched grids.

  1. Fig. 2, generated following the instructions in the class handout, shows the t = 2 FEM

solution to the wave equation IBVP generated by the Matlab PDE toolbox:

−0.

0

1

−0.

0

1

−0.

−0.

−0.

−0.

−0.

0

Time=2 Color: u Height: u

−0.

−0.1 5

−0.

−0.0 5

0

Fig. 2