Newton-Raphson for Systems of Equations | Numerical Methods Lab
Numerical Methods - Newton-Raphson Method for Systems

Lab 2: Newton-Raphson Method for Systems of Non-linear Equations

Lab 2: Solution of Systems of Non-linear Equations using Newton-Raphson Method

Experiment Information

Experiment: Solution of Systems of Non-linear equations using Newton-Raphson method

Course Code: Numerical Methods

Description: Complete lab report covering theory, algorithm, Python implementation and analysis of Newton-Raphson method for systems

Complete Lab Report PDF

1. Theory of Newton-Raphson Method for Systems

1.1 Mathematical derivation for systems

1.2 Jacobian matrix formulation

1.3 Convergence criteria for systems

2. Algorithm

2.1 Step-by-step procedure for systems

2.2 Matrix operations involved

2.3 Stopping criteria

3. Implementation

3.1 Python code with numpy

3.2 Input/output specifications

3.3 Comparison with single equation method

4. Observations

4.1 Data recording table

4.2 Sample calculations

4.3 Convergence behavior

5. Results

5.1 Solution approximation

5.2 Convergence rate

5.3 Error analysis

6. Discussion

6.1 Advantages and limitations

6.2 Comparison with other methods

6.3 Applications in engineering problems

Python Implementation of Newton-Raphson Method for Systems

newton_raphson_system.py
import numpy as np

def f(x):
    return np.array([x[0]**2 - x[1]**2 - 5,
                    x[0]**2 + x[1]**2 - 25])

def j(x):
    return np.array([[2*x[0], -2*x[1]],
                   [2*x[0], 2*x[1]])

x = np.array([4.0, 3.0])  # Initial guess
tol = 50e-5  # Tolerance
count = 0
max_iter = 100  # Maximum iterations

while True:
    count += 1
    if count > max_iter:
        raise Exception("Maximum iterations reached without convergence")
    
    # Calculate Jacobian and function value
    A = j(x)
    B = -f(x)
    
    # Solve the linear system
    try:
        H = np.linalg.solve(A, B)
    except np.linalg.LinAlgError:
        print("Singular Jacobian matrix encountered")
        break
        
    # Update solution
    x += H
    
    # Calculate error
    err = max(abs(H))
    if err < tol:
        break

print(f"Solution found in {count} iterations:")
print(f"x1 = {x[0]:.6f}, x2 = {x[1]:.6f}")
        
×

Disclaimer

The educational materials provided on this website are intended as supplementary resources to support your learning journey. These lab reports are sample documents designed to help students understand proper formatting and content organization.

We have made every effort to ensure the accuracy of the content. However, we recommend students to perform their own experiments and prepare original reports. These samples should be used as references only.

We respect intellectual property rights. If you believe any content should be credited differently or removed, please don't hesitate to contact us. We're happy to make appropriate corrections or give proper attribution.

Leave a Comment

Scroll to Top