2075

CSC212 · TU past paper

Numerical Method 2075 question paper

The complete TU 2075 exam paper for Numerical Method (CSC212), all 12 questions with solved model answers written to the mark scheme.

Tap a question to open its answer.

  1. 110 marksNumericalSecant method and ConvergenceAnswer

    What is non-linear equation? Derive the required expression to calculate the root of non-linear equation using secant method. Using this expression find a root of following equation.

    $$x^2 + \cos(x) - e^{-x} - 2 = 0$$

    [10]

    Non-Linear Equations and the Secant Method

    1. Non-Linear Equation

    A non-linear equation is an equation $f(x)=0$ in which the unknown appears in a degree higher than one, or inside transcendental functions (trigonometric, exponential, logarithmic). Its graph is not a straight line, and it generally cannot be solved by direct algebraic manipulation, so iterative numerical methods are used.

    Examples: $x^2+\cos x-e^{-x}-2=0$, $x^3-4x+1=0$, $e^x-3x=0$.

    2. Derivation of the Secant Method

    Start from the Newton-Raphson formula:

    $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$$

    The Secant method replaces the analytic derivative with a finite-difference approximation using two known points:

    $$f'(x_n)\approx\frac{f(x_n)-f(x_{n-1})}{x_n-x_{n-1}}$$

    Substituting:

    $$\boxed{x_{n+1}=x_n-\frac{f(x_n),(x_n-x_{n-1})}{f(x_n)-f(x_{n-1})}}$$

    This needs two initial guesses $x_0,,x_1$.

    3. Numerical Solution

    $$f(x)=x^2+\cos x-e^{-x}-2$$

    (radian mode)

    Bracketing:

    $x$$f(x)$
    1$1+0.5403-0.3679-2=-0.8276$
    2$4-0.4161-0.1353-2=+1.4486$

    Root lies in $(1,2)$. Take $x_0=1,\ x_1=2$.

    Iteration 1

    $$x_2=2-\frac{1.4486(2-1)}{1.4486-(-0.8276)}=2-\frac{1.4486}{2.2762}=2-0.6364=1.3636$$

    $$f(1.3636)=1.8594+0.2050-0.2557-2$$

    Check $\cos(1.3636)=0.2064$ (radians), $e^{-1.3636}=0.2557$, $(1.3636)^2=1.8594$: $$f(1.3636)=1.8594+0.2064-0.2557-2=-0.1899$$

    Iteration 2

    $$x_3=1.3636-\frac{(-0.1899)(1.3636-2)}{-0.1899-1.4486}$$ $$=1.3636-\frac{(-0.1899)(-0.6364)}{-1.6385}=1.3636-\frac{0.1209}{-1.6385}$$ $$=1.3636+0.0738=1.4374$$

    $$f(1.4374)=2.0661+\cos(1.4374)-e^{-1.4374}-2$$ $\cos(1.4374)=0.1330,\ e^{-1.4374}=0.2375$ $$=2.0661+0.1330-0.2375-2=-0.0384$$

    Iteration 3

    $$x_4=1.4374-\frac{(-0.0384)(1.4374-1.3636)}{-0.0384-(-0.1899)}$$ $$=1.4374-\frac{(-0.0384)(0.0738)}{0.1515}=1.4374-\frac{-0.002834}{0.1515}$$ $$=1.4374+0.0187=1.4561$$

    $$f(1.4561)=2.1202+\cos(1.4561)-e^{-1.4561}-2$$ $\cos(1.4561)=0.1145,\ e^{-1.4561}=0.2331$ $$=2.1202+0.1145-0.2331-2=+0.0016$$

    Iteration 4

    $$x_5=1.4561-\frac{(0.0016)(1.4561-1.4374)}{0.0016-(-0.0384)}$$ $$=1.4561-\frac{0.0016\times0.0187}{0.0400}=1.4561-0.00075=1.4553$$

    $f(1.4553)\approx 0.0000$.

    Result

    $$\boxed{x\approx 1.4553}$$

    Watch the trigonometry: $\cos(1.3636) \approx 0.2064$, not $0.2190$, so $f(1.3636) \approx -0.19$ rather than $-0.1773$. The slip does not move the converged root, which stays at $\approx 1.455$.

  2. 210 marksNumericalMatrix factorization and Solving System ofAnswer

    Matrix Factorization and LU Decomposition

    Matrix factorization (decomposition) means expressing a matrix $A$ as a product of two or more matrices. In LU decomposition, $A = LU$, where $L$ is lower triangular and $U$ is upper triangular. The Doolittle method fixes the diagonal of...

  3. 310 marksShooting method and its algorithmAnswer

    What is initial value problem and boundary value problem? Write an algorithm and program to solve the boundary value problem using shooting method.[10]

    An Initial Value Problem is a differential equation in which all the conditions (values of the dependent variable and its derivatives) are specified at a single point (the initial point). General Form: Here, the value of y is known at x ...

  4. 45 marksNumericalNewton's method and ConvergenceAnswer

    Calculate a real negative root of following equation using Newton’s method for polynomial. $x^4 + 2x^3 + 3x^2 + 4x = 5$. [5]

    Equation: $$x^4 + 2x^3 + 3x^2 + 4x = 5$$ Rearranged: $$f(x) = x^4 + 2x^3 + 3x^2 + 4x - 5 = 0$$ $$x{n+1} = xn - \frac{f(xn)}{f'(xn)}, \qquad f'(x) = 4x^3 + 6x^2 + 6x + 4$$ $$f(-1) = 1 - 2 + 3 - 4 - 5 = -7 ;(<0)$$ $$f(-2) = 16 - 16 + 12 -...

  5. 55 marksLeast squares methodAnswer

    What is least squares approximation of fitting a function? How does it differ with polynomial interpolation? Explain with suitable example. [5]

    Least squares approximation is a method of fitting a function (usually a polynomial) to a set of data points such that the sum of the squares of the errors (residuals) between the actual data values and the approximated function values i...

  6. 65 marksNumericalLagrange's InterpolationAnswer

    Find the lowest degree polynomial, which passes through the following points. Using this polynomial estimate f(x) at x = 0.

    $$\begin{array}{c|cccccc} X & -2 & -1 & 1 & 2 & 3 & 4 \ \hline F(x) & -19 & 0 & 2 & -3 & -4 & 5 \end{array}$$

    [5]

    X -2 -1 1 2 3 4 ----------------------- F(x) -19 0 2 -3 -4 5 Find the lowest degree polynomial through these 6 points, then estimate $f(0)$. Using Newton's Divided Difference Interpolation. First differences: $$f[x0,x1]=\frac{0-(-19)}{-1...

  7. 75 marksNumericalLinear RegressionAnswer

    The fit function of type $y = a + bx$ for the following points using the least square method.

    $$\begin{array}{c|cccccc} X & -1 & 1.2 & 2 & 2.7 & 3.6 & 4 \ \hline F(x) & 1 & 20 & 27 & 33 & 41 & 45 \end{array}$$

    [5]

    X -1 1.2 2 2.7 3.6 4 --------------------------- F(x) 1 20 27 33 41 45 Number of points: $n = 6$ Normal equations for $y = a + bx$: $$\sum y = na + b\sum x$$ $$\sum xy = a\sum x + b\sum x^2$$ x y x² xy --------------------------- -1 1 1....

  8. 85 marksNumericalSimpson's 1/3 ruleAnswer

    Calculate the integral value of the function given below from $x = 1.8$ to $x = 3.4$ using Simpson's 1/3 rule.

    $$\begin{array}{c|cccccccc} x & 1.8 & 2.0 & 2.2 & 2.4 & 2.6 & 2.8 & 3.0 & 3.4 \ \hline f(x) & 0.003 & 0.778 & 1.632 & 2.566 & 3.579 & 4.672 & 7.097 & 8.429 \end{array}$$

    [5]

    X 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.4 -------------------------------------------------------------- F(x) 0.003 0.778 1.632 2.566 3.579 4.672 7.097 8.429 Limits: $x = 1.8$ to $x = 3.4$ Spacing check: - 1.8 to 3.0: step $h = 0.2$ (equally spa...

  9. 95 marksNumericalRomberg integrationAnswer

    Evaluate the following integration using Romberg integration. $$\int_{0}^{1} \frac{\sin x}{x} dx$$ [5]

    • Integrand: $f(x) = \dfrac{\sin x}{x}$ - Limits: $a = 0$, $b = 1$ - Special value at $x=0$: $\lim{x\to 0}\dfrac{\sin x}{x} = 1$, so $f(0)=1$ - Method: Romberg integration - Interval width: $b-a = 1$ I compute the required function value...
  10. 105 marksNumericalGauss-Seidal MethodAnswer

    Solve the following set of equations using Gauss Seidel method.

    $$ \begin{aligned} x + 2y + 3z &= 4 \ 6x - 4y + 5z &= 10 \ 5x + 2y + 2z &= 25 \end{aligned} $$

    [5]

    System of equations: $$x + 2y + 3z = 4 \quad \cdots (1)$$ $$6x - 4y + 5z = 10 \quad \cdots (2)$$ $$5x + 2y + 2z = 25 \quad \cdots (3)$$ Initial guess (standard): $x^{(0)} = y^{(0)} = z^{(0)} = 0$. To apply Gauss-Seidel we solve equation ...

  11. 115 marksNumericalRunge-Kutta methodsAnswer

    From the following differential equation estimate y(1) using RK 4th order method.

    $$\frac{dy}{dx} + 2x^2y = 4 \quad \text{with} \quad y(0) = 1$$

    [Take $h = 0.5$] [5]

    • ODE: $\dfrac{dy}{dx} + 2x^2 y = 4 \Rightarrow \dfrac{dy}{dx} = 4 - 2x^2 y = f(x,y)$ - Initial condition: $x0 = 0,\ y0 = 1$ - Step size: $h = 0.5$ - Target: $y(1)$ → requires 2 steps ($0 \to 0.5 \to 1.0$) RK4 formulas: $$y{n+1} = yn + ...
  12. 125 marksNumericalLaplacian equation and Poisson's equationAnswer

    Solve the Poisson's equation over the square domain $0 \leq x \leq 1.5$, $0 \leq y \leq 1.5$ with $f = 0$ on the boundary and $h = 0.5$. [5]

    • Domain: $0 \le x \le 1.5$, $0 \le y \le 1.5$ - Boundary condition: $f = 0$ on all boundaries - Step size: $h = 0.5$ - Poisson equation right-hand side: NOT LEGIBLE in the question. The function $f$ (source term) appears garbled. This s...