Project

Breaking Ice with Air Cushion using Vehicle - Find minimum pressure with Newton-Raphson Method

Aim: To write a code using Python as a scripting language to compute for the minimum value of Pressure using the Newton-Raphson method.

Here, p denotes the cushion pressure, h denotes the thickness of the ice field , r is the size of the air cushion, σ is the tensile strength of the ice and β is related to the width of the ice wedge.

Take, β = 0.5, r = 40 feet and σ = 150 pounds per square inch(psi).

Objective of the project:

1. Use the Newton Raphson method to find out the value of pressure for h=0.6 ft.

2. Find the optimal relaxation factor for this problem statement with the help of a suitable plot

3. Tabulate the results of p for h= [0.6,1.2,1.8,2.4,3,3.6,4.2] assuming a suitable relaxation factor.

Introduction:

A hovercraft, also known as an aircushion vehicle or ACV, is an amphibious craft which can travel across the land, water, mud, ice and other surfaces.

Hovercraft uses blowers to produce a large volume of air that is marginally above atmospheric pressure beneath the hull or air cushion. The density differential between the air beneath the hull higher pressure and the atmospheric air above it lower pressure ambient air above it produces lift, which causes the hull to float above the running surface. For, stability reasons, the air is usually brown through slots or holes around the outside of a disk or oval-shaped platform, giving most hovercraft a characteristic rounded-rectangle shape. Typically, this cushion is contained within a flexible 'skirt', which will allow the vehicle to travel over obstructions without damage.

CONCISE DESCRIPTION OF NEWTON-RAPHSON's METHOD-

This method is named after Sir Isaac Newton and Sir Joseph Raphson. This method is a root-finding algorithm, which produces successively better approximations to the roots of a real-valued function. The most basic version starts with a single variable function 'f', and an initial guess x0 for a root of 'f'. If the function satisfies sufficient assumptions and the initial guess is close then;

`x₁=x₀-(f(x^0))/(f'(x^0))`

which is a better approximation of the root than `x₀`, Geometrically, (x1,0) is the intersection of the x-axis and the tangent of the graph of f at (x0,f(x0)): that is, improved guess, which is the unique root of the linear approximation at the initial point. The process is repeated as

`xₙ₊₁=xₙ-(f(xₙ))/(f'(xₙ))` until a sufficiently precise value is reached.

Below is the picture showing the working of the Newton-Raphson Method.

CODE:

# Breaking Ice with Air cushion Vehicle - Find minimum pressure with Newton-Raphson method
# To find out the value of pressure h=0.6 feet
# Also to find out the Optimal Relaxation factor with the help of a suitable graph


from matplotlib.pyplot import *  # importing modules/libraries
from math import *
from numpy import *
from scipy import *


def f(p, b, h, s, r):
    t1 = pow(p, 3) * (1 - pow(b, 2))
    t2 = ((0.4 * h * pow(b, 2)) - (s * pow(h, 2)) / (pow(r, 2))) * (pow(p, 2))
    t3 = (pow(s, 2) * pow(h, 4) * p) / (3 * pow(r, 4))
    t4 = pow(((pow(h, 2) * s) / (3 * pow(r, 2))), 3)
    return t1 + t2 + t3 - t4


def fprime(p, b, h, s, r):
    dt1 = 3 * pow(p, 2) * (1 - pow(b, 2))
    dt2 = ((0.4 * h * pow(b, 2)) - (s * pow(h, 2)) / pow(r, 2)) * pow(p, 1) * 2
    dt3 = (pow(s, 2) * pow(h, 4)) / (3 * pow(r, 4))
    return dt1 + dt2 + dt3


# Performing newton iterations to Find the optimal relaxation factor for this problem with the help of a suitable plot.
# Case 1: To find out the value of pressure for h = 0.6 ft and
# Case 2: To Find the optimal relaxation factor for this problem with the help of a suitable plot
tol = 1e-4
alpha_list = linspace(0, 2, 200)
alphas = []

arr = []
for alpha in alpha_list:
    # inputs for the formula
    limit = 1000
    p_guess = 30
    b = 0.5                 #width of the ice wedge
    h = 0.6                 #thickness of the ice field  
    h = 0.6               
    s = 150 * 144           #tensile strenght of the ice(to convert psi to psf we need to multiply with 144)
    r = 40                  #size of the air cushion
    i = 0
    # Newton Raphson Method
    while (abs(f(p_guess, b, h, s, r)) > tol):
        p_guess = p_guess - alpha * (f(p_guess, b, h, s, r) / fprime(p_guess, b, h, s, r))
        i += 1
        if limit < i:
            arr.append(i)
            alphas.append(alpha)
            break

    alphas.append(alpha)
    arr.append(i)
