FINDING MINIMUM PRESSURE TO BREAKING THE ICE WITH AIR CUSHION VEHICLE IN NEWTON'S METHOD BY USING PYTHON
AIM :
To write a python program to find out the minimum pressure to breaking ice of field with air cushion vehicle.
OBJECTIVE :
1) To use the newton raphson method to find out the value of pressure for which thickness of 0.6 feet.
2) To find the optimal relaxation factor from the plot like minimum pressure with function of varying ralaxation factor.
3) To tabulate the results value of minimum pressure at different thickness by using assumed optimal relaxation factor.
INTRODUCTION :
A hovercraft is also known as an air-cushion vehicle, is an amphibious craft capable of travelling over land, water, mud, ice, and other surfaces. Hovercraft use blowers to produce a large volume of air below the hull, or air cushion, that is slightly above atmospheric pressure. The pressure difference between the higher pressure air below the hull and lower pressure ambient air above it produces lift, which causes the hull to float above the running surface. For stability reasons, the air is typically blown 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 allows the vehicle to travel over small obstructions without damage.
Newton Method Method :
The Newton-Raphson method is also known as Newton's method, it's a way to quickly find a good approximation for the root of a real-valued function f(x) = 0. It uses the idea that a continuous and differentiable function can be approximated by a straight line tangent to it.
Newton's Method works :
Suppose you need to find the root of a continuous, differentiable function f(x), and you know the root you are looking for is near the point x = X0. Then Newton's method tells us that a better approximation for the root is
`X1 = X0 - alpha *(f(X0))/(f'(X0))`
This process may be repeated as many times as necessary to get the desired accuracy. In general, for any x-value = Xn, the next value is given by
`Xn+1 = xn - alpha*f(Xn)/(f'(Xn))`
EQUATION :
`p^3(1-beta^2)+((0.4*h*beta^2 )- (sigma*h^2)/(r^2))p^2+((sigma^2*h^4)/(3*r^4))*p-((sigma*h^2)/(3*r^2))^3 = 0`
where,
p = Cushion pressure
t = Thickness of the ice field
r = Size of the air pressure
sigma = Strength of the ice
beta = Width of the ice wedge
Given Values :
beta = 0.5
r = 40 feet
sigma = 150
PYTHON CODE FOR FINDING MINIMUM PRESSURE AT WHICH 0.6 THICKNESS BY USING NEWTON'S METHOD:
import math
import matplotlib.pyplot as plt
import numpy as np
#Inputs
beta = 0.5
r = 40
sigma = 150*144
h = 0.6
alpha = np.linspace(0.1,1.5,100)
tol = 1e-8
a = 1-pow(beta,2)
b = 0.4*pow(beta,2)
c = sigma/pow(r,2)
d = pow(sigma,2)/(3*pow(r,4))
e = pow(sigma,3)/(9*pow(r,6))
def f(p):
return(a*pow(p,3))+((b*h-c*pow(h,2))*pow(p,2))+(d*pow(h,4)*p)-(e*pow(h,6))
def fprime(p):
return(a*3*pow(p,2))+((b*h-c*pow(h,2))*2*p)+(d*pow(h,4))
pressure = []
iteration = []
for i in alpha:
ct =1
Pguess = 500
while (abs(f(Pguess))>tol):
Pguess = Pguess - i*(f(Pguess)/fprime(Pguess))
ct = ct + 1
pressure.append(Pguess)
iteration.append(ct)
print('Relaxation factor',':','Minimum Pressure',':','Number of iteration')
for j in range (0,100):
print(alpha[j],':',pressure[j],':',iteration[j])
plt.plot(alpha,iteration)
plt.xlabel('Relaxation Factor')
plt.ylabel('Number of iteration')
plt.title('Relaxation factor Vs Number of iteration')
plt.savefig('Relaxation factor Vs Number of iteration')
plt.show()
EXPLANATION :
1) Importing the all necessary module like math, matplotlib and numpy at where top in our python code.
2) Provide the inputs to our code such as beta, size of the cushion, tensile strength of the ice in (psf) and thickness of the ice field.
3) Create a multiple alpha value like a list or array by using linspace command and also put the numpy module as np, it dealing with arrays.
4) We have equation for finding the minimum pressure to which breaking the corresponding thickness of ice. In equation each term, we put the different variable name and placed into the equation.
5) Write the f(p) and fprime(p) functions to calculate the minimum pressure to break the ice with to function of relaxation factor by using newton's method.
6) In this case, we have to find the minimum pressure for which thickness of the ice is 0.6. Meanwhile, alpha value will varying continuously at each and every iteration. Create a 'for loop' command in the range of alpha. Before that, we could make a empty array for which storing the value of minimum pressure and Number of iterations.
7) Provide the initial guess value to the while statement and write the newton's method formula under the while statement. A while statement is helps us to stop iteration whenever it crosses the given tolerance. Till the iteration, a value of pressure will appending into the pressure array and also Number of iterations also get appending. In each iteration, a counter will count the number of iterations are goes on.
8) We have list out the values at the parameters are Relaxation factor, Minimum pressure and Number of iteration. After that, to create a 'for loop' in range of 100 to print out the corresponding parameter values.
9) Write a code for generating an plot for where alpha on x axis and Number of iterations on y axis.
10) Observe from the plot, we conclude optimum relaxation is 1. By using this optimum relaxation factor, to find out the minimum pressure to break the corresponding thickness of ice.
PYTHON CODE FOR FINDING MINIMUM PRESSURE AT WHICH DIFFERENT THICKNESS :
import math
import matplotlib.pyplot as plt
from tabulate import tabulate
#Inputs
beta = 0.5
r = 40
sigma = 150*144
H = [0.6,1.2,1.8,2.4,3,3.6,4.2]
alpha = 1
tol = 1e-8
a = 1-pow(beta,2)
b = 0.4*pow(beta,2)
c = sigma/pow(r,2)
d = pow(sigma,2)/(3*pow(r,4))
e = pow(sigma,3)/(9*pow(r,6))
def f(p,h):
return(a*pow(p,3))+((b*h-c*pow(h,2))*pow(p,2))+(d*pow(h,4)*p)-(e*pow(h,6))
def fprime(p,h):
return(a*3*pow(p,2))+((b*h-c*pow(h,2))*2*p)+(d*pow(h,4))
pressure = []
iteration = []
for h in H:
ct =1
Pguess = 500
while (abs(f(Pguess,h))>tol):
Pguess = Pguess - alpha*(f(Pguess,h)/fprime(Pguess,h))
ct = ct + 1
pressure.append(Pguess)
iteration.append(ct)
Titles = ['Thickness in feet','Minimum Pressure in pound per squrare feet','Number of iteration']
Tables = tuple(zip(H,pressure,iteration))
print(tabulate(Tables,Titles, tablefmt = 'Grid'))
plt.plot(H,pressure)
plt.xlabel('Thickness of the ice wedge in feet')
plt.ylabel('Minimum Pressure in pound/feet')
plt.title('Thickness Vs Minimum pressure')
plt.savefig('Thickness Vs Minimum pressure')
plt.show()
EXPLANATION :
1) As usually, we importing the same modules in the code. Additionally we importing the tabulate module, it's helps to making an tabulation.
2) Providing the inputs are beta, size of the cushion, tensile strength of the ice in (psf) and thickness of ice have six different numbers.
3) We already finded the optimum relaxation factor from previous case. So, a relaxation factor is one, it denoted as alpha.
4) A Minimum Pressure and thickness of ice will varying in each iterations, a equation differentiate with function of initial guess value and thickness of ice field.
5) Create a 'for loop' from first to last thickness of ice field values, put the initial guess values and create a counter for counting an number of iteration will goes in each loop.
6) Create a 'while' statement to helps us to terminate the iterations whenever a initial value will cross the tolerances. If iteration is terminates at respective thickness of ice field value, then it will go to next thickness value.
7) A pressure values and Iteration will appending at the completion of one loop.
8) Create a titles are which Thickness in feet, Minimum pressure and Number of iterations. Tuple command will helps us to print the values at where bottom of the titles. Zip command will help us to print the values such as thickness of ice field, minimum pressure to break the ice and number of iteration taken to converge. To print the titles and values by using tabulate command.
9) Make a plot in thickness of ice at x axis and Minimum pressure at y axis.
RESULTS AND DISCUSSION :
When a relaxation factor is 0.1, it takes more iteration to solution converge. As clear shown from the plot, if we put the relaxation factor is 1, a number of iterations are much lesser than others. So, we decided 1 is a optimum relaxation factor.

This curve looks like a quadratic in nature it proportional to thickness of a ice fields.

We can pass the relaxation factor values from 0.1 to 1.5 with equidistant interval of 100. Snap shots are represents to Minimum pressure to break the ice fields and Number of iteration have to converge those two are respect to corresponding each and every relaxation factor.

