Docsity

5 Problems Sample Final Exam - Computational Methods | CE 30125, Exams of Civil Engineering

Toggle sidebar
bg1
UNIVERSITY OF NOTRE DAME
Department of Civil Engineering
and Geological Sciences
CE 30125 Computational Methods Fall 2008
J.J. Westerink
Sample Final Exams 2008 and 2007
NAME ___________________________________________________________
This exam is being conducted under the HONOR CODE. Please sign your exam to indicate that you agree and
have adhered to all the stipulations of the honor code.
Signed ____________________________________________________________
Notes:
1.) Please highlight your answers with a box.
2.) Clearly show your steps!
3.) Taylor series:
4.) The last two sheets of the exam contain differentiation formulas that may help you to solve certain
problems.
5.) It may be necessary to solve systems of simultaneous equations for this test. If the system is 4x4 or smaller,
please solve the equations by hand using any appropriate algorithm. If the system is larger than 4x4, please
use your calculator and its simultaneous equations solver to find the solution to the system.
fx() fa() xa–()
df
dx
------
xa=
xa–()
2
2!
------------------ d2f
dx2
--------
xa=
++=
xa–()
3
3!
------------------ d3f
dx3
--------
xa=
1
4!
-----xa–()
4d4f
dx
-------
xξ=
++
aξx≤≤
pf3
pf4
pf5
pf8

Partial preview of the text

Download 5 Problems Sample Final Exam - Computational Methods | CE 30125 and more Exams Civil Engineering in PDF only on Docsity!

UNIVERSITY OF NOTRE DAME

Department of Civil Engineering

and Geological Sciences

CE 30125 Computational Methods Fall 2008

J.J. Westerink

Sample Final Exams 2008 and 2007

NAME ___________________________________________________________

This exam is being conducted under the HONOR CODE. Please sign your exam to indicate that you agree and

have adhered to all the stipulations of the honor code.

Signed ____________________________________________________________

Notes:

1.) Please highlight your answers with a box.

2.) Clearly show your steps!

3.) Taylor series:

4.) The last two sheets of the exam contain differentiation formulas that may help you to solve certain

problems.

5.) It may be necessary to solve systems of simultaneous equations for this test. If the system is 4x4 or smaller,

please solve the equations by hand using any appropriate algorithm. If the system is larger than 4x4, please

use your calculator and its simultaneous equations solver to find the solution to the system.

f x ( ) f a ( ) ( x – a ) df dx

x = a

( x – a ) 2 2!

------------------ d

2 f dx^2

x = a

( x – a ) 3 3!

------------------ d

3 f dx^3

x = a

----- ( x – a )^4 d

4 f dx

x =ξ

a ≤ ξ ≤ x

Fall 2008 Problems

Problem 1 (20pts)

Solve the system of equations;

Use LU decomposition. Make sure that you solve these equations such that accuracy is ensured.

Problem 2 (20pts)

Given the transient diffusion equation

with intial conditions

and boundary conditions

Assume spacing and time step. Use a Crank-Nicolson time discretization and a second

order accurate spatial discretization to set up ( but not solve ) the system of simultaneous equations which

time steps from to.

x 1 – x 2 + 3 x 3 = 6

2 x 1 – x 2 + x 3 = 4

  • 3 x 1 + 4 x 2 – x 3 = 5

∂ t

∂ C

D

x 2

2

∂

∂ C

= 0 ≤ x ≤ 10

C x ( , 0 ) = 5 x

C ( 0 , t ) = 0

C ( 10 , t ) = 0

Δ x = 2 Δ t = 1

t = 0 t = 1

Fall 2007 Problems

Problem 1 (20pts)

Solve the system of equations;

Use LU decomposition. Make sure that you solve these equations such that accuracy is ensured.

Problem 2 (10 pts)

Consider the general form of the truncation error series associated with finite difference approximations to

derivatives:

+ higher order terms

(a) What is the order of the above approximation?

(b) What is the slope of the convergence curve on a log(E) versus log(h) plot?

(c) How does error relate to grid spacing and the rate of change of the function? (Discuss what happens to

the error when grid size increases and when the gradients of the function increase).

(d) In a variably spaced grid, where should you increase grid resolution?

(e) If you consider the higher order terms in the error series,

demonstrate that the error series convereges if and only if the grid resolution is much less than the spatial

scale of the process being modeled.

x 1 – x 2 + 3 x 3 = 6

2 x 1 – x 2 + x 3 = 4

  • 3 x 1 + 4 x 2 – x 3 = 5

E α h β f (^) i ( ) γ ≅

