NUMERICAL METHODS QUESTIONS (With detailed solutions)

Numerical Methods Questions

Numerical Methods Questions

Question 1
(a)

(i) Define 'error' and 'relative error' as applied in numerical methods.

(ii) The length and width of a rectangular sheet are 2.29m and 1.2m respectively. If the estimation of the length and width are 2.3m and 1m respectively. Evaluate the absolute and relative error of the products of the sides.

(b)

The region enclosed by the curve y = e^(-x/2), the axes, the line x = 3 and x = -3 is rotated completely about x-axis. Use Simpson's rule with 6 intervals to find an estimate volume of solid formed in terms of e and π.

(c)

Find the positive solution of the transcendental equation 2 sin x = x, using Newton-Raphson method with three iterations, starting with x₀ = 2.

Question 2
(a)

By using Newton-Raphson method find the root of x⁴ - x - 10 = 0 which is near to x = 2 correct to 5 decimal places.

(b)

State five applications of numerical methods.

Evaluate 0.10.5 e^(-x) dx using Simpson's rule with 5 ordinates.

Question 3
(a)

(i) Why do we need numerical methods? (state three reasons)

(ii) State three sources of errors in numerical computation.

(b)

Show that the equation eˣ = 3 - x has a root in the interval [0,1] also find the root correct to two decimal places in three iterations by using Newton-Raphson method.

Question 4
(a)

State four applications of Newton-Raphson method.

(b)

State 3 advantages and 3 disadvantages of Newton-Raphson method.

Question 5
(a)

The pressure P is calculated from the relation P = F/(Ï€R²), where F is the force and R is the radius. If the percentage possible errors are ±2% for F and ±1% for R. Calculate the possible percentage error for P.

(b)

Verify that the equation x² = 2x + 1 has the roots between x = 2 and x = 3 and hence apply the secant method in four iterations to obtain the approximation of the root correct to 3 decimal places.

(c)

Estimate the area of the quadrant of a circle of radius 8cm by dividing into 8 intervals by using Simpson's rule. Use the result obtained to approximate the value of π.

Question 6
(a)

The equation x³ - 3x - 20 = 0 has a single real root inside the interval [3,4]. Approximate the root in four iterations using the Secant formula.

(b)

(i) Explain with the aid of example why the two numerical methods, Trapezoidal rule and Simpson's rule are useful in evaluating definite integrals.

(ii) Using Numerical integration methods mentioned in part (b)(i) above and where the interval [0,1] is divided into four equal parts evaluate 01 (1 + x²)^(-1) dx correct to four decimal places.

