0% found this document useful (0 votes)
180 views2 pages

Numerical Methods: Sample Problems

The document presents sample problems and solutions related to numerical methods, including root-finding techniques like Bisection and Newton-Raphson, polynomial interpolation, numerical differentiation, integration methods, and solving ordinary differential equations. Each problem is detailed with methods, iterations, and results, showcasing the application of numerical techniques. The results include approximate values, errors, and comparisons with true values where applicable.

Uploaded by

Lopoe Miyao
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
180 views2 pages

Numerical Methods: Sample Problems

The document presents sample problems and solutions related to numerical methods, including root-finding techniques like Bisection and Newton-Raphson, polynomial interpolation, numerical differentiation, integration methods, and solving ordinary differential equations. Each problem is detailed with methods, iterations, and results, showcasing the application of numerical techniques. The results include approximate values, errors, and comparisons with true values where applicable.

Uploaded by

Lopoe Miyao
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Numerical Methods - Sample Problems with

Solutions

Problem 1: Root-Finding using Bisection


Find a root of f(x) = x^3 − 4x − 9 in the interval [2, 3] using the Bisection Method until the interval
half-width is less than 1e-5.
Approximate root ≈ 2.706528. Iterations: 16.
Iter a b c f(c) half-width
1 2.000000 3.000000 2.500000 -3.375000 5.000000e-01
2 2.500000 3.000000 2.750000 0.796875 2.500000e-01
3 2.500000 2.750000 2.625000 -1.412109 1.250000e-01
4 2.625000 2.750000 2.687500 -0.339111 6.250000e-02
5 2.687500 2.750000 2.718750 0.220917 3.125000e-02
6 2.687500 2.718750 2.703125 -0.061077 1.562500e-02

Problem 2: Root-Finding using Newton–Raphson


Solve cos(x) − x = 0 using Newton–Raphson starting at x■ = 0.5.
Approximate root ≈ 0.7390851332 (iterations: 4).
Iter x f(x)
0 0.5000000000 3.776e-01
1 0.7552224171 -2.710e-02
2 0.7391416661 -9.462e-05
3 0.7390851339 -1.181e-09
4 0.7390851332 0.000e+00

Problem 3: Polynomial Interpolation (Lagrange)


Given points (0,1), (1,2), (2,0), estimate f(1.5) using the Lagrange interpolation polynomial.
Estimated f(1.5) ≈ 1.375000.

Problem 4: Numerical Differentiation (Forward Difference)


Approximate f′(1) for f(x) = e^x using forward difference with h = 0.1.
Approx f′(1) ≈ 2.858842; True f′(1) = e ≈ 2.718282; Absolute error ≈ 1.41e-01.

Problem 5: Numerical Integration (Trapezoidal & Simpson’s)


Approximate I = ∫■^π sin(x) dx using (a) Trapezoidal rule with n=10 and (b) Simpson’s rule with
n=10.
Trapezoidal ≈ 1.98352354 (error ≈ 1.65e-02); Simpson’s ≈ 2.00010952 (error ≈ 1.10e-04).

Problem 6: Solving ODE y′ = −2y, y(0)=1 (Euler and RK4)


Compute y(1) using step size h = 0.5 with (a) Euler’s method and (b) Classical 4th-order
Runge–Kutta (RK4).
Euler y(1) ≈ 0.00000000; RK4 y(1) ≈ 0.14062500; True y(1) = e^(−2) ≈ 0.13533528.

Euler path:
x y
0.00 1.00000000
0.50 0.00000000
1.00 0.00000000

RK4 path:
x y
0.00 1.00000000
0.50 0.37500000
1.00 0.14062500

Common questions

Powered by AI

The Bisection Method ensures the approximation of a root within a specified interval by iteratively halving the interval and selecting the subinterval where the sign of the function changes. This is based on the Intermediate Value Theorem which states that if a continuous function changes sign over an interval, there must be a root in that interval. For f(x) = x^3 − 4x − 9 in the interval [2, 3], the method will compute midpoints and evaluate the function at these points until the interval is sufficiently small, in this case, less than 1e-5 .

