Vertical Equal Tangent Parabolic Curve – Solution Code in Python (Computer Program)

 Hi,

Now solving the vertical parabolic curve for the stations and elevations at the full stations is easier with the coding. A computer program that I have coded for you runs on Pycharm (Python). Pycharm is a software that is used for offline coding on your personal computer. If you have a good Internet connection, you can produce the code on online platforms such as Jupyter. 


 You have to put the value of the grades, length of the curve, station PVC and Elevation of PVC. It will calculate all other stations and elevations for you. 

Code: 

import math

g1 = input('Grade G1 (%) = ')
a = float(g1)/100
g2 = input('Grade G2 (%) = ')
b = float(g2)/100
Length = input('Length of the vertical curve = ')
L = float(Length)
u = input('unit = ')
A = float((b - a)/L)
print('Rate of change of grade = k = (G2-G1)/L =', A)
print('Let x be the distance from PVC to a point on the curve,'
' and Y be the respective elevation.')
c = float(input('Station(PVC) = Xo = ',))
d = float(input('Elevation at PVC = Yo = ',))
print(f"Equation of a parabolic equal tangent curve, "
f"Y = Yo + G1x + kx^2/2 = {d} + {a}x + {A}x^2/2 ..eq1")
x = 100*((1+c//100) - c/100)
X = c + x,
print('1st Full Station is', X, 'at x =', x, u, 'from PVC')
Y = d + a*x + A*(x**2)/2
print('Putting the value of x in eq1, Elevation, Y= ', Y, u)
x = x + 100
while x < L:
X = c + x
Y = d + a * x + A * (x ** 2) / 2
print('Similarly, next Full Station is', X, 'at x =', x, u, 'from PVC')
print('Elevation, Y = ', Y, u)
x = x + 100
X = c + L
print('End Station, EVC = PVC + L =', X, u, 'at x = L = ', L, u)
x = L
Y = d + a*x + A*(x**2)/2,
print('Put x in eq1, Elev EVC = ', Y, u)

Output Sample: 
Grade G1 (%) = 3
Grade G2 (%) = -2
Length of the vertical curve = 1000
unit = m
Rate of change of grade = k = (G2-G1)/L = -5e-05
Let x be the distance from PVC to a point on the curve, and Y be the respective elevation.
Station(PVC) = Xo = 340
Elevation at PVC = Yo = 100
Equation of a parabolic equal tangent curve, Y = Yo + G1x + kx^2/2 = 100.0 + 0.03x + -5e-05x^2/2 ..eq1
1st Full Station is (400.0,) at x = 60.00000000000001 m from PVC
Putting the value of x in eq1, Elevation, Y= 101.71 m
Similarly, next Full Station is 500.0 at x = 160.0 m from PVC
Elevation, Y = 104.16 m
Similarly, next Full Station is 600.0 at x = 260.0 m from PVC
Elevation, Y = 106.11 m
Similarly, next Full Station is 700.0 at x = 360.0 m from PVC
Elevation, Y = 107.56 m
Similarly, next Full Station is 800.0 at x = 460.0 m from PVC
Elevation, Y = 108.50999999999999 m
Similarly, next Full Station is 900.0 at x = 560.0 m from PVC
Elevation, Y = 108.96 m
Similarly, next Full Station is 1000.0 at x = 660.0 m from PVC
Elevation, Y = 108.91 m
Similarly, next Full Station is 1100.0 at x = 760.0 m from PVC
Elevation, Y = 108.36 m
Similarly, next Full Station is 1200.0 at x = 860.0 m from PVC
Elevation, Y = 107.31 m
Similarly, next Full Station is 1300.0 at x = 960.0 m from PVC
Elevation, Y = 105.76 m
End Station, EVC = PVC + L = 1340.0 m at x = L = 1000.0 m
Put x in eq1, Elev EVC = (105.0,) m

Thanks!

Leave a Comment

Your email address will not be published. Required fields are marked *

PHP Code Snippets Powered By : XYZScripts.com