Numerical MethodUnit 212 min read
Solving Non-linear Equations: Methods, Errors & Applications
Unit 2 of Numerical Method covers iterative methods (bisection, secant, Newton-Raphson), error analysis, convergence criteria, and real-world applications like root-finding in engineering, finance, and optimization problems.
TAKEAWAYS:
- Non-linear equations cannot be solved algebraically in many cases, requiring numerical methods like bisection, secant, or Newton-Raphson.
- Error analysis (true error, relative error) measures how close an approximation is to the exact solution.
- Convergence depends on initial guesses, method choice, and the function’s behavior (e.g., continuity, differentiability).
- Iterative methods (Jacobi, Gauss-Seidel) solve systems of non-linear equations by successive approximation.
- Real-world applications include financial modeling (loan interest rates), traffic optimization (route planning), and engineering design (structural stability).
- Exam focus: Derive methods, apply them step-by-step, and compare advantages/disadvantages of each technique.
1. Introduction to Non-linear Equations
Non-linear equations are equations where the variable appears in a non-linear form (e.g., , , ). Examples include:
- (polynomial)
- (transcendental)
- (trigonometric)
These cannot always be solved analytically, so numerical methods are used to approximate roots.
Key Concepts
- Root: A value such that .
- Initial guess: Starting point for iterative methods (e.g., ).
- Iteration: Repeated application of a formula to refine the guess.
2. Error Analysis
To measure how close an approximation is to the exact root , we define:
True Error (Absolute Error): Problem: We don’t know in practice, so we estimate it.
Relative Error: Use case: Comparing errors across different scales (e.g., vs. ).
Approximate Error: Since is unknown, we use: Example: If and , the approximate error is .
3. Methods for Solving Non-linear Equations
We focus on iterative methods, which refine guesses until convergence.
A. Bisection Method
How it works:
- Find two points and such that and have opposite signs (Intermediate Value Theorem guarantees a root in ).
- Compute the midpoint .
- Check :
- If , is the root.
- If , the root lies in . Set .
- Else, the root lies in . Set .
- Repeat until .
Advantages:
- Guaranteed to converge if is continuous.
- Easy to implement.
Disadvantages:
- Slow convergence (linear rate: ).
Example 1: Solve with , (tolerance ) Final approximation: (after 10 iterations).
Real-world tie-in:
- Loan interest calculation: Banks use root-finding to determine monthly payments where the net present value of payments equals the loan amount. The bisection method ensures stability in financial models.
B. Secant Method
How it works:
- Uses two initial guesses and to approximate the root.
- Formula: (A secant line replaces the tangent line in Newton-Raphson.)
Advantages:
- Faster convergence than bisection (superlinear rate).
- No need for derivatives.
Disadvantages:
- May diverge if initial guesses are poor.
Example 2: Solve with ,
Iteration | \(x_n\) | \(f(x_n)\) | \(x_{n+1}\)
--- | --- | --- | ---
0 | 4 | 2 | -
1 | 2 | -10 | \(x_2 = 2 - (-10)(4-2)/(2-(-10)) = 2.571\)
2 | 2.571 | -1.64 | \(x_3 = 2.571 - (-1.64)(2.571-2)/(-1.64-2) = 3.449\)
3 | 3.449 | 1.34 | \(x_4 = 3.449 - (1.34)(3.449-2.571)/(1.34-(-1.64)) = 3.245\)
... (converges to \(x \approx 5.0\))
Real-world tie-in:
- Traffic route optimization: Pathao uses root-finding to estimate optimal delivery routes where the cost function (time + fuel) is non-linear. The secant method balances speed and accuracy in real-time adjustments.
C. Newton-Raphson Method
How it works:
- Uses the tangent line at to approximate the root:
- Requires to be differentiable.
Advantages:
- Fast convergence (quadratic rate: ).
Disadvantages:
- May diverge if or initial guess is poor.
Example 3: Solve with
Iteration | \(x_n\) | \(f(x_n)\) | \(f'(x_n)\) | \(x_{n+1}\)
--- | --- | --- | --- | ---
0 | 2 | -1 | 8 | \(2 - (-1)/8 = 2.125\)
1 | 2.125 | 0.023 | 9.023 | \(2.125 - 0.023/9.023 = 2.102\)
2 | 2.102 | 0.000 | 8.412 | \(2.102 - 0.000/8.412 = 2.102\)
Real-world tie-in:
- Stock price modeling (NEPSE): Analysts use Newton-Raphson to fit non-linear models to stock trends. For example, predicting the root of a profit function where helps determine break-even points.
D. Fixed-Point Iteration
How it works: Rewrite as . Iterate: Convergence condition: near the root.
Example 4: Solve Rewrite as (Taylor series). Start with :
Iteration | \(x_n\)
--- | ---
0 | 0.5
1 | 0.875
2 | 0.645
3 | 0.782
4 | 0.718
... (converges to \(x \approx 0.739\))
Real-world tie-in:
- Khalti transaction fees: The effective fee after discounts can be modeled as , where accounts for dynamic pricing. Fixed-point iteration helps stabilize fee calculations.
4. Comparison of Methods
| Method | Convergence Rate | Needs Derivative? | Initial Guess Sensitivity | Guaranteed Convergence? |
|---|---|---|---|---|
| Bisection | Linear () | No | Low | Yes (if continuous) |
| Secant | Superlinear | No | Medium | No |
| Newton-Raphson | Quadratic () | Yes | High | No |
| Fixed-Point | Depends on | No | Medium | No |
5. Systems of Non-linear Equations: Jacobi and Gauss-Seidel Methods
For systems like: we rearrange to:
A. Jacobi Method
Update all variables simultaneously:
B. Gauss-Seidel Method
Update variables sequentially (using latest values):
Example 5: Solve the system Rearrange: Initial guess: .
Jacobi Iteration 1:
Gauss-Seidel Iteration 1:
Convergence: Gauss-Seidel typically converges faster because it uses updated values.
flowchart TD
A["System of Equations"] --> B["Rearrange to \(x = g_1\), \(y = g_2\), \(z = g_3\)"]
B --> C["Jacobi: Update all variables simultaneously"]
B --> D["Gauss-Seidel: Update sequentially"]
C --> E["Slower convergence"]
D --> F["Faster convergence"]Real-world tie-in:
- Daraz order processing: When a user places multiple items in a cart, the system solves a non-linear equation to balance inventory, shipping costs, and delivery times. Jacobi/Gauss-Seidel methods help optimize order fulfillment queues in real time.
6. Convergence Criteria
For a method to converge:
- Fixed-point iteration: near the root.
- Newton-Raphson: and initial guess close to root.
- Bisection/Secant: Function must be continuous and bracket the root.
Stopping criteria:
- (e.g., ).
- Maximum iterations reached.
7. In the Real World
eSewa (Nepal):
- Application: Calculating dynamic electricity bills where the cost function is non-linear (e.g., ).
- Method: Newton-Raphson is used to solve for the exact usage when the bill amount is known but the usage is non-linear.
Ncell Network Optimization:
- Application: Adjusting signal towers to maximize coverage while minimizing interference. The signal strength depends on non-linear factors like distance and obstacles:
- Method: Secant method approximates optimal tower placements where .
NEPSE Stock Analysis:
- Application: Predicting the break-even point for a stock where the profit function is: Here, is demand (non-linear) and is cost.
- Method: Bisection method ensures stable convergence even with volatile data.
8. Exam Tip
Derivations are key:
- For bisection, secant, or Newton-Raphson, show every step of the formula derivation. Examiners check if you understand the underlying logic.
- Example: For Newton-Raphson, start from and use the tangent line approximation.
Iteration tables:
- Always present iterations in a clear table with columns for , , and . Partial credit is lost if steps are messy.
Error analysis:
- Questions often ask for true error or relative error. Practice calculating these after each iteration.
Method comparison:
- Be ready to contrast Jacobi and Gauss-Seidel in terms of speed, memory, and convergence. Use the table above as a reference.
Real-world connections:
- Link numerical methods to Nepali contexts (e.g., Khalti fees, Daraz logistics, NTC billing). Examiners appreciate practical ties.
Graphs:
- Always sketch the function and highlight the root-finding process (e.g., bisection intervals, secant lines). Visuals add marks.
9. Worked Exam-Style Questions
Question 1: Bisection Method
Solve with , (tolerance ).
Solution:
- Check signs: , → root in .
- Iterations:
Iter | a | b | c = (a+b)/2 | f(c) --- | --- | --- | --- | --- 1 | 1 | 2 | 1.5 | -0.875 2 | 1.5 | 2 | 1.75 | 1.703 3 | 1.5 | 1.75 | 1.625 | 0.406 4 | 1.5 | 1.625 | 1.5625 | -0.230 5 | 1.5625 | 1.625 | 1.59375 | 0.091 6 | 1.5625 | 1.59375 | 1.578125 | -0.069 - Final approximation: (since , continue to ).
Question 2: Newton-Raphson
Solve with .
Solution:
- Derivative: .
- Iterations:
Iter | \(x_n\) | \(f(x_n)\) | \(f'(x_n)\) | \(x_{n+1}\) --- | --- | --- | --- | --- 0 | 1 | -1.718 | -2 | 1.859 1 | 1.859 | 0.002 | -1.145 | 1.859 - Root: .
Question 3: Jacobi vs. Gauss-Seidel
Solve: using both methods (3 iterations).
Solution: Rearrange:
Jacobi Iterations:
Iter | x | y | z
--- | --- | --- | ---
0 | 0 | 0 | 0
1 | 1.2 | 1.3 | 1.4
2 | 0.89 | 0.98 | 0.94
3 | 0.953 | 0.976 | 0.982
Gauss-Seidel Iterations:
Iter | x | y | z
--- | --- | --- | ---
0 | 0 | 0 | 0
1 | 1.2 | 1.06 | 0.972
2 | 0.9828 | 0.9856 | 0.9914
3 | 0.995 | 0.997 | 0.998
Observation: Gauss-Seidel converges faster.
flowchart LR
A["Initial Guess (0,0,0)"] --> B["Jacobi: Update all at once"]
A --> C["Gauss-Seidel: Update sequentially"]
B --> D["Slower convergence"]
C --> E["Faster convergence"]Based on the TU BIT syllabus for Numerical Method (BIT203), unit 2.
Discussion
Loading…