Browse papers
A

Section A: Long Answer Questions

Attempt all / any as specified.

4 questions
1long12 marks

(a) Derive the iterative formula for the Newton-Raphson method for finding a real root of a nonlinear equation f(x)=0f(x)=0, and give a clear geometrical interpretation of the method. State two situations in which the method fails to converge. [7]

(b) A real root of the equation x35x+1=0x^3 - 5x + 1 = 0 lies between 0 and 1. Using the Newton-Raphson method, compute the root correct to four decimal places. [5]

(a) Newton-Raphson method

Derivation. Let xnx_n be an approximation to the root of f(x)=0f(x)=0. Expand ff in a Taylor series about xnx_n and retain only the linear term:

f(xn+1)f(xn)+(xn+1xn)f(xn)=0.f(x_{n+1}) \approx f(x_n) + (x_{n+1}-x_n)\,f'(x_n) = 0.

Solving for xn+1x_{n+1} gives the Newton-Raphson iterative formula:

xn+1=xnf(xn)f(xn),f(xn)0.\boxed{\,x_{n+1} = x_n - \dfrac{f(x_n)}{f'(x_n)}\,}, \qquad f'(x_n)\neq 0.

Geometrical interpretation. At the point (xn,f(xn))(x_n, f(x_n)) draw the tangent to the curve y=f(x)y=f(x). The tangent has slope f(xn)f'(x_n); the point where this tangent crosses the xx-axis is taken as the next approximation xn+1x_{n+1}. Thus each iteration replaces the curve locally by its tangent line and uses the tangent's xx-intercept as the improved estimate. Repeating this drives the iterate towards the actual root, and the convergence is quadratic near a simple root.

Two situations of failure:

  1. f(xn)f'(x_n) is zero or very small (a horizontal/near-horizontal tangent): the tangent is nearly parallel to the xx-axis, so xn+1x_{n+1} shoots far away and the iteration diverges or overflows.
  2. Poor initial guess / unsuitable function shape (e.g. a point near a local maximum or minimum, or oscillation between two values): the successive iterates may cycle or move away from the root instead of converging.

(b) Root of x35x+1=0x^3-5x+1=0 in (0,1)(0,1)

Here f(x)=x35x+1f(x)=x^3-5x+1 and f(x)=3x25f'(x)=3x^2-5. Take x0=0.5x_0=0.5.

nnxnx_nf(xn)f(x_n)xn+1x_{n+1}
00.5000001.375-1.3750.176471
10.1764710.117-0.1170.201568
20.2015680.000336-0.0003360.201640
30.2016400\approx 00.201640

Since x3x_3 and x2x_2 agree to four decimals,

x0.2016.\boxed{x \approx 0.2016}.
roots-of-nonlinear-equationsnewton-raphson
2long12 marks

(a) Explain the construction of a natural cubic spline that interpolates a set of (n+1)(n+1) data points. Clearly state the continuity conditions imposed at the interior knots and the boundary conditions for the natural spline. [6]

(b) Using Newton's divided difference interpolation, estimate the value of f(3)f(3) from the following data:

xx01245
f(x)f(x)1393351

(a) Natural cubic spline

Given (n+1)(n+1) points (x0,y0),,(xn,yn)(x_0,y_0),\dots,(x_n,y_n) with x0<x1<<xnx_0<x_1<\cdots<x_n, a cubic spline S(x)S(x) is a piecewise cubic: on each sub-interval [xi,xi+1][x_i,x_{i+1}] it is a separate cubic Si(x)=ai+bi(xxi)+ci(xxi)2+di(xxi)3S_i(x)=a_i+b_i(x-x_i)+c_i(x-x_i)^2+d_i(x-x_i)^3 (i=0,,n1i=0,\dots,n-1), giving 4n4n unknown coefficients.

Continuity conditions at the interior knots x1,,xn1x_1,\dots,x_{n-1}:

  1. Interpolation: Si(xi)=yiS_i(x_i)=y_i and Si(xi+1)=yi+1S_i(x_{i+1})=y_{i+1} — the spline passes through every data point and is continuous.
  2. First-derivative continuity: Si1(xi)=Si(xi)S_{i-1}'(x_i)=S_i'(x_i) — the slopes match at each interior knot.
  3. Second-derivative continuity: Si1(xi)=Si(xi)S_{i-1}''(x_i)=S_i''(x_i) — the curvatures match, giving a smooth (C2C^2) curve.

These conditions give 4n24n-2 equations. Writing Mi=S(xi)M_i=S''(x_i), the second-derivative continuity reduces to the tridiagonal system

hi1Mi1+2(hi1+hi)Mi+hiMi+1=6(yi+1yihiyiyi1hi1),hi=xi+1xi.h_{i-1}M_{i-1}+2(h_{i-1}+h_i)M_i+h_iM_{i+1}=6\left(\frac{y_{i+1}-y_i}{h_i}-\frac{y_i-y_{i-1}}{h_{i-1}}\right),\quad h_i=x_{i+1}-x_i.

Boundary conditions (natural spline): the curvature is set to zero at the two ends,

S(x0)=M0=0,S(xn)=Mn=0.S''(x_0)=M_0=0, \qquad S''(x_n)=M_n=0.

These two extra conditions complete the system, which is solved (tridiagonal) for the MiM_i and hence the cubic coefficients.

(b) Newton's divided difference, estimate f(3)f(3)

Data: x=0,1,2,4,5x=0,1,2,4,5, f=1,3,9,33,51f=1,3,9,33,51.

Divided-difference table (leading coefficients):

ordervalues
f[]f[\,]1, 3, 9, 33, 511,\ 3,\ 9,\ 33,\ 51
1st2, 6, 12, 182,\ 6,\ 12,\ 18
2nd2, 2, 22,\ 2,\ 2
3rd0, 00,\ 0
4th00

Leading coefficients: a0=1, a1=2, a2=2, a3=0, a4=0a_0=1,\ a_1=2,\ a_2=2,\ a_3=0,\ a_4=0.

P(x)=1+2(x0)+2(x0)(x1)+0+0.P(x)=1+2(x-0)+2(x-0)(x-1)+0+0.

At x=3x=3:

P(3)=1+2(3)+2(3)(2)=1+6+12=19.P(3)=1+2(3)+2(3)(2)=1+6+12=\boxed{19}.

Thus f(3)19f(3)\approx 19. (Indeed P(x)=2x2+1P(x)=2x^2+1 fits the data exactly.)

interpolationnewton-divided-differencecubic-spline
3long12 marks

(a) Describe the Gauss elimination method with partial pivoting for solving a system of linear equations. Explain why partial pivoting is necessary and how it improves numerical stability. [6]

(b) Solve the following system of equations using the Gauss-Seidel iterative method, performing three iterations and starting with the initial guess (0,0,0)(0,0,0):

20x+y2z=17,3x+20yz=18,2x3y+20z=2520x + y - 2z = 17,\quad 3x + 20y - z = -18,\quad 2x - 3y + 20z = 25

[6]

(a) Gauss elimination with partial pivoting

For [A]{x}={b}[A]\{x\}=\{b\} the method reduces the augmented matrix to upper-triangular form by elementary row operations, then back-substitutes.

Procedure (for column k=1,2,,n1k=1,2,\dots,n-1):

  1. Pivot search: among the entries akk,ak+1,k,,anka_{kk},a_{k+1,k},\dots,a_{nk} in the current column, find the one of largest absolute value.
  2. Row interchange: swap that row with row kk, so the largest element becomes the pivot akka_{kk}.
  3. Elimination: for each row i>ki>k, compute the multiplier mik=aik/akkm_{ik}=a_{ik}/a_{kk} and replace row ii by rowimikrowk\text{row}_i - m_{ik}\,\text{row}_k, making all entries below the pivot zero.
  4. After triangularisation, solve by back substitution xn=bn/annx_n=b_n/a_{nn}, xi=(bij>iaijxj)/aiix_i=\big(b_i-\sum_{j>i}a_{ij}x_j\big)/a_{ii}.

Why partial pivoting is necessary / improves stability. Without pivoting the pivot akka_{kk} may be zero (division by zero) or very small. A small pivot makes the multipliers mikm_{ik} very large, so rounding errors already present in the entries are amplified during elimination, badly corrupting the answer. By always choosing the largest-magnitude available pivot, all multipliers satisfy mik1|m_{ik}|\le 1, which keeps the growth of round-off error bounded and greatly improves numerical stability.

(b) Gauss-Seidel, three iterations

The system is diagonally dominant. Rearranged iteration equations:

x=17y+2z20,y=183x+z20,z=252x+3y20.x=\frac{17-y+2z}{20},\quad y=\frac{-18-3x+z}{20},\quad z=\frac{25-2x+3y}{20}.

Start (x,y,z)=(0,0,0)(x,y,z)=(0,0,0), using newest values immediately:

Iterationxxyyzz
10.850001.02750-1.027501.01087
21.002460.99983-0.999830.99978
30.999971.00001-1.000011.00000

After three iterations,

x1.000,y1.000,z1.000.\boxed{x\approx 1.000,\quad y\approx -1.000,\quad z\approx 1.000}.
linear-systemsgauss-eliminationiterative-methods
4long12 marks

(a) Derive the standard five-point finite difference formula for the Laplace equation 2ux2+2uy2=0\dfrac{\partial^2 u}{\partial x^2} + \dfrac{\partial^2 u}{\partial y^2} = 0 over a rectangular region. [5]

(b) A square plate is divided into a mesh as shown, with the boundary values of uu specified. Set up the system of linear equations for the interior nodal values u1,u2,u3,u4u_1, u_2, u_3, u_4 using the five-point formula, and solve for the interior values by the Gauss-Seidel (Liebmann) iteration, taking the boundary on all four edges as u=100u = 100 on the top edge and u=0u = 0 on the remaining three edges. [7]

(a) Five-point formula for the Laplace equation

Discretise the region with a uniform mesh of spacing hh in both xx and yy. Denote ui,j=u(xi,yj)u_{i,j}=u(x_i,y_j). Using central second differences:

2ux2ui+1,j2ui,j+ui1,jh2,2uy2ui,j+12ui,j+ui,j1h2.\frac{\partial^2 u}{\partial x^2}\approx\frac{u_{i+1,j}-2u_{i,j}+u_{i-1,j}}{h^2},\qquad \frac{\partial^2 u}{\partial y^2}\approx\frac{u_{i,j+1}-2u_{i,j}+u_{i,j-1}}{h^2}.

Substituting into uxx+uyy=0u_{xx}+u_{yy}=0 and multiplying by h2h^2:

ui+1,j+ui1,j+ui,j+1+ui,j14ui,j=0,u_{i+1,j}+u_{i-1,j}+u_{i,j+1}+u_{i,j-1}-4u_{i,j}=0,

so the standard five-point (Laplacian) formula is

ui,j=14(ui+1,j+ui1,j+ui,j+1+ui,j1).\boxed{\,u_{i,j}=\tfrac14\big(u_{i+1,j}+u_{i-1,j}+u_{i,j+1}+u_{i,j-1}\big)\,}.

Each interior value equals the average of its four neighbours (left, right, top, bottom).

(b) Square plate, four interior nodes

Label the interior nodes on a 2×22\times2 interior grid: top row u1u_1 (left), u2u_2 (right); bottom row u3u_3 (left), u4u_4 (right). Boundary: top edge =100=100, the other three edges =0=0.

Applying the five-point average to each node:

4u1=100+u2+u3,4u2=100+u1+u4,4u_1=100+u_2+u_3,\quad 4u_2=100+u_1+u_4, 4u3=u1+u4+0+0,4u4=u2+u3+0+0.4u_3=u_1+u_4+0+0,\quad 4u_4=u_2+u_3+0+0.

Gauss-Seidel (Liebmann) iteration, starting from 00 and using newest values:

Iteru1u_1u2u_2u3u_3u4u_4
125.00031.2506.2509.375
234.37535.93810.93811.719
336.71937.11012.11012.305
converged37.50037.50012.50012.500

By symmetry u1=u2u_1=u_2 and u3=u4u_3=u_4. The converged interior values are

u1=u2=37.5,u3=u4=12.5.\boxed{u_1=u_2=37.5,\qquad u_3=u_4=12.5}.
numerical-solution-of-pdeslaplace-equationfinite-difference
B

Section B: Short Answer Questions

Attempt all / any as specified.

8 questions
5short6 marks

Find a real root of the equation xex=2x e^{x} = 2 correct to three decimal places using the Bisection method, taking the initial interval as [0,1][0, 1]. Tabulate your iterations clearly.

Bisection method for f(x)=xex2=0f(x)=xe^{x}-2=0 on [0,1][0,1]

Check signs: f(0)=2<0f(0)=-2<0, f(1)=e2=0.7183>0f(1)=e-2=0.7183>0, so a root lies in [0,1][0,1]. Each step takes the midpoint c=(a+b)/2c=(a+b)/2 and keeps the half-interval where the sign change occurs.

nnaabbc=(a+b)/2c=(a+b)/2f(c)f(c)sign
10.0000001.0000000.5000001.1756-1.1756-
20.5000001.0000000.7500000.4123-0.4123-
30.7500001.0000000.875000+0.0990+0.0990++
40.7500000.8750000.8125000.1690-0.1690-
50.8125000.8750000.8437500.0382-0.0382-
60.8437500.8750000.859375+0.0296+0.0296++
70.8437500.8593750.8515620.0045-0.0045-
80.8515620.8593750.855469+0.0125+0.0125++
90.8515620.8554690.853516+0.0040+0.0040++
100.8515620.8535160.8525390.00029-0.00029-
110.8525390.8535160.853027+0.0018+0.0018++
120.8525390.8530270.852783+0.0008+0.0008++
130.8525390.8527830.852661+0.0002+0.0002++
140.8525390.8526610.8526000.00002-0.00002-

The iterates have settled to three decimal places:

x0.853.\boxed{x\approx 0.853}.
roots-of-nonlinear-equationsbisection-method
6short6 marks

Evaluate the integral 01dx1+x2\displaystyle\int_{0}^{1} \frac{dx}{1+x^2} using Simpson's 1/3 rule with h=0.25h = 0.25, and compare your result with the exact value. Briefly explain how the accuracy could be improved using Romberg integration.

Simpson's 1/3 rule for 01dx1+x2\displaystyle\int_0^1\frac{dx}{1+x^2}, h=0.25h=0.25

Nodes (n=4n=4 intervals) and ordinates f(x)=11+x2f(x)=\dfrac{1}{1+x^2}:

xx0.000.250.500.751.00
f(x)f(x)1.0000000.9411760.8000000.6400000.500000

Simpson's 1/3 rule:

I=h3[f0+f4+4(f1+f3)+2f2]I=\frac{h}{3}\Big[f_0+f_4+4(f_1+f_3)+2f_2\Big] =0.253[1.0+0.5+4(0.941176+0.640000)+2(0.800000)]=\frac{0.25}{3}\big[1.0+0.5+4(0.941176+0.640000)+2(0.800000)\big] =0.253[1.5+6.324706+1.6]=0.253(9.424706)=0.785392.=\frac{0.25}{3}\,[1.5+6.324706+1.6]=\frac{0.25}{3}(9.424706)=\boxed{0.785392}.

Comparison with exact value. The exact value is 01dx1+x2=tan1(1)=π4=0.785398\int_0^1\frac{dx}{1+x^2}=\tan^{-1}(1)=\dfrac{\pi}{4}=0.785398. The error is only 6×106\approx 6\times10^{-6}, showing Simpson's rule is very accurate here.

Improving accuracy with Romberg integration. Romberg integration starts from the composite trapezoidal rule Rk,1R_{k,1} for successively halved step sizes and then applies Richardson extrapolation

Rk,j=4j1Rk,j1Rk1,j14j11R_{k,j}=\frac{4^{\,j-1}R_{k,j-1}-R_{k-1,j-1}}{4^{\,j-1}-1}

to systematically cancel the leading error terms. The first extrapolation column already reproduces Simpson's rule, and each further column removes higher-order error, so accuracy improves rapidly (effectively raising the order of the method) without computing many extra function values.

numerical-integrationsimpson-ruleromberg-integration
7short6 marks

Fit a straight line y=a+bxy = a + bx to the following data using the method of least squares:

xx12345
yy2.13.96.17.810.2

Hence estimate the value of yy when x=6x = 6.

Least-squares straight line y=a+bxy=a+bx

With n=5n=5 points, form the required sums:

xxyyx2x^2xyxy
12.112.1
23.947.8
36.1918.3
47.81631.2
510.22551.0
x=15\sum x=15y=30.1\sum y=30.1x2=55\sum x^2=55xy=110.4\sum xy=110.4

Normal equations:

y=na+bx,xy=ax+bx2\sum y = na + b\sum x,\qquad \sum xy = a\sum x + b\sum x^2 30.1=5a+15b,110.4=15a+55b.30.1 = 5a+15b,\qquad 110.4 = 15a+55b.

Solve:

b=nxyxynx2(x)2=5(110.4)15(30.1)5(55)152=552451.5275225=100.550=2.01.b=\frac{n\sum xy-\sum x\sum y}{n\sum x^2-(\sum x)^2}=\frac{5(110.4)-15(30.1)}{5(55)-15^2}=\frac{552-451.5}{275-225}=\frac{100.5}{50}=2.01. a=ybxn=30.12.01(15)5=30.130.155=0.01.a=\frac{\sum y-b\sum x}{n}=\frac{30.1-2.01(15)}{5}=\frac{30.1-30.15}{5}=-0.01.

Fitted line:

y=0.01+2.01x.\boxed{y=-0.01+2.01\,x}.

Estimate at x=6x=6:

y(6)=0.01+2.01(6)=12.05.y(6)=-0.01+2.01(6)=12.05.
curve-fittingleast-squares
8short6 marks

Derive the central difference formulae for the first and second derivatives of a function from Taylor's series expansion, and state their orders of accuracy. Using the data below, compute f(2.0)f'(2.0) and f(2.0)f''(2.0):

xx1.82.02.2
f(x)f(x)6.0507.3899.025

Central difference formulae from Taylor's series

Expand ff about xx with step hh:

f(x+h)=f(x)+hf(x)+h22f(x)+h36f(x)+f(x+h)=f(x)+hf'(x)+\tfrac{h^2}{2}f''(x)+\tfrac{h^3}{6}f'''(x)+\cdots f(xh)=f(x)hf(x)+h22f(x)h36f(x)+f(x-h)=f(x)-hf'(x)+\tfrac{h^2}{2}f''(x)-\tfrac{h^3}{6}f'''(x)+\cdots

First derivative: subtract the second from the first; the even terms cancel:

f(x+h)f(xh)=2hf(x)+h33f(x)+f(x+h)-f(x-h)=2hf'(x)+\tfrac{h^3}{3}f'''(x)+\cdots  f(x)=f(x+h)f(xh)2h+O(h2).\Rightarrow\ f'(x)=\frac{f(x+h)-f(x-h)}{2h}+O(h^2).

Second derivative: add the two expansions; the odd terms cancel:

f(x+h)+f(xh)=2f(x)+h2f(x)+h412f(4)(x)+f(x+h)+f(x-h)=2f(x)+h^2f''(x)+\tfrac{h^4}{12}f^{(4)}(x)+\cdots  f(x)=f(x+h)2f(x)+f(xh)h2+O(h2).\Rightarrow\ f''(x)=\frac{f(x+h)-2f(x)+f(x-h)}{h^2}+O(h^2).

Both central-difference formulae are second-order accurate, i.e. the truncation error is O(h2)O(h^2).

Numerical evaluation at x=2.0x=2.0, h=0.2h=0.2

Data: f(1.8)=6.050, f(2.0)=7.389, f(2.2)=9.025f(1.8)=6.050,\ f(2.0)=7.389,\ f(2.2)=9.025.

f(2.0)=f(2.2)f(1.8)2h=9.0256.0500.4=2.9750.4=7.4375.f'(2.0)=\frac{f(2.2)-f(1.8)}{2h}=\frac{9.025-6.050}{0.4}=\frac{2.975}{0.4}=7.4375. f(2.0)=f(2.2)2f(2.0)+f(1.8)h2=9.0252(7.389)+6.0500.04=0.2970.04=7.425.f''(2.0)=\frac{f(2.2)-2f(2.0)+f(1.8)}{h^2}=\frac{9.025-2(7.389)+6.050}{0.04}=\frac{0.297}{0.04}=7.425. f(2.0)7.4375,f(2.0)7.425.\boxed{f'(2.0)\approx 7.4375,\qquad f''(2.0)\approx 7.425.}

(Consistent with f=exf=e^x, for which f(2)=f(2)=e27.389f'(2)=f''(2)=e^2\approx 7.389.)

numerical-differentiationfinite-difference
9short6 marks

Using the fourth-order Runge-Kutta method, solve the initial value problem dydx=x+y\dfrac{dy}{dx} = x + y, with y(0)=1y(0) = 1, and find y(0.2)y(0.2) taking a step size h=0.1h = 0.1.

Fourth-order Runge-Kutta for y=x+yy'=x+y, y(0)=1y(0)=1, h=0.1h=0.1

The RK4 update is

k1=hf(x,y), k2=hf ⁣(x+h2,y+k12), k3=hf ⁣(x+h2,y+k22), k4=hf(x+h,y+k3),k_1=hf(x,y),\ k_2=hf\!\big(x+\tfrac h2,y+\tfrac{k_1}2\big),\ k_3=hf\!\big(x+\tfrac h2,y+\tfrac{k_2}2\big),\ k_4=hf(x+h,y+k_3), yn+1=yn+16(k1+2k2+2k3+k4),f(x,y)=x+y.y_{n+1}=y_n+\tfrac16(k_1+2k_2+2k_3+k_4),\qquad f(x,y)=x+y.

Step 1: x0=0, y0=1  x=0.1x_0=0,\ y_0=1\ \to\ x=0.1

k1=0.1(0+1)=0.100000k_1=0.1(0+1)=0.100000 k2=0.1(0.05+1.05)=0.110000k_2=0.1(0.05+1.05)=0.110000 k3=0.1(0.05+1.055)=0.110500k_3=0.1(0.05+1.055)=0.110500 k4=0.1(0.1+1.1105)=0.121050k_4=0.1(0.1+1.1105)=0.121050 y1=1+16(0.1+0.22+0.221+0.12105)=1.110342.y_1=1+\tfrac16(0.1+0.22+0.221+0.12105)=1.110342.

Step 2: x1=0.1, y1=1.110342  x=0.2x_1=0.1,\ y_1=1.110342\ \to\ x=0.2

k1=0.1(0.1+1.110342)=0.121034k_1=0.1(0.1+1.110342)=0.121034 k2=0.1(0.15+1.170859)=0.132086k_2=0.1(0.15+1.170859)=0.132086 k3=0.1(0.15+1.176385)=0.132638k_3=0.1(0.15+1.176385)=0.132638 k4=0.1(0.2+1.242980)=0.144298k_4=0.1(0.2+1.242980)=0.144298 y2=1.110342+16(0.121034+0.264172+0.265277+0.144298)=1.242805.y_2=1.110342+\tfrac16(0.121034+0.264172+0.265277+0.144298)=1.242805. y(0.2)1.2428.\boxed{y(0.2)\approx 1.2428.}

(Exact y=2exx1y=2e^x-x-1 gives y(0.2)=1.242806y(0.2)=1.242806, confirming the result.)

numerical-solution-of-odesrunge-kutta
10short4 marks

Using Lagrange's interpolation formula, find the value of f(2)f(2) from the following data:

xx0134
f(x)f(x)-1201224

Lagrange interpolation for f(2)f(2)

Data: x0=0,x1=1,x2=3,x3=4x_0=0,x_1=1,x_2=3,x_3=4 with f=12,0,12,24f=-12,0,12,24.

Lagrange formula:

f(x)=i=03yiLi(x),Li(x)=jixxjxixj.f(x)=\sum_{i=0}^{3} y_i\,L_i(x),\qquad L_i(x)=\prod_{j\neq i}\frac{x-x_j}{x_i-x_j}.

Evaluate each basis term at x=2x=2:

L0(2)=(21)(23)(24)(01)(03)(04)=(1)(1)(2)(1)(3)(4)=212=16,L_0(2)=\frac{(2-1)(2-3)(2-4)}{(0-1)(0-3)(0-4)}=\frac{(1)(-1)(-2)}{(-1)(-3)(-4)}=\frac{2}{-12}=-\tfrac16, L1(2)=(20)(23)(24)(10)(13)(14)=(2)(1)(2)(1)(2)(3)=46=23,L_1(2)=\frac{(2-0)(2-3)(2-4)}{(1-0)(1-3)(1-4)}=\frac{(2)(-1)(-2)}{(1)(-2)(-3)}=\frac{4}{6}=\tfrac23, L2(2)=(20)(21)(24)(30)(31)(34)=(2)(1)(2)(3)(2)(1)=46=23,L_2(2)=\frac{(2-0)(2-1)(2-4)}{(3-0)(3-1)(3-4)}=\frac{(2)(1)(-2)}{(3)(2)(-1)}=\frac{-4}{-6}=\tfrac23, L3(2)=(20)(21)(23)(40)(41)(43)=(2)(1)(1)(4)(3)(1)=212=16.L_3(2)=\frac{(2-0)(2-1)(2-3)}{(4-0)(4-1)(4-3)}=\frac{(2)(1)(-1)}{(4)(3)(1)}=\frac{-2}{12}=-\tfrac16.

Therefore

f(2)=(12)(16)+(0)(23)+(12)(23)+(24)(16)=2+0+84=6.f(2)=(-12)(-\tfrac16)+(0)(\tfrac23)+(12)(\tfrac23)+(24)(-\tfrac16)=2+0+8-4=\boxed{6}.

(f(2)6f(2)\approx 6; the data in fact lie on the line f(x)=6x12f(x)=6x-12.)

interpolationlagrange-interpolation
11short4 marks

Explain the shooting method for solving a two-point boundary value problem of a second-order ordinary differential equation. How does it convert a boundary value problem into an initial value problem?

Shooting method for a two-point BVP

Consider a second-order BVP

y=f(x,y,y),y(a)=α,y(b)=β.y''=f(x,y,y'),\qquad y(a)=\alpha,\quad y(b)=\beta.

The difficulty is that only one condition (y(a)=αy(a)=\alpha) is known at the starting end; the slope y(a)y'(a) there is unknown.

Converting BVP to IVP. Introduce the unknown initial slope as a parameter ss, i.e. assume

y(a)=s.y'(a)=s.

Now the problem becomes an initial value problem with both y(a)=αy(a)=\alpha and y(a)=sy'(a)=s known, which can be integrated forward from aa to bb using any IVP solver (RK4, Euler, etc.). The computed end value y(b)y(b) depends on the guessed slope, call it ϕ(s)=y(b;s)\phi(s)=y(b;s).

Hitting the target (the "shooting"). We need ϕ(s)=β\phi(s)=\beta. We:

  1. Choose two trial slopes s1,s2s_1,s_2, integrate the IVP, and obtain ϕ(s1),ϕ(s2)\phi(s_1),\phi(s_2).
  2. Since ϕ(s)β=0\phi(s)-\beta=0 is a root-finding problem in ss, improve the guess using linear interpolation (secant method):
s3=s2(ϕ(s2)β)s2s1ϕ(s2)ϕ(s1).s_3=s_2-\big(\phi(s_2)-\beta\big)\frac{s_2-s_1}{\phi(s_2)-\phi(s_1)}.
  1. Repeat until y(b)y(b) matches the prescribed β\beta to the desired tolerance.

Thus the method "shoots" trajectories from x=ax=a with different initial slopes and adjusts the slope (like aiming a gun) until the trajectory lands on the required boundary value at x=bx=b — converting a boundary value problem into a sequence of initial value problems combined with a root-finding step.

numerical-solution-of-odeseuler-methodshooting-method
12short4 marks

Explain the LU (Doolittle) decomposition method for solving a system of linear equations [A]{x}={b}[A]\{x\} = \{b\}. State its main advantage over Gauss elimination when the system must be solved for several different right-hand-side vectors {b}\{b\}.

LU (Doolittle) decomposition

The idea is to factor the coefficient matrix as a product of a lower- and an upper-triangular matrix:

[A]=[L][U],[A]=[L][U],

where in the Doolittle form [L][L] is unit lower-triangular (1's on the diagonal) and [U][U] is upper-triangular:

L=[100l2110l31l321],U=[u11u12u130u22u2300u33].L=\begin{bmatrix}1&0&0\\ l_{21}&1&0\\ l_{31}&l_{32}&1\end{bmatrix},\qquad U=\begin{bmatrix}u_{11}&u_{12}&u_{13}\\ 0&u_{22}&u_{23}\\ 0&0&u_{33}\end{bmatrix}.

The entries are found by equating [A]=[L][U][A]=[L][U] element by element (row of UU, then column of LL, alternately).

Solving [A]{x}={b}[A]\{x\}=\{b\}. Write [L][U]{x}={b}[L][U]\{x\}=\{b\} and set [U]{x}={y}[U]\{x\}=\{y\}. Then:

  1. Forward substitution solve [L]{y}={b}[L]\{y\}=\{b\} for {y}\{y\}.
  2. Back substitution solve [U]{x}={y}[U]\{x\}=\{y\} for {x}\{x\}.

Main advantage over Gauss elimination (multiple right-hand sides). The expensive part — factoring [A][A] into [L][U][L][U] — depends only on [A][A] and is done once (n3/3\sim n^3/3 operations). For each new right-hand-side vector {b}\{b\}, only the two cheap triangular solves (forward + back substitution, n2\sim n^2 operations each) are repeated. In contrast, plain Gauss elimination would redo the full O(n3)O(n^3) elimination for every new {b}\{b\}. Hence LU decomposition is far more efficient when [A]{x}={b}[A]\{x\}=\{b\} must be solved for several different {b}\{b\} (and it also gives detA=uii\det A=\prod u_{ii} and A1A^{-1} readily).

linear-systemslu-decomposition

Frequently asked questions

Where can I find the BE Computer Engineering (IOE, TU) Numerical Methods (IOE, SH 553) question paper 2078?
The full BE Computer Engineering (IOE, TU) Numerical Methods (IOE, SH 553) 2078 (regular) question paper is available free on Kekkei. You can read every question online and attempt the paper under timed exam conditions.
Does the Numerical Methods (IOE, SH 553) 2078 paper come with solutions?
Yes. Every question on this Numerical Methods (IOE, SH 553) past paper includes a step-by-step solution, plus instant AI feedback when you attempt it on Kekkei.
How many marks is the BE Computer Engineering (IOE, TU) Numerical Methods (IOE, SH 553) 2078 paper?
The BE Computer Engineering (IOE, TU) Numerical Methods (IOE, SH 553) 2078 paper carries 80 full marks and is meant to be completed in 180 minutes, across 12 questions.
Is practising this Numerical Methods (IOE, SH 553) past paper free?
Yes — reading and attempting this Numerical Methods (IOE, SH 553) past paper on Kekkei is completely free.