BIT203 · TU past paper
Numerical Methods 2078 question paper
The complete TU 2078 exam paper for Numerical Methods (BIT203), all 12 questions with solved model answers written to the mark scheme.
Tap a question to open its answer.
- 110 marksNumericalSimpson's 3/8 rule and composite Simpson'sHideAnswer
Derive the formula for integration using simpsons 3/8 rule. Use Secant Method to estimate the root of equation with initial estimate x₁ = 4 and x₂ = 2, $x^2 - 4x - 10 = 0$. [10]
Divide $[a,b]$ into 3 equal sub-intervals with 4 points: $$x0=a,\quad x1=a+h,\quad x2=a+2h,\quad x3=a+3h=b,\qquad h=\frac{b-a}{3}$$ Let $yi=f(xi)$. Use Newton's forward interpolation with $x=x0+th$, $dx=h,dt$: $$f(x)\approx y0+t\Delta y...
- 210 marksNumericalShooting method for boundary value problemHideAnswer
What do you mean by boundary value problem? Use shootuing method, solve the equation: y'' = 6x², with y(0) = 1 and y(1) = 2 in the interval (0, 1) for y(0.5) taking h = 0.5[10]
Boundary Value Problem and Shooting Method
Step 1 - Extract: Given Data
- ODE: $y'' = 6x^2$
- Boundary conditions: $y(0) = 1$, $y(1) = 2$
- Interval: $(0, 1)$
- Step size: $h = 0.5$
- Required: $y(0.5)$
Boundary Value Problem (Definition)
A boundary value problem (BVP) is a differential equation together with conditions specified at two or more different points (the boundaries of the domain), rather than all at a single point.
General second order form: $$y'' = f(x, y, y'), \quad a \le x \le b, \quad y(a) = \alpha, \ \ y(b) = \beta$$
Shooting Method (Idea)
The shooting method converts a BVP into an initial value problem (IVP) by guessing the unknown initial slope $y'(0) = t$, integrating forward, and adjusting $t$ until the far boundary condition $y(b) = \beta$ is met. Since this ODE is linear, only two trial slopes (or the decomposition method) are needed, and the correct $t$ follows by linear interpolation.
Step 2 - Solve
Reduce to a first-order system with $y_1 = y$, $y_2 = y'$: $$y_1' = y_2, \qquad y_2' = 6x^2$$ with $y_1(0) = 1$, $y_2(0) = t$ (unknown).
Use Euler's method, $h = 0.5$, two steps ($x = 0, 0.5, 1.0$).
Trial 1: guess $t = t_1 = 0$
$x$ $y_1$ $y_2$ $y_2'=6x^2$ 0.0 1.0000 0.0000 0.0 0.5 $1+0.5(0)=1.0000$ $0+0.5(0)=0.0000$ $6(0.25)=1.5$ 1.0 $1+0.5(0)=1.0000$ $0+0.5(1.5)=0.75$ -- So with $t_1 = 0$: $y(1) = 1.0000 \equiv \beta_1$
Trial 2: guess $t = t_2 = 1$
$x$ $y_1$ $y_2$ $y_2'=6x^2$ 0.0 1.0000 1.0000 0.0 0.5 $1+0.5(1)=1.5000$ $1+0.5(0)=1.0000$ $1.5$ 1.0 $1.5+0.5(1)=2.0000$ $1+0.5(1.5)=1.75$ -- So with $t_2 = 1$: $y(1) = 2.0000 \equiv \beta_2$
Linear interpolation for correct slope
Target $\beta = 2$. Since the ODE is linear: $$t = t_1 + (t_2 - t_1)\cdot \frac{\beta - \beta_1}{\beta_2 - \beta_1} = 0 + (1-0)\cdot\frac{2 - 1}{2 - 1} = 1$$
Thus the correct slope is $t = 1$, and Trial 2 is exactly the required solution.
Read off $y(0.5)$
From Trial 2 at $x = 0.5$: $$\boxed{y(0.5) = 1.5000}$$
Verification with Exact Solution
Integrating twice: $$y' = 2x^3 + C_1, \qquad y = \frac{x^4}{2} + C_1 x + C_2$$
Apply $y(0)=1 \Rightarrow C_2 = 1$. Apply $y(1)=2 \Rightarrow \tfrac12 + C_1 + 1 = 2 \Rightarrow C_1 = \tfrac12$.
$$y = \frac{x^4}{2} + \frac{x}{2} + 1$$
Exact value: $$y(0.5) = \frac{(0.5)^4}{2} + \frac{0.5}{2} + 1 = \frac{0.0625}{2} + 0.25 + 1 = 0.03125 + 1.25 = 1.28125$$
Note: The Euler shooting result $y(0.5) = 1.5$ differs from the exact $1.28125$. This gap is due to the very large step size $h = 0.5$ used by Euler's method (only two steps). Euler's method reproduces the correct boundary values $y(0)=1$ and $y(1)=2$ exactly because the slope-parameter interpolation is exact for the linear problem, but the intermediate point $y(0.5)$ carries the local truncation error of Euler's scheme. The method-consistent answer requested by the problem (using shooting with $h=0.5$) is:
$$y(0.5) \approx 1.5$$
while the true analytic value is $1.28125$.
- 310 marksLagrange interpolation formula and algoritHideAnswer
Write an algorithm and program to compute the interpolation using Lagrange Interpolation.[10]
Lagrange Interpolation is a method to find a polynomial that passes through a given set of data points. Given n+1 data points $(x0, y0), (x1, y1), \ldots, (xn, yn)$, the interpolating polynomial is: $$P(x) = \sum{i=0}^{n} yi \cdot Li(x)
- 45 marksNewton Raphson method formula and convergeHideAnswer
Show that the rate of convergence of Newtons Raphson method is quadratic. [5]
Let $x^$ be the exact root of $f(x) = 0$, and let $xn$ be the $n$-th approximation. Define the error at the $n$-th step as: $$en = xn - x^$$ The Newton-Raphson iteration formula is: $$x{n+1} = xn - \frac{f(xn)}{f'(xn)}$$ --- Expand
- 55 marksNumericalExponential curve fittingHideAnswer
The temperature of a metal strip was measured at various time intervals during heating and the values are given in the table below. If the relation between the time 't' and temperature 'T' is of the form: $T = be^{t/4} + a$. Estimate the temperature at t = 6 minute.
Time ('t' min) 1 2 3 4 Temp ('T' °C) 70 83 100 124 [5]
Relation: $T = be^{t/4} + a$ t (min) 1 2 3 4 --------------- T (°C) 70 83 100 124 Estimate: T at t = 6. Substitute $u = e^{t/4}$, giving the linear form $T = a + bu$. Compute u values: t T $u = e^{t/4}$ --------- 1 70
- 65 marksNumericalNewton's divided difference methodHideAnswer
Given the following set of data points. Obtain the table of divided difference and use that table to estimate the value of $f(1.5)$.
$$\begin{array}{|c|c|c|c|c|c|}\hline x & 1 & 2 & 3 & 4 & 5 \ \hline f(x)=x^3-1 & 0 & 7 & 26 & 63 & 124 \ \hline \end{array}$$
[5]
$x$ 1 2 3 4 5 ------------------ $f(x)=x^3-1$ 0 7 26 63 124 Estimate: $f(1.5)$ --- First divided differences: $$f[1,2]=\frac{7-0}{2-1}=7,\quad f[2,3]=\frac{26-7}{3-2}=19$$ $$f[3,4]=\frac{63-26}{4-3}=37,\quad f[4,5]=\frac{124-63}{5-4}=61
- 75 marksNumericalGaussian elimination with partial pivotingHideAnswer
Solve the following system of linear equation by Gauss Elimination with Pivoting $2x + 2y + z = 6$, $4x + 2y + 3z = 4$, $x - y + 1 = 0$. [5]
Equations: - $2x + 2y + z = 6$ - $4x + 2y + 3z = 4$ - $x - y + 1 = 0 \Rightarrow x - y = -1$ Augmented matrix: $$[Ab] = \begin{bmatrix} 2 & 2 & 1 & & 6 \ 4 & 2 & 3 & & 4 \ 1 & -1 & 0 & & -1 \end{bmatrix}$$ Largest magnitude in column 1...
- 85 marksNumericalComputing eigenvalues and eigenvectorsHideAnswer
Determine the Eigen Values and corresponding Eigen Vectors for the matrix.
$$A = \begin{bmatrix} 1 & 6 & 1 \ 1 & 2 & 0 \ 0 & 0 & 3 \end{bmatrix}$$
[5]
$$A = \begin{bmatrix} 1 & 6 & 1 \ 1 & 2 & 0 \ 0 & 0 & 3 \end{bmatrix}$$ --- $$\det(A - \lambda I) = 0$$ $$A - \lambda I = \begin{bmatrix} 1-\lambda & 6 & 1 \ 1 & 2-\lambda & 0 \ 0 & 0 & 3-\lambda \end{bmatrix}$$ Expand along Row 3 (o...
- 95 marksNumericalDivided difference table for derivativesHideAnswer
The table below gives the values of distance travelled by a car at various time intervals during the initial running. Estimate the velocity and acceleration at time t = 7 sec.
$$\begin{array}{|c|c|c|c|c|c|}\hline \text{Time (t sec)} & 5 & 6 & 7 & 8 & 9 \ \hline \text{Distance (s m)} & 10.0 & 14.5 & 19.5 & 25.5 & 32.0 \ \hline \end{array}$$
[5]
Time $t$ (sec) 5 6 7 8 9 ------------------ Distance $s$ 10.0 14.5 19.5 25.5 32.0 - Uniform spacing $h = 1$ - Required: velocity $\frac{ds}{dt}$ and acceleration $\frac{d^2s}{dt^2}$ at $t = 7$ (The problem header mislabels the second row...
- 105 marksNumericalTrapezoidal rule and composite trapezoidalHideAnswer
Solve the following integral using trapezoidal rule form = 8, $l=\int_{2}^{4} (x^4 + 1)dx$. [5]
- Integral: $l = \int2^4 (x^4 + 1),dx$ - $a = 2$, $b = 4$ - Number of subintervals: $n = 8$ Step size: $$h = \frac{b-a}{n} = \frac{4-2}{8} = 0.25$$ Table of values with $f(x) = x^4 + 1$: $i$ $xi$ $xi^4$ $f(xi)$ -------------------------...
- 115 marksNumericalEuler's method for ODE solvingHideAnswer
Given the equation y′=3x2+1y' = 3x^2 + 1y′=3x2+1 with y(1) = 2, estimate y(2) by Euler's Method using h = 0.2. [5]
- $f(x,y) = y' = 3x^2 + 1$ - $x0 = 1.0$, $y0 = 2.0$ - $h = 0.2$ - Target: $y(2)$ → requires $\frac{2-1}{0.2} = 5$ steps Euler formula: $$y{n+1} = yn + h,f(xn, yn)$$ Step 1 ($x0=1.0,\ y0=2.0$): $$f = 3(1.0)^2+1 = 4 \implies y1 = 2.0 + 0....
- 125 marksNumericalPoisson's equation and finite difference mHideAnswer
Solve the Poisson's Equation $\nabla^2 f = 2x^2 y^2$ over the square domain $0 \leq x \leq 3$ and $0 \leq y \leq 3$ with $f = 0$ on the boundary and $h = 1$. [5]
Solving Poisson's Equation by Finite Difference Method
STEP 1 - Given Data
- PDE: $\nabla^2 f = f_{xx} + f_{yy} = 2x^2y^2$
- Domain: $0 \le x \le 3$, $0 \le y \le 3$ (square)
- Boundary condition: $f = 0$ on all boundaries
- Step size: $h = 1$
With $h=1$ over $[0,3]$, interior nodes are at $x=1,2$ and $y=1,2$ (four interior points).
STEP 2 - Solution
Five-point formula: $$f_{i+1,j}+f_{i-1,j}+f_{i,j+1}+f_{i,j-1}-4f_{i,j}=h^2 g(x_i,y_j)=2x_i^2 y_j^2$$
Interior points and RHS $=2x^2y^2$:
Label $(x,y)$ RHS $f_1$ $(1,1)$ $2$ $f_2$ $(2,1)$ $8$ $f_3$ $(1,2)$ $8$ $f_4$ $(2,2)$ $32$ Equations (boundaries = 0):
$(1,1):; -4f_1+f_2+f_3=2$ ...(1)
$(2,1):; f_1-4f_2+f_4=8$ ...(2)
$(1,2):; f_1-4f_3+f_4=8$ ...(3)
$(2,2):; f_2+f_3-4f_4=32$ ...(4)
Symmetry: (2) and (3) give $f_2=f_3$.
From (1): $-4f_1+2f_2=2 \Rightarrow f_1=\dfrac{2f_2-2}{4}=\dfrac{f_2-1}{2}$ ...(5)
From (4): $2f_2-4f_4=32 \Rightarrow f_4=\dfrac{2f_2-32}{4}=\dfrac{f_2-16}{2}$ ...(6)
Substitute into (2): $f_1-4f_2+f_4=8$
$$\frac{f_2-1}{2}-4f_2+\frac{f_2-16}{2}=8$$
$$\frac{(f_2-1)+(f_2-16)}{2}-4f_2=8$$
$$\frac{2f_2-17}{2}-4f_2=8$$
$$f_2-8.5-4f_2=8$$
$$-3f_2=16.5 \Rightarrow f_2=-5.5$$
Back-substitute:
$$f_3=f_2=-5.5$$
$$f_1=\frac{f_2-1}{2}=\frac{-5.5-1}{2}=\frac{-6.5}{2}=-3.25$$
$$f_4=\frac{f_2-16}{2}=\frac{-5.5-16}{2}=\frac{-21.5}{2}=-10.75$$
Verification with (1): $-4(-3.25)+(-5.5)+(-5.5)=13-11=2$ ✓ With (4): $-5.5-5.5-4(-10.75)=-11+43=32$ ✓
Final Result
$$\boxed{f_1=f(1,1)=-3.25,\quad f_2=f(2,1)=-5.5,\quad f_3=f(1,2)=-5.5,\quad f_4=f(2,2)=-10.75}$$