E α h β f (^) i ( ) γ ≅ δ h β + 1 f (^) i ( γ + 1 ) δ h β + 2 f (^) i ( γ + 2 ) δ h β + 3 f (^) i ( γ + 3 )

Problem 3 (30 pts)

Consider the equation:

with boundary conditions

along and

along and

along and

along and

Assume that and , develop and write the system of simulataneous equations that you need

to solve this problem. Show all steps along the way including the computational mesh, defining the

unknowns, and developing the necesary algebraic equations to solve for the unknowns.

Problem 4 (20 pts)

Given that the first derivative is approximated using a fourth order accurate central derivative formula as

follows:

+ Error using

+ Error using

Estimate the error for both derivative approximations. Also estimate an improved solution to.

5 xy ∂

2 u ∂ x^2

2 u ∂ y^2

  • -------- = 0 0 ≤ x ≤ 6 0 ≤ y ≤ 6

u = 12 x = 0 0 ≤ y ≤ 6

u = 4 x = 6 0 ≤ y ≤ 6

∂ u ∂ y

------ = 5 y = 0 0 ≤ x ≤ 6

∂ u ∂ y

------ = 2 y = 6 0 ≤ x ≤ 6

Δ x = 2 Δ y = 2

f (^) x (^1 =)^ 2.0 = 279.301 Δ x =0.

f (^) x (^1 =)^ 2.0= 277.874 Δ x =0.

f (^) x (^1 =)2.

TABLE OF DIFFERENCE APPROXIMATIONS

• First Derivative Approximations

• Forward difference approximations:

• Backward difference approximations:

• Central difference approximations:

f (^) i ( 1 ) f^ i + 1 – f^ i h

= ------------------ + E E

--- hf (^) i ( 2 ) ≅ –

f (^) i (^1 )^

  • f (^) i + 2 + 4 f (^) i + 1 – 3 f (^) i 2 h

= --------------------------------------------- + E E

≅--- h^2 f (^) i (^3 )

f (^) i (^1 )^

2 f (^) i + 3 – 9 f (^) i + 2 + 18 f (^) i + 1 – 11 f (^) i 6 h

= ------------------------------------------------------------------- + E E

≅–-- - h^3 f (^) i (^4 )

f (^) i (^1 )^

f (^) i – f (^) i – 1 h

= ------------------ + E E^1

≅--- hf (^) i (^2 )

f (^) i (^1 )^

3 f (^) i – 4 f (^) i – 1 + f (^) i – 2 2 h

= ---------------------------------------- + E E^1

≅--- h^2 f (^) i (^3 )

f (^) i (^1 )^

11 f (^) i – 18 f (^) i – 1 + 9 f (^) i – 2 – 2 f (^) i – 3 6 h

= -------------------------------------------------------------------- + E E^1

≅--- h^3 f (^) i (^4 )

f (^) i (^1 )^

f (^) i + 1 – f (^) i – 1 2 h

= ------------------------- + E E^

≅ – --- h^2 f (^) i (^3 )

f (^) i ( 1 ) –^ f^ i + 2 +^8 f^ i + 1 –^8 f^ i – 1 + f^ i – 2 12 h

= -------------------------------------------------------------------- + E E

------ h 4 f (^) i ( 5 ) ≅

• Second Derivative Approximations

• Forward difference approximations

• Backward difference approximations:

• Central difference approximations:

f (^) i (^2 )^

f (^) i + 2 – 2 f (^) i + 1 + f (^) i h

= ------------------------------------- 2 - + E E hf (^) i ≅ – (^3 )

f (^) i (^2 )^

  • f (^) i + 3 + 4 f (^) i + 2 – 5 f (^) i + 1 + 2 f (^) i h^2

= ----------------------------------------------------------------- + E E^11

≅------ h^2 f (^) i (^4 )

f (^) i ( 2 ) f^ i –^2 f^ i – 1 + f^ i – 2 h^2

= ------------------------------------- + E E hf (^) i ( 3 ) ≅

f (^) i (^2 )^

2 f (^) i – 5 f (^) i – 1 + 4 f (^) i – 2 – f (^) i – 3 h

= ---------------------------------------------------------- 2 - + E E

≅------ h^2 f (^) i (^4 )

f (^) i (^2 )^

f (^) i + 1 – 2 f (^) i + f (^) i – 1 h^2

= ------------------------------------- + E E^1

≅ – ------ h^2 f (^) i (^4 )

f (^) i ( 2 ) –^ f^ i + 2 +^16 f^ i + 1 –^30 f^ i +^16 f^ i – 1 – f^ i – 2 12 h^2

= ----------------------------------------------------------------------------------------- + E E

------ h 4 f (^) i ( 6 ) ≅