Note: These questions cover various numerical methods including root-finding techniques (Newton-Raphson, Secant method), numerical integration (Simpson's rule, Trapezoidal rule), error analysis, and practical applications of numerical methods.
Numerical Methods - Complete Solutions

Numerical Methods Complete Solutions

Question 1

(a)(i) Define 'error' and 'relative error'

Error: The difference between the exact value and the approximate value.
Error = True Value - Approximate Value
Relative Error: The ratio of the absolute error to the absolute true value.
Relative Error = |Error| / |True Value|
Note: Relative error is often expressed as a percentage by multiplying by 100.

(a)(ii) Calculate absolute and relative error

Given: True length = 2.29m, Approximate length = 2.3m
True width = 1.2m, Approximate width = 1m
Calculate true area = 2.29 × 1.2 = 2.748 m²
Approximate area = 2.3 × 1 = 2.3 m²
Absolute error = |2.748 - 2.3| = 0.448 m²
Relative error = 0.448 / 2.748 ≈ 0.1630 (16.30%)
Final Answer: Absolute Error = 0.448 m², Relative Error ≈ 16.30%

(b) Volume using Simpson's rule

Given function: y = e^(-x/2), from x = -3 to x = 3
Number of intervals (n) = 6 → h = (3 - (-3))/6 = 1
Calculate y values at each point:
x-3-2-10123
ye^(1.5)e^1e^0.51e^-0.5e^-1e^-1.5
Apply Simpson's rule formula:
V = Ï€∫[f(x)]²dx ≈ (Ï€h/3)[y₀² + 4(y₁² + y₃² + y₅²) + 2(y₂² + y₄²) + y₆²]
Calculate each term:
V ≈ (Ï€/3)[e³ + 4(e² + e¹ + e⁻¹) + 2(e + e⁻¹) + e⁻³]
Final Answer: V ≈ (Ï€/3)[e³ + 4e² + 6e + 6e⁻¹ + 4e⁻² + e⁻³]

(c) Newton-Raphson for 2 sin x = x

Rewrite equation: f(x) = 2 sin x - x = 0
Derivative: f'(x) = 2 cos x - 1
Initial guess: x₀ = 2
Iteration 1:
f(2) = 2 sin(2) - 2 ≈ 2(0.9093) - 2 ≈ -0.1814
f'(2) = 2 cos(2) - 1 ≈ 2(-0.4161) - 1 ≈ -1.8322
x₁ = 2 - (-0.1814)/(-1.8322) ≈ 1.9010
Iteration 2:
f(1.9010) ≈ 2 sin(1.9010) - 1.9010 ≈ -0.0094
f'(1.9010) ≈ 2 cos(1.9010) - 1 ≈ -1.7062
x₂ = 1.9010 - (-0.0094)/(-1.7062) ≈ 1.8955
Iteration 3:
f(1.8955) ≈ 2 sin(1.8955) - 1.8955 ≈ -0.00003
f'(1.8955) ≈ 2 cos(1.8955) - 1 ≈ -1.6986
x₃ = 1.8955 - (-0.00003)/(-1.6986) ≈ 1.8955
Final Answer: The root is approximately 1.8955 after 3 iterations
Question 2

(a) Newton-Raphson for x⁴ - x - 10 = 0

Function: f(x) = x⁴ - x - 10
Derivative: f'(x) = 4x³ - 1
Initial guess: x₀ = 2
Iteration 1:
f(2) = 16 - 2 - 10 = 4
f'(2) = 32 - 1 = 31
x₁ = 2 - 4/31 ≈ 1.8710
Iteration 2:
f(1.8710) ≈ 1.8710⁴ - 1.8710 - 10 ≈ 0.3826
f'(1.8710) ≈ 4(1.8710)³ - 1 ≈ 24.1978
x₂ ≈ 1.8710 - 0.3826/24.1978 ≈ 1.8552
Continue iterations until convergence (5 decimal places):
x₃ ≈ 1.8552 - 0.0026/23.5430 ≈ 1.8551
x₄ ≈ 1.8551 - 0.00001/23.5356 ≈ 1.8551
Final Answer: The root is approximately 1.85510 correct to 5 decimal places

(b)(i) Five applications of numerical methods

  1. Solving engineering problems (structural analysis, fluid dynamics)
  2. Financial modeling and option pricing
  3. Computer graphics and animation
  4. Weather prediction and climate modeling
  5. Machine learning algorithms and optimization

(b)(ii) Simpson's rule for ∫e⁻Ë£dx from 0.1 to 0.5

Number of ordinates = 5 → n = 4 intervals, h = (0.5-0.1)/4 = 0.1
x0.10.20.30.40.5
y=e⁻Ë£0.90480.81870.74080.67030.6065
∫ ≈ (0.1/3)[0.9048 + 4(0.8187 + 0.6703) + 2(0.7408) + 0.6065]
≈ 0.0333[0.9048 + 5.9560 + 1.4816 + 0.6065] ≈ 0.0333 × 8.9489 ≈ 0.2983
Final Answer: The integral ≈ 0.2983
Key Takeaways: These solutions demonstrate fundamental numerical methods including error analysis, root-finding techniques (Newton-Raphson), and numerical integration (Simpson's rule). Each solution provides step-by-step calculations with intermediate results to help understand the methodology.
Question 3

(a)(i) Three reasons we need numerical methods:

  1. Many real-world problems cannot be solved analytically
  2. Provides approximate solutions when exact solutions are impossible
  3. Essential for computer simulations and modeling complex systems

(a)(ii) Three sources of errors in numerical computation:

  1. Truncation errors: From approximating infinite processes
  2. Round-off errors: Due to finite precision arithmetic
  3. Modeling errors: Inaccuracies in the mathematical model

(b) Newton-Raphson for eˣ = 3 - x

First, verify root exists in [0,1]:
f(0) = e⁰ - 3 + 0 = -2 (negative)
f(1) = e¹ - 3 + 1 ≈ 2.718 - 2 ≈ 0.718 (positive)
By Intermediate Value Theorem, root exists in [0,1]
Function: f(x) = eˣ + x - 3
Derivative: f'(x) = eˣ + 1
Initial guess: x₀ = 0.5 (midpoint)
Iteration 1:
f(0.5) ≈ 1.6487 + 0.5 - 3 ≈ -0.8513
f'(0.5) ≈ 1.6487 + 1 ≈ 2.6487
x₁ = 0.5 - (-0.8513)/2.6487 ≈ 0.8214
Iteration 2:
f(0.8214) ≈ 2.2736 + 0.8214 - 3 ≈ 0.0950
f'(0.8214) ≈ 2.2736 + 1 ≈ 3.2736
x₂ ≈ 0.8214 - 0.0950/3.2736 ≈ 0.7924
Iteration 3:
f(0.7924) ≈ 2.2089 + 0.7924 - 3 ≈ 0.0013
f'(0.7924) ≈ 2.2089 + 1 ≈ 3.2089
x₃ ≈ 0.7924 - 0.0013/3.2089 ≈ 0.7920
Final Answer: The root is approximately 0.79 (2 decimal places)
Question 4

(a) Four applications of Newton-Raphson method:

  1. Finding roots of polynomials and transcendental equations
  2. Optimization problems (finding maxima/minima)
  3. Computer graphics for inverse kinematics
  4. Machine learning for logistic regression

(b) Advantages and disadvantages of Newton-Raphson:

Advantages:
  1. Quadratic convergence when near the root
  2. Generally faster than bisection method
  3. Works well for both polynomials and transcendental equations
Disadvantages:
  1. Requires knowledge of the derivative
  2. May diverge if initial guess is poor
  3. Fails at inflection points or when derivative is zero
Question 5

(a) Percentage error calculation for P = F/(Ï€R²)

Given: ΔF/F = ±2% = ±0.02, ΔR/R = ±1% = ±0.01
Using error propagation formula:
ΔP/P ≈ √[(∂P/∂F × Î”F)² + (∂P/∂R × Î”R)²]/P
∂P/∂F = 1/(Ï€R²), ∂P/∂R = -2F/(Ï€R³)
ΔP/P ≈ √[(1 × 0.02)² + (-2 × 0.01)²] = √[0.0004 + 0.0004] ≈ √0.0008 ≈ 0.0283
Final Answer: Possible percentage error ≈ 2.83%

(b) Secant method for x² = 2x + 1 (root between 2 and 3)

Rewrite as f(x) = x² - 2x - 1 = 0
Initial points: x₀ = 2, x₁ = 3
Iteration 1:
f(2) = 4 - 4 - 1 = -1
f(3) = 9 - 6 - 1 = 2
x₂ = 3 - f(3)(3-2)/(f(3)-f(2)) = 3 - 2(1)/(2-(-1)) ≈ 2.3333
Iteration 2:
f(2.3333) ≈ -0.1111
x₃ = 2.3333 - (-0.1111)(2.3333-3)/(-0.1111-2) ≈ 2.3684
Iteration 3:
f(2.3684) ≈ -0.0050
x₄ = 2.3684 - (-0.0050)(2.3684-2.3333)/(-0.0050-(-0.1111)) ≈ 2.3696
Iteration 4:
f(2.3696) ≈ -0.0001
x₅ ≈ 2.3696 - (-0.0001)(2.3696-2.3684)/(-0.0001-(-0.0050)) ≈ 2.3696
Final Answer: The root is approximately 2.370 (3 decimal places)

(c) Area of quadrant using Simpson's rule (8 intervals)

Function: y = √(64 - x²), from x = 0 to 8
n = 8 → h = (8-0)/8 = 1
x012345678
y8√63√60√55√48√39√28√150
Area ≈ (1/3)[8 + 4(√63 + √55 + √39 + √15) + 2(√60 + √48 + √28) + 0]
≈ (1/3)[8 + 4(7.9373 + 7.4162 + 6.2450 + 3.8729) + 2(7.7460 + 6.9282 + 5.2915)]
≈ (1/3)[8 + 101.8886 + 39.9314] ≈ 49.94
Theoretical area = Ï€×8²/4 = 16Ï€ ≈ 50.2655
Approximation of Ï€ ≈ 49.94×4/64 ≈ 3.1213
Final Answer: Area ≈ 49.94, Ï€ ≈ 3.1213
Question 6

(a) Secant method for x³ - 3x - 20 = 0 (root in [3,4])

Initial points: x₀ = 3, x₁ = 4
Iteration 1:
f(3) = 27 - 9 - 20 = -2
f(4) = 64 - 12 - 20 = 32
x₂ = 4 - 32(4-3)/(32-(-2)) ≈ 3.0588
Iteration 2:
f(3.0588) ≈ -0.3906
x₃ ≈ 3.0588 - (-0.3906)(3.0588-4)/(-0.3906-32) ≈ 3.0686
Iteration 3:
f(3.0686) ≈ -0.0187
x₄ ≈ 3.0686 - (-0.0187)(3.0686-3.0588)/(-0.0187-(-0.3906)) ≈ 3.0691
Iteration 4:
f(3.0691) ≈ -0.0004
x₅ ≈ 3.0691 - (-0.0004)(3.0691-3.0686)/(-0.0004-(-0.0187)) ≈ 3.0691
Final Answer: The root is approximately 3.0691

(b)(i) Why Trapezoidal and Simpson's rules are useful:

These numerical integration methods are essential when:

  • The function cannot be integrated analytically
  • Only discrete data points are available
  • Quick approximations are needed for complex functions
Example: Calculating work done by a variable force where F(x) is known only at certain points

(b)(ii) Evaluate ∫(1+x²)⁻¹dx from 0 to 1 using both methods (4 intervals)

h = (1-0)/4 = 0.25
x00.250.50.751
y=1/(1+x²)10.94120.80.640.5
Trapezoidal Rule:
∫ ≈ (0.25/2)[1 + 2(0.9412 + 0.8 + 0.64) + 0.5] ≈ 0.125[1 + 4.7624 + 0.5] ≈ 0.7828
Simpson's Rule:
∫ ≈ (0.25/3)[1 + 4(0.9412 + 0.64) + 2(0.8) + 0.5] ≈ 0.0833[1 + 6.3248 + 1.6 + 0.5] ≈ 0.7854
Exact value = arctan(1) = Ï€/4 ≈ 0.7854
Final Answers:
Trapezoidal ≈ 0.7828
Simpson's ≈ 0.7854 (more accurate)
Conclusion: These numerical methods provide powerful tools for solving problems that are intractable analytically. The solutions demonstrate how different methods (Newton-Raphson, Secant, Trapezoidal, Simpson's) can be applied to various types of problems, with trade-offs between computational complexity and accuracy.

No comments

Post a Comment

© all rights reserved
made with by templateszoo