Project

Python Project 5 : Breaking Ice with Air cushion Vehicle

AIM :

Write python script to solve for the minimum value of pressure using the newton raphson method.

Problem Statement :

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 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.

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

Equation Use in this Problem :

`p^3(1 − β^2) + (0.4hβ^2 − {σh^2}/{r^2})p^2 + ({σ^2h^4}/{3r^4})p − ({σh^2}/{3r^2})^3 = 0`

Where

p = Cushion Pressure

h = Thickness of ice field

r = Size of Air Cushion

σ = Tensile Strength of the ice

β = Width of the ice wedge

PYTHON CODE :

1. Finding Optimum Relxation Factor Using Thickness as 0.6 [Problem number 1 and 2]

'''Finding optimum relaxation factor using thickness as 0.6'''

import math
import matplotlib.pyplot as plt
import numpy as np

#inputs
beta=0.5                                  #width of ice wedge(no units)
r=40                                      #size of air cushion(feet)
sigma=150*144                             #tensile strength of ice(in psf)(converting psi into psf)
t=0.6                                     #thickness of ice(feet)

# Alpha define
alpha=np.linspace(0.1,1.8,100)            #relaxation factor
tol=1e-6                                  #tolerance

#Equation divide into various terms
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))

#defining function
def f(p):          # The above equation which is given for ice breaking
  h=0.6
  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):      # Differentiation of above equation
  h=0.6
  return (a*3*pow(p,2))+((b*h-c*pow(h,2))*2*p)+(d*pow(h,4))

#finding minimum pressure to break ice
pressure=[]
iterations=[]
for i in alpha:
  ct=1
  pg=500

  while(abs(f(pg))>tol):
    pg=pg-i*(f(pg)/fprime(pg))
    ct=ct+1
  pressure.append(pg)
  iterations.append(ct)

#printing result
print('Relaxation factor',':','minimum pressure',':','no.of iterations')
for j in range(0,100):
  print(alpha[j],':',pressure[j],':',iterations[j])

plt.plot(alpha,iterations)
plt.xlabel('Relaxation factor')
plt.ylabel('No. of iterations')
plt.show()
#END of Program

Program Explaination :

  • In this question, we find the optimum relaxation factor for thickness 0.6.
  • First of all we take all the input values like beta, sigma, r, thickness and tolerance.
  • Then we get 100 relaxation factor values in the range of 0.1 to 1.8 by using linspace command as shown in the coding
  • By using for loop, we calculate the minimum pressure for every relaxation factor values and thickness as 0.6 as shown in the coding.
  • Finally, print the results and make plot between relaxation factor and no. of iterations.
  • Now we see the above result relaxation factor 1.0 has minimum number of iterations as 18.
  • So, the optimum relaxation factor for thickness 0.6 is 1.0

Result :

2. Finding minimum pressure using relaxation factor as 1[Problem number 3]

'''Finding minimum pressure using relaxation factor as 1 to break ice by air cushion vehicle using Newton Raphson method'''

import math
import matplotlib.pyplot as plt

#inputs
beta=0.5                                  #width of ice wedge(no units)
r=40                                      #size of air cushion(feet)
sigma=150*144                             #tensile strength of ice(in psf)(converting psi into psf)
t=[0.6,1.2,1.8,2.4,3.0,3.6,4.2]           #thickness of ice(feet)

# In this alpha is use as 1 
alpha=1                                   #relaxation factor
tol=1e-6                                  #tolerance

#Equation divide into various terms
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))

#defining function
def f(p,h):          # The above equation which is given for ice breaking
  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):      # Differentiation of above equation
  return (a*3*pow(p,2))+((b*h-c*pow(h,2))*2*p)+(d*pow(h,4))

#finding minimum pressure to break ice
pressure=[]
iterations=[]
for h in t:
  ct=1
  pg=500

  while(abs(f(pg,h))>tol):
    pg=pg-alpha*(f(pg,h)/fprime(pg,h))
    ct=ct+1
  pressure.append(pg)
  iterations.append(ct)

#printing result
print('Thickness',':','minimum pressure',':','no.of iterations')
for i in range(0,7):
  print(t[i],':',pressure[i],':',iterations[i])

plt.plot(t,pressure)
plt.xlabel('Thickness')
plt.ylabel('Pressure')
plt.show()
#END of Program

Program explain:

  • In this question we find the minimum pressure required to break ice with different thickness using relaxation factor as 1.
  • First of all we define all inputs of beta, sigma, r, thickness, relaxation factor and tolerance.
  • Then we define the function and its derivative as shown in the coding.
  • By using for loop, calculate the minimum pressure and no. of iterations takes place.
  • The next iteration is calculated by the below formula:

`p_{guess}=p_{guess}-alpha*(f(p_{guess},h)/{f_{pr ime}(p_{guess},h)})`

  • Repeat the above procedure and calculate the minimum pressure and no. of iterations takes place for different thickness of ice.
  • Finally, print the results and make the plot between thickness and pressure.

Result :

OBSERVATION:

  • From this concept, Newton Raphson method is used to find the exact pressure required to break the different thickness of ice.
  • Here, the relaxation factor play a major role in nding minimum presssure with less number of iterations.
  • From the above plots, If you give high relaxation factor then it takes more number of iterations as well as if you give very less factor then it also takes more number of iterations for calculating minimum pressure.
  • So, for ervey thickness there must be a optimum relaxation factor value.
  • From the above plots, the exact pressure required is increased with increase in thickness of ice



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.