Simpson's rule offers greater accuracy compared to the Trapezoidal rule by using quadratic polynomials to approximate the integrand rather than just linear segments. This results in higher precision because it better captures the curvature of the function being integrated. For ∫_0^π sin(x) dx, Simpson’s rule with n=10 gives an estimate of 2.00010952, with a much lower error (≈ 1.10e-04) than the Trapezoidal rule's estimate of 1.98352354 (error ≈ 1.65e-02).

The Lagrange Interpolation Polynomial method estimates function values between known data points by constructing a polynomial that passes exactly through each of the given points. For example, given the points (0,1), (1,2), (2,0), the Lagrange polynomial is used to estimate f(1.5) as 1.375000. This involves calculating Lagrange basis polynomials for each point and combining them to form the interpolation polynomial .

The Forward Difference method approximates the derivative of e^x at x=1 by calculating the difference quotient using a small step size, such as h=0.1. The approximation f′(1) ≈ 2.858842 is compared to the true derivative f′(1) = e ≈ 2.718282, resulting in an absolute error of approximately 1.41e-01. The difference highlights the Forward Difference method's reliance on the step size h for accuracy .

The Runge-Kutta methods, particularly the classical 4th-order Runge-Kutta (RK4), play a crucial role in solving differential equations by providing a balanced approach to accuracy and computational efficiency. RK4 increases accuracy by considering multiple slopes within a single step, essentially averaging them to predict more accurate future values. For the differential equation y′ = −2y with y(0)=1, using RK4 with a step size h=0.5 yields y(1) ≈ 0.14062500, closely aligning with the true solution y(1) = e^(−2) ≈ 0.13533528, showcasing its superior accuracy over methods like Euler’s .

The approximation at y(1) using Euler’s method deviates significantly from the true solution because Euler's method, being a first-order numerical technique, can accumulate significant local truncation errors over larger steps. In this case, using a step size h = 0.5, the approximation y(1) ≈ 0.00000000 is not accurate when compared to the true solution y(1) = e^(−2) ≈ 0.13533528. This discrepancy is due to the method's inability to efficiently handle the rapidly decaying exponential function with large time steps .

The Newton-Raphson method is considered more efficient than the Bisection Method due to its quadratic convergence rate, which typically requires fewer iterations to achieve a high degree of precision. It uses not only the function values but also the derivatives, allowing it to make more informed guesses about where the root lies. For instance, solving cos(x) − x = 0 starting at xI = 0.5 with Newton-Raphson converged in 4 iterations, demonstrating its efficiency in reaching the root 0.7390851332 .

Adjusting the interval size in the Bisection Method directly influences the accuracy of the root approximation. A smaller interval size results in a more precise approximation of the root since the method halves the interval with each iteration, targeting the sign change of the function. For f(x) = x^3 − 4x − 9, halving the interval until its width is less than 1e-5 ensures convergence toward the true root, achieving an approximate root of ≈ 2.706528 after 16 iterations .

The use of Lagrange basis polynomials in constructing interpolation polynomials allows for the exact reconstruction of a given set of function values at specified data points. Each basis polynomial is constructed so that it equals one at its corresponding data point and zero at all others, ensuring the interpolation polynomial precisely passes through all given points. This method provides flexibility and accuracy in estimating intermediate values, as demonstrated by estimating f(1.5) ≈ 1.375000 from points (0,1), (1,2), (2,0) using Lagrange interpolation .

The step size h significantly impacts the accuracy of the Forward Difference method in numerical differentiation. A smaller h generally leads to greater accuracy since it reduces the approximation error in the difference quotient. However, too small an h can cause numerical instability due to floating-point precision errors. In estimating f′(1) for f(x) = e^x with h = 0.1, the approximation of 2.858842 differs from the true value e ≈ 2.718282 with an absolute error of 1.41e-01, showing how the choice of h affects the result .

You might also like