Computational Methods - Assignment Project 3 | MCEN 3030, Assignments of Mechanical Engineering

Material Type: Assignment; Professor: Vasilyev; Class: COMPUTATIONAL METHODS; Subject: Mechanical Engineering; University: University of Colorado - Boulder; Term: Unknown 1989;

Typology: Assignments

Pre 2010

Uploaded on 02/13/2009

koofers-user-cw8
koofers-user-cw8 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Computational Project # 3
Due October 9
Develop your own cubic spline interpolation code for an arbitrary distribution of grid
points with parabolic and natural boundary conditions. Do a study of the effect of the
choice of interpolation points in the interval
[
]
0,1 . Use the following three grid
distributions of N+1 points each for interpolation:
1) equally-spaced
,0,
kk,
x
kN
N
==
2) Chebyshev 11
cos , 0, ,
22
kk
x
kN
N
π
⎛⎞
=− =
⎜⎟
⎝⎠ and
3) arc sine points
1
11 2
sin 1 , 0, .
2
kk
x
kN
N
π
⎛⎞
=+ =
⎜⎟
⎝⎠
For each of the functions:
i. 2
1
19
x
+
ii. 1
2
x
iii.
()
1
22
1x
a) Compute cubic spline on the 3 grid distributions for N = 1, 5, 10, 15, and 20. For
each function evaluate the cubic spline on the finer grid. Plot the actual function
and its cubic spline for three different grid distributions in separate sub-windows.
b) Estimate the maximum error the cubic spline makes on the entire interval
[
]
0,1 by
sampling the cubic spline at much finer set of grid points and plot these errors vs.
N on semi-log scale in the forth sub-window.
c) Discuss the effectiveness of the choice for interpolation points.
P.S. Email your code to [email protected]. The program that you send should be
a working program. All the codes will be checked whether they run or not. If they are
erroneous, but run, points will be taken for the errors. If the code is not running (it has
some syntax errors), an additional 25% will be taken off. The goal of this class is for you
to be comfortable solving engineering problems. Please take your time and learn how to
trust the computer.

Partial preview of the text

Download Computational Methods - Assignment Project 3 | MCEN 3030 and more Assignments Mechanical Engineering in PDF only on Docsity!

Computational Project # 3

Due October 9

Develop your own cubic spline interpolation code for an arbitrary distribution of grid points with parabolic and natural boundary conditions. Do a study of the effect of the

choice of interpolation points in the interval [ 0,1]. Use the following three grid

distributions of N +1 points each for interpolation:

  1. equally-spaced

k^ ,^ 0,

k x k N , N

  1. Chebyshev 1 1 cos , 0, , 2 2 k

k x k N N

… and

  1. arc sine points (^1 1) sin 1 2 1 , 0,. 2 k

k x k N

π N

= + −^ ⎛^ − ⎞ =

For each of the functions:

i. (^2)

1 + 9 x

ii.

x

iii. ( )

2 12 1 − x

a) Compute cubic spline on the 3 grid distributions for N = 1, 5, 10, 15, and 20. For each function evaluate the cubic spline on the finer grid. Plot the actual function and its cubic spline for three different grid distributions in separate sub-windows.

b) Estimate the maximum error the cubic spline makes on the entire interval [ 0,1] by

sampling the cubic spline at much finer set of grid points and plot these errors vs. N on semi-log scale in the forth sub-window. c) Discuss the effectiveness of the choice for interpolation points.

P.S. Email your code to [email protected]. The program that you send should be a working program. All the codes will be checked whether they run or not. If they are erroneous, but run, points will be taken for the errors. If the code is not running (it has some syntax errors), an additional 25% will be taken off. The goal of this class is for you to be comfortable solving engineering problems. Please take your time and learn how to trust the computer.