print(f"\n\n\nCase 1: The value of pressure for h = 0.6 ft is: {p_guess} when alpha is : {alpha}")
print(f"\nCase 2: The optimal relaxation factor is {alphas[arr.index(min(arr))]} with {min(arr)} iterations.\n\n")

# Plotting alpha vs iteration graph
figure(1)
plot(alphas, arr)
xlabel('Relaxation Factor (alpha)')
ylabel('Number of iterations')
title('Optimal Relaxation Factor')
show()

# Case 3: Performing newton iterations to Tabulate the results of p for h = [0.6,1.2,1.8,2.4,3,3.6,4.2]
# assuming a suitable relaxation factor.

h_list = [0.6, 1.2, 1.8, 2.4, 3, 3.6, 4.2]
p_list = []
arr = []
for h in h_list:
    alpha = 1.226
    limit = 1000
    p_guess = 30
    b = 0.5
    s = 150 * 144
    r = 40
    i = 0
    tol = 1e-4
    # Newton Raphson Method
    while (abs(f(p_guess, b, h, s, r)) > tol):
        p_guess = p_guess - alpha * (f(p_guess, b, h, s, r) / fprime(p_guess, b, h, s, r))
        i += 1
    arr.append(i)
    p_list.append(p_guess)

# Plotting thickness vs Cushion pressure
figure(2)
plot(h_list, p_list)
xlabel('Thickness of the ice field (feet)')
ylabel('Cushion pressure(Pounds per square feet)')
title('Thickness vs Cushion Pressure')
show()
print('Case 3:\n')
print('Thickness of the ice field     Cushion Pressure')

for j in range(len(h_list)):
    print(f'          {h_list[j]}                      {p_list[j].__round__(4)}')

PROCEDURE TO SOLVE:

1. Converting all the units in the equation to feet i.e for converting psi to psf we need to multiply by 144.

2. Breaking down the given function so that it would be easier to code and also, differentiate the given function.

3. Writing the code for Newton Raphson method.

4. Assuming alpha and initial guess

5. Writing the code for plotting the graph of alpha vs iterations

6. Writing the code for tabulating the results of p for h.

EXPLANATION OF THE CODE:

1. Import all the necessary modules to solve the solution.

2. Define a function to find the value of f(xn)

3. Define a function for a differentiable function f(x)

4. Case 1- To find out the value of pressure for h=0.6 ft

Define all the input parameters and assume alpha and also guess the initial root. Write a code for Newton Raphson method using a while loop and thereafter calculate the value of the pressure.

5. Case 2 - To find the optimal relaxation factor for this problem with the help of a suitable plot.

Assume appropriate list of alpha values and other parameters are kept as constants. Use a for loop to solve Newton Raphson method for each value of alpha. Write a code for Newton Raphson method using while loop. Now, append all the values of numbers corresponding to alphas, when the solution is sufficiently close enough.

Now, plot the graph and compute the relaxation factor.

6. Case 3- Tabulate the results of p for h using the given values.

Assigning the given values to h and the optimal relaxation factor(alpha) value is taken from case2 so that the solution is obtained using less number of iterations.

Other parameters are kept as constants. Use the for loop to solve for each value of h. Write a code for Newton Raphson Method using while loop. Appending all values of Cushion pressures corresponding to thickness of the ice field when the solution is sufficiently close.

Now, Plot the Cushion Pressure vs Thickness of the ice field. Tabulate the values of cushion pressures and thickness of the ice field.

PLOTS:

PLOT 1- Relaxation factor vs Number of iterations

PLOT 2- Thickness of the ice field vs Cushion Pressures

The above graph shows us that as the thickness of the ice field increases the cushion pressure required to break the ice also increases.

OUTPUT:

CONCLUSION:

FOR CASE 1- The value of pressure for h =0.6 ft is 4.20046 psi when alpha is set to 2

FOR CASE 2- The optimal relaxation factor is 1.010101 with 9 iterations

FOR CASE 3- Tabulation of p and h is shown in the output page.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.