Sunteți pe pagina 1din 1

MAE 290B, Winter 2015

Homework 1
Due Thursday, Jan. 22, in class

1. A function f (x) is known at points xi , i = 1, 2, . . . , n.


a) Obtain a fourth-order accurate central approximation to f 0 (x) at xi using the Taylor-series
method.
b) The function values at i 1, i, i + 1, i + 2 are used to obtain an approximation to f 0 (x) at xi
using the Taylor-series method. What is the best order of accuracy that you can obtain?
2. The following ODE is to be numerically integrated to obtain y at t = 1000 s
y 0 = sin(t) ;

y(0) = y0

(1)

a) Write a computer program that uses explicit Euler and the trapezoidal rule (Crank-Nicolson
or CN) method to obtain the solution for user-prescribed , y0 and time step. Let = 1
s1 . Vary the time step (t = 0.1, 1, 10, 100 s) and discuss the influence on the solution.
Compare the two methods in terms of accuracy, stability and convergence using your results.
b) Perform a mathematical analysis to obtain the stability and accuracy of the trapezoidal (CN)
method when applied to the linear equation
y 0 = y
c) Analytically obtain the amplitude and phase error of the trapezoidal method with time step
t when applied to Eq. (1)? Is your analysis consistent with the results of varying the time
step in part (a)?
3. A third-order Runge-Kutta scheme (RK3) is used to integrate the following linear ODE;
y 0 = y

y(0) = y0

a) Obtain the stability restriction on the time step t for complex . What is the restriction
on t for real = , > 0.
b) Write a program that integrates Eq. (1) using a RK3 scheme. Use either Eq. (10.37) or
(10.39) from T. Bewleys book as the RK3 scheme. Vary the time step (t = 0.1, 1, 10, 100
s) and contrast with the results of 2 (a).

S-ar putea să vă placă și