Docsity

NUMERICAL METHODS FOR ENGINEERS ORIGINAL PRACTICE PROBLEMS 50 PROBLEMS WITH DETAILED STEP, Exams of Nursing

Partial preview of the text

Download NUMERICAL METHODS FOR ENGINEERS ORIGINAL PRACTICE PROBLEMS 50 PROBLEMS WITH DETAILED STEP and more Exams Nursing in PDF only on Docsity!

NUMERICAL METHODS FOR ENGINEERS –

ORIGINAL PRACTICE PROBLEMS

50 PROBLEMS WITH DETAILED STEP-BY-STEP

SOLUTIONS

📊 TEXTBOOK OUTLINE – 8 PARTS

Part Topics Part 1 Modeling, Computers, and Error Analysis (Ch. 1-4) Part 2 Roots of Equations (Ch. 5-8) Part 3 Linear Algebraic Equations (Ch. 9-12)

Part Topics Part 4 Optimization (Ch. 13-16) Part 5 Curve Fitting (Ch. 17-20) Part 6 Numerical Differentiation and Integration (Ch. 21-24) Part 7 Ordinary Differential Equations (Ch. 25-28) Part 8 Partial Differential Equations (Ch. 29-32) SECTION 1: ERROR ANALYSIS & APPROXIMATIONS (Problems 1-6)

an approximation relative to the true value. The Taylor series with n terms approximates the function by truncating after the n-th term, and the error decreases as more terms are included. Problem 2. A number is rounded to 3 significant figures: x = 3.14159 → x_approx = 3.14. Calculate the approximate percent relative error. Solution: Step 1: Error

  • E_a = |3.14159 - 3.14| = 0. Step 2: Approximate percent relative error
  • ε_a = (0.00159 / 3.14) × 100 = 0.0506% Answer: ε_a = 0.0506% Rationale: The approximate percent relative error is used when the

true value is unknown. It is the relative error of the approximation to the approximated value itself. Problem 3. Determine the number of significant figures in the number 0.004050. Solution: Step 1: Significant figure rules

  • Leading zeros are not significant: 0.004050 has leading zeros (0.00)
  • Zeros between non-zero digits are significant: 4, 0, 5, 0
  • Trailing zeros after a decimal point are significant Step 2: Count significant figures
  • 0.004050 has 4 significant figures

Problem 5. Calculate the machine epsilon for a computer with a 23 - bit mantissa (single precision). Solution: Step 1: Machine epsilon

  • ε_mach = 2^(-n) where n = number of mantissa bits
  • ε_mach = 2^(-23) = 1.19 × 10^(-7) Answer: ε_mach = 1.19 × 10^(-7) Rationale: Machine epsilon is the smallest number that can be added to 1.0 and produce a different number. It represents the precision of floating-point arithmetic. Problem 6. The derivative of a function is approximated using a forward difference: f'(x) ≈ (f(x+h) - f(x))/h. Given f(x) = x², calculate the approximation error for h = 0.1 at x = 2.

Solution: Step 1: True derivative

  • f'(x) = 2x = 4 at x = 2 Step 2: Approximate derivative
  • f'(2) ≈ (f(2.1) - f(2))/0.1 = (4.41 - 4)/0.1 = 0.41/0.1 =

Step 3: Error

  • Error = 4.1 - 4 = 0.
  • Percent error = (0.1/4) × 100 = 2.5% Answer: Error = 0.1, Percent error = 2.5% Rationale: The forward difference approximation has truncation error O(h). As h decreases, the error decreases linearly.

Here the midpoint happened to be the exact root. In general, the method guarantees convergence but is slow. Problem 8. Use the bisection method to find the root of f(x) = x³

  • x - 2 = 0 on the interval [1, 2] for 2 iterations. Solution: Step 1: Initial values
    • a = 1, b = 2
    • f(1) = 1 - 1 - 2 = - 2; f(2) = 8 - 2 - 2 = 4 Step 2: Iteration 1
    • x_r = (1+2)/2 = 1.
    • f(1.5) = 3.375 - 1.5 - 2 = - 0.125 (negative)
    • New interval: a = 1.5, b = 2 Step 3: Iteration 2
  • x_r = (1.5+2)/2 = 1.
  • f(1.75) = 5.359 - 1.75 - 2 = 1.609 (positive)
  • New interval: a = 1.5, b = 1. Answer: After 2 iterations, root ≈ 1.75, interval [1.5, 1.75] Rationale: The bisection method is robust and always converges to a root when a sign change exists. The error is bounded by the interval length: |error| ≤ (b-a)/2^n. Problem 9. The false-position method (regula falsi) uses which formula to update the root estimate? Solution: Step 1: False-position formula
  • x_r = b - f(b) × (b-a)/(f(b)-f(a)) Answer: x_r = b - f(b) × (b-a)/(f(b)-f(a)) Rationale: The false-position method uses a linear interpolation

