課程名稱︰數值方法
課程性質︰必修
課程教師︰張恆華
開課學院:工學院
開課系所︰工科海洋系
考試日期(年月日)︰2011/5/11 (三)
考試時限(分鐘):3小時 (9:10am ~ 12:10pm)
是否需發放獎勵金:是
(如未明確表示,則不予發放)
Numerical Methods: 505 29120/ESOE 2024
This is an open book, open notes exam. Most electronic devices are forbidden
on your person, including cell phones,iPods, iPads, headphones, PDAs, and
computers. Turn your cell phone off and leave all electronics EXCEPT
calculators in your backpack or bag, or risk getting a zero on the exam.
試題 :
1. Use zero-through third-order Taylor series expansions to predict f(3) for
3 2
f(x) = 25x - 6x + 7x - 88
using a base point at x = 1. Compute the true percent relative error ε for
t
each approximation. (10 pts)
2. The Maclaurin series expansion for cos(x) is
2 4 6 8
x x x x
cos(x) = 1 - ——— + ——— - ——— + ——— - ...
2 4! 6! 8!
Starting with the simplest version, cos(x) = 1, add terms one at a time to
estimate cos(π/3). After each new term is added, compute the true and
approximate percent relative errors. Use your pocket calculator to
determine the true value. Add terms until the absolute value of the
approximate error estimate falls below an error criterion conforming to
two significant figures. (10 pts)
2 -x
3. Determine the root of f(x) = x - e by: (15 pts)
(a) Using the bisection method. Start with a = 0 and b = 1, and carry out
the first four iterations.
(b) Using the secant method. Start with the two points x1 = 0 and x2 = 1,
and carry out the first four iterations.
(c) Using the Newton-Raphson method. Start at x1 = 0 and carry out the
first four iterations.
Please use 5 significant digits for all answers.
4. A new method for solving the root of a function, called trisection, is
proposed. The method is similar to the bisection method. The solution
starts by finding an interval [a,b] that brackets the solution. The first
estimate of the solution is the midpoint between x = a and x = b. Then,
as the name of the method suggests, the interval [a,b] is divided into
three equal sections. The section that contains the root is taken as the
new interval for the next iteration.
Write a user-defined MATLAB function that solves the root with the proposed
new method. Name the function Xs = TrisectionRoot(Fun, a, b, TolMax), where
the output argument Xs is the solution. The input argument Fun is the
function name, a and b are two points that bracket the root, and TolMax
is the maximum tolerance. Please set the maximum iteration number 20 in
your solution. (20 pts)
5. Develop an M-file to implement parabolic interpolation to locate a minimum.
The subroutine should have the following features: (20 pts)
(a) Base it on two initial guesses, and have the program generate the third
initial value at the midpoint of the interval.
(b) Check whether the guesses bracket a minimum. If not, the subroutine
should not implement the algorithm, but should return an error message.
(c) Iterate until the relative error falls below a stopping criterion or
exceeds a maximum number of iterations.
(d) Return both the optimal x and f(x).
6. Given the system of equations (25 pts)
- 3x + 7x = 2
2 3
x + 2x - x = 3
1 2 3
5x - 2x = 2
1 2
(a) Compute the determinant. (2 pts)
(b) Use Cramer's rule to solve for the x's. (9 pts)
(c) Use Gauss elimination with partial pivoting to solve for the x's.
(14 pts)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.4.183