Step 3: Iteration 2

  • x_r = (0.5+1)/2 = 0.
  • f(0.75) = 0.75 - 0.7317 = 0.0183 (positive)
  • New interval: a = 0.5, b = 0. Step 4: Iteration 3
  • x_r = (0.5+0.75)/2 = 0.
  • f(0.625) = 0.625 - 0.8134 = - 0.1884 (negative)
  • New interval: a = 0.625, b = 0. Answer: After 3 iterations, root ≈ 0.625, interval [0.625, 0.75] Rationale: The equation x = cos(x) has a root near 0.739. The bisection method is converging slowly toward the true root. Problem 11. What is the main advantage of the bisection method compared to open methods?

Solution: Step 1: Key advantages

  • It is guaranteed to converge (if a sign change exists)
  • It is stable and robust
  • The error bound is known: |error| ≤ (b-a)/2^n Answer: Guaranteed convergence and known error bound Rationale: Unlike open methods (Newton-Raphson, secant), which can diverge if the initial guess is poor, the bisection method is guaranteed to converge to a root when a sign change is present. This makes it a safe starting method. Problem 12. A function f(x) has values f(0) = - 2 and f(4) = 6. Is there guaranteed to be a root between 0 and 4? Solution: Step 1: Intermediate Value Theorem

Step 1: Derivative

  • f'(x) = 2x Step 2: Iteration 1
  • x₁ = x₀ - f(x₀)/f'(x₀)
  • x₁ = 3 - (9-4)/6 = 3 - 5/6 = 2. Step 3: Iteration 2
  • x₂ = 2.1667 - (2.1667² - 4)/(2×2.1667)
  • x₂ = 2.1667 - (4.694 - 4)/4.333 = 2.1667 - 0.694/4. = 2.1667 - 0.1602 = 2. Answer: x ₁ = 2.1667, x ₂ = 2. Rationale: The Newton-Raphson method converges quadratically near the root. After 2 iterations, the approximation is very close to the true root (2.0).

Problem 14. The Newton-Raphson method is based on which mathematical principle? Solution: Step 1: Derivation

  • The method uses the tangent line approximation to the function
  • The root is found by extending the tangent to the x-axis Answer: It is based on the Taylor series expansion (first-order approximation) Rationale: The Newton-Raphson method is derived from the Taylor

series: f(x ₀ + h) ≈ f(x ₀ ) + h f'(x ₀ ). Setting this to 0 and solving

for h gives the Newton-Raphson update. Problem 15. Use the secant method to find the root of f(x) = x² - 4 = 0 starting from x₀ = 1 and x₁ = 4. Perform 2 iterations.

Answer: x ₂ = 1.6, x ₃ = 1. Rationale: The secant method uses a finite difference approximation to the derivative. It converges faster than bisection but is not guaranteed to converge. Problem 16. The Newton-Raphson method can fail when: Solution: Step 1: Failure conditions

  • The derivative f'(x) = 0 at the root (or near the root)
  • The initial guess is far from the root
  • The function has multiple roots or oscillations Answer: When f'(x) = 0 or the initial guess is poor Rationale: If f'(x) = 0, the tangent line is horizontal and does not cross the x-axis, causing the method to fail to converge. Poor initial guesses can lead to divergence.

Problem 17. Use the modified secant method (with perturbation δ = 0.01) to find the root of f(x) = x² - 4 = 0 starting from x₀ =

  1. Perform 1 iteration. Solution: Step 1: Modified secant formula
    • x_{i+1} = x_i - δ × x_i × f(x_i)/(f(x_i + δ×x_i) - f(x_i)) Step 2: Iteration
    • δ×x₀ = 0.01 × 3 = 0.
    • f(3) = 5
    • f(3.03) = 9.1809 - 4 = 5.
    • x₁ = 3 - 0.03 × 3 × 5/(5.1809 - 5) = 3 - 0.45/0.1809 = 3 - 2.487 = 0.