01 #平曲曲线-基本形曲线计算:(拟定半径检验)
#道路勘测课程设计:
import math
#平曲曲线-基本形曲线计算:(拟定半径检验)
# 1.输入相关参数转角值
A=59
B=28
C=16
# 2.输入相关参数(拟定)半径
R=float(input("请输入(拟定)半径R:"))
# 3.输入相关参数缓和曲线长度Ls
Ls=float(input("请输入缓和曲线长度Ls:"))
x=A + B/60 + C/3600 # 把°′″化成小数°
print("*输出 转角值 x=", x, " (单位为°)") # 输出转换为统一单位的转角值
a=math.radians(x) # 把度数转换为弧度值,也可以:a=x*math.pi/180
print("*输出 转角弧度值 a=", a, " (单位为rad)")
tan=math.tan(a/2)
sec=1/(math.cos(a/2))
print("*输出 tan(a/2)=", tan)
# 计算曲线要素
q=0.5*Ls - (Ls ** 3)/(240*R*R) # 计算切线增长值q
p=Ls*Ls/(24*R) - Ls ** 4/(2688*R*R*R) # 计算內移植p
T=(R + p)*tan + q # 计算切线长度T
print("*输出缓和曲线长度 Ls=", Ls)
print("*输出切线增长值 q=", q)
print("*输出內移植 p=", p)
print("*输出切线长度T=", T)
print("\n其他数据:")
# 1 计算缓和曲线角,并且把弧度转换为度数,单位是°
b=Ls/2/R
print("*输出缓和曲线角度 b=", b, " (单位是rad)")
if (2*b <= a):
print(" **满足设计基本形曲线的几何条件!")
else:
print(" **不满足基本型曲线的设计要求!")
# 2 计算圆曲线长度
Ly=R*(a - 2*b)
print("*输出圆曲线长度 Ly=", Ly)
print("*输出圆曲线和缓和曲线的比值 Ly/Ls=",Ly/Ls)
if (Ly/Ls >= 1 and Ly/Ls <= 2):
print(" **满足基本形曲线缓-圆-缓长度之比宜设计为1:1:1到1:2:1之间的要求!")
else:
print(" **不满足基本型曲线的设计要求!")
#3 计算平曲线长度
Lmin=700/x
print("*输出平曲线长度 Ly+2Ls=",Ly+2*Ls)
if(Ly+2*Ls>Lmin):
print(" **满足平曲线长度大于Lmin的要求!")
else:
print(" **不满足平曲线长度大于Lmin的要求!")
A=(R*Ls)**(0.5)
E=(R+p)*sec-R
J=2*T-(Ly+2*Ls)
print('*缓和曲线参数A:',A)
print('*外距E:',E)
print('*校正值J:',J)
02 #纵断⾯设计-高程计算
#纵断面设计-高程计算:
bpdZH1=5470
bpdZH2=5975.5
bpdZH3=6267.5
T1=60
T2=80
T3=50
bpd1GC=88
bpd2GC=84
bpd3GC=90
i1=0.044
i2=0.008
i3=0.02
i4=0.006
R1=2307.69
R2=5814.28
R3=3846.15
sqxQD1,sqxZD1=bpdZH1-T1,bpdZH1+T1
sqxQD2,sqxZD2=bpdZH2-T2,bpdZH2+T2
sqxQD3,sqxZD3=bpdZH3-T3,bpdZH3+T3
for ZH in range(5300,6590,20):
if ZH < sqxQD1: # 在直线上1
SJGC=bpd1GC - i1*(bpdZH1 - ZH)
print("桩号", ZH, "的设计高程为", SJGC)
elif ZH <= sqxZD1 and ZH >= sqxQD1: # 在竖曲线上2
QXGC=bpd1GC - i1*(bpdZH1 - ZH)
h=((sqxQD1 - ZH) ** 2)/(2*R1)
SJGC=QXGC - h
print("桩号", ZH, "的设计高程为", SJGC)
elif ZH < sqxQD2 and ZH > sqxZD1: # 在直线上3
SJGC=bpd2GC + i2*(bpdZH2 - ZH)
print("桩号", ZH, "的设计高程为", SJGC)
elif ZH <= sqxZD2 and ZH >= sqxQD2: # 在竖曲线上4
QXGC=bpd2GC + i2*(bpdZH2 - ZH)
h=((sqxQD2 - ZH) ** 2)/(2*R2)
SJGC=QXGC + h
print("桩号", ZH, "的设计高程为", SJGC)
elif ZH < sqxQD3 and ZH > sqxZD2: # 在直线上5
SJGC=bpd2GC - i3*(bpdZH2 - ZH)
print("桩号", ZH, "的设计高程为", SJGC)
elif ZH <= sqxZD3 and ZH >= sqxQD3: # 在竖曲线上6
QXGC=bpd3GC - i3*(bpdZH3 - ZH)
h=((sqxQD3 - ZH) ** 2)/(2*R3)
SJGC=QXGC - h
print("桩号", ZH, "的设计高程为", SJGC)
else: # 在直线7上
SJGC=bpd3GC - i4*math.fabs(bpdZH3 - ZH)
print("桩号", ZH, "的设计高程为", SJGC)
for ZH in [5290,5864.3,5914.3,5975.5,6036.6,6086.6,6168.7,6218.7,6267.5,6316.3,6366.3,6585.9]:
if ZH < sqxQD1: # 在直线上1
SJGC=bpd1GC - i1*(bpdZH1 - ZH)
print("桩号", ZH, "的设计高程为", SJGC)
elif ZH <= sqxZD1 and ZH >= sqxQD1: # 在竖曲线上2
QXGC=bpd1GC - i1*(bpdZH1 - ZH)
h=((sqxQD1 - ZH) ** 2)/(2*R1)
SJGC=QXGC - h
print("桩号", ZH, "的设计高程为", SJGC)
elif ZH < sqxQD2 and ZH > sqxZD1: # 在直线上3
SJGC=bpd2GC + i2*(bpdZH2 - ZH)
print("桩号", ZH, "的设计高程为", SJGC)
elif ZH <= sqxZD2 and ZH >= sqxQD2: # 在竖曲线上4
QXGC=bpd2GC + i2*(bpdZH2 - ZH)
h=((sqxQD2 - ZH) ** 2)/(2*R2)
SJGC=QXGC + h
print("桩号", ZH, "的设计高程为", SJGC)
elif ZH < sqxQD3 and ZH > sqxZD2: # 在直线上5
SJGC=bpd2GC - i3*(bpdZH2 - ZH)
print("桩号", ZH, "的设计高程为", SJGC)
elif ZH <= sqxZD3 and ZH >= sqxQD3: # 在竖曲线上6
QXGC=bpd3GC - i3*(bpdZH3 - ZH)
h=((sqxQD3 - ZH) ** 2)/(2*R3)
SJGC=QXGC - h
print("桩号", ZH, "的设计高程为", SJGC)
else: # 在直线7上
SJGC=bpd3GC - i4*math.fabs(bpdZH3 - ZH)
print("桩号", ZH, "的设计高程为", SJGC)
03 #横断⾯:超高值计算
#横断面:超高值计算
#左转
ih=0.06
iG=0.02
Ls=50
bj=0.75
ij=0.03
b=1.5 #加宽值
FX=int(input('请输入方向:')) #方向:0左转
# 输入桩号
ZHD=6168.7
HYD=6218.7
YHD=6316.3
HZD=6366.3
#################################################
"""
ih=0.06
iG=0.02
Ls=50
bj=0.75
ij=0.03
b=1.5 #加宽值
FX=int(input('请输入方向:')) #方向:1右转
# 输入桩号
ZHD=5864.3
HYD=5914.3
YHD=6036.6
HZD=6086.6"""
##############################################
Lmin=7*ih*100
Lmax=7*ih*330
print(Lmin,Lmax)
#右转:
if FX==1: #右转
if Ls >= Lmin and Ls <= Lmax:
Lc=Ls
##可以继续
for ZH in range(5300, 6160, 20):
if ZH >= ZHD and ZH <= HYD: # 在缓和曲线上超高过渡,包括ZHD和YHD的超高,可以检验超高计算是否正确
x0=iG/ih*Lc
x=ZH - ZHD
bx=x/Lc*b
if x <= x0: # 双坡阶段 路面外缘高程按比例抬高x0/Lc=iG/ih
inn=iG
iw=x*2*ih/Lc - iG
if ij <= inn:
ij1=inn
else:
ij1=ij
outside=bj*(ij - iG) + x/x0*(2*bj + 7)*iG
middle=bj*ij + 3.5*iG
inner=bj*ij - bx*iG-bj*ij1
outxcd=bj*ij+x/x0*7*iG # B2
inxcd=bj*ij - bx*iG
print("桩号 %0.2f 双坡阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, outside, outxcd, middle, inxcd, inner))
if x > x0: # 旋转阶段 路面横坡度按比例增加 ix=x/Lc*ih
ix=x/Lc*ih
iw=x*ih/Lc
inn=iw
if ij <= inn:
ij1=inn
else:
ij1=ij
inner=bj*ij - (bj + bx)*ix
outside=bj*ij + (7 + bj)*ix
middle=bj*ij + 3.5*ix
outxcd=bj*ij + 7*ix
inxcd=bj*ij - bx*ix
print("桩号 %0.2f 旋转阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, outside, outxcd, middle, inxcd, inner))
elif ZH <= HZD and ZH >= YHD: # 在缓和曲线上超高过渡,包括ZHD和YHD的超高,可以检验超高计算是否正确
x0=iG/ih*Lc
x=HZD - ZH
ix=x/Lc*ih
bx=x/Lc*b
if x <= x0:
inn=iG
iw=x*2*ih/Lc - iG
if ij <= inn:
ij1=inn
else:
ij1=ij
outside=bj*(ij - iG) + x/x0*(2*bj + 7)*iG
middle=bj*ij + 3.5*iG
inner=bj*ij - bx*iG-bj*ij1
outxcd=bj*ij+x/x0*7*iG # B2
inxcd=bj*ij - bx*iG
print("桩号 %0.2f 双坡阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, outside, outxcd, middle, inxcd, inner))
if x > x0:
ix=x/Lc*ih
iw=x*ih/Lc
inn=iw
if ij <= inn:
ij1=inn
else:
ij1=ij
inner=bj*ij - (bj + bx)*ix
outside=bj*ij + (7 + bj)*ix
middle=bj*ij + 3.5*ix
outxcd=bj*ij + 7*ix
inxcd=bj*ij - bx*ix
print("桩号 %0.2f 旋转阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, outside, outxcd, middle, inxcd, inner))
elif ZH > HYD and ZH < YHD: # 在圆曲线上全超高
outside=bj*ij + (bj + 7)*ih
middle=bj*ij + 3.5*ih
inner=bj*ij - (bj + b)*ih
outxcd=bj*ij + 7*ih
inxcd=bj*ij -b*ih # inxcd=bj*ij - bx*inn
print("桩号 %0.2f 为全超高,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, outside, outxcd, middle, inxcd, inner))
else: # 不在平曲线上不超高 if ZH <ZHD or ZH>HZD:
print("桩号 %0.2f 为不超高,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, 0, bj*ij, bj*ij + 3.5*iG, bj*ij, 0))
else:
print("Lc不能取Ls,请重新取值!!")
for ZH in [5864.3,5914.3,5975.5,6036.6,6086.6]:
if ZH >= ZHD and ZH <= HYD: # 在缓和曲线上超高过渡,包括ZHD和YHD的超高,可以检验超高计算是否正确
x0=iG/ih*Lc
x=ZH - ZHD
bx=x/Lc*b
if x <= x0: # 双坡阶段 路面外缘高程按比例抬高x0/Lc=iG/ih
inn=iG
iw=x*2*ih/Lc - iG
if ij <= inn:
ij1=inn
else:
ij1=ij
outside=bj*(ij - iG) + x/x0*(2*bj + 7)*iG
middle=bj*ij + 3.5*iG
inner=bj*ij - bx*iG-bj*ij1
outxcd=bj*ij + x/x0*7*iG # B2
inxcd=bj*ij - bx*iG
print("桩号 %0.2f 双坡阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, outside, outxcd, middle, inxcd, inner))
if x > x0: # 旋转阶段 路面横坡度按比例增加 ix=x/Lc*ih
ix=x/Lc*ih
iw=x*ih/Lc
inn=iw
if ij <= inn:
ij1=inn
else:
ij1=ij
inner=bj*ij - (bj + bx)*ix
outside=bj*ij + (7 + bj)*ix
middle=bj*ij + 3.5*ix
outxcd=bj*ij + 7*ix
inxcd=bj*ij - bx*ix
print("桩号 %0.2f 旋转阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, outside, outxcd, middle, inxcd, inner))
elif ZH <= HZD and ZH >= YHD: # 在缓和曲线上超高过渡,包括ZHD和YHD的超高,可以检验超高计算是否正确
x0=iG/ih*Lc
x=HZD - ZH
ix=x/Lc*ih
bx=x/Lc*b
if x <= x0:
inn=iG
iw=x*2*ih/Lc - iG
if ij <= inn:
ij1=inn
else:
ij1=ij
outside=bj*(ij - iG) + x/x0*(2*bj + 7)*iG
middle=bj*ij + 3.5*iG
inner=bj*ij - bx*iG-bj*ij1
outxcd=bj*ij + x/x0*7*iG # B2
inxcd=bj*ij - bx*iG
print("桩号 %0.2f 双坡阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, outside, outxcd, middle, inxcd, inner))
if x > x0:
ix=x/Lc*ih
iw=x*ih/Lc
inn=iw
if ij <= inn:
ij1=inn
else:
ij1=ij
inner=bj*ij - (bj + bx)*ix
outside=bj*ij + (7 + bj)*ix
middle=bj*ij + 3.5*ix
outxcd=bj*ij + 7*ix
inxcd=bj*ij - bx*ix
print("桩号 %0.2f 旋转阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, outside, outxcd, middle, inxcd, inner))
elif ZH > HYD and ZH < YHD: # 在圆曲线上全超高
outside=bj*ij + (bj + 7)*ih
middle=bj*ij + 3.5*ih
inner=bj*ij - (bj + b)*ih
outxcd=bj*ij + 7*ih
inxcd=bj*ij -b*ih # inxcd=bj*ij - bx*inn
print("桩号 %0.2f 为全超高,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, outside, outxcd, middle, inxcd, inner))
else: # 不在平曲线上不超高 if ZH <ZHD or ZH>HZD:
print("桩号 %0.2f 为不超高,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, 0, bj*ij, bj*ij + 3.5*iG, bj*ij, 0))
#左转
if FX==0: #左转
if Ls >= Lmin and Ls <= Lmax:
Lc=Ls
##可以继续
for ZH in range(6140, 6590, 20):
if ZH >= ZHD and ZH <= HYD: # 在缓和曲线上超高过渡,包括ZHD和YHD的超高,可以检验超高计算是否正确
x0=iG/ih*Lc
x=ZH - ZHD
bx=x/Lc*b
if x <= x0: # 双坡阶段 路面外缘高程按比例抬高x0/Lc=iG/ih
inn=iG
iw=x*2*ih/Lc - iG
if ij <= inn:
ij1=inn
else:
ij1=ij
outside=bj*(ij - iG) + x/x0*(2*bj + 7)*iG
middle=bj*ij + 3.5*iG
inner=bj*ij - bx*iG-bj*ij1
outxcd=bj*ij + x/x0*7*iG # B2
inxcd=bj*ij - bx*iG
print("桩号 %0.2f 双坡阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(ZH,inner,inxcd,middle,outxcd,outside))
if x > x0: # 旋转阶段 路面横坡度按比例增加 ix=x/Lc*ih
ix=x/Lc*ih
iw=x*ih/Lc
inn=iw
if ij <= inn:
ij1=inn
else:
ij1=ij
inner=bj*ij - (bj + bx)*ix
outside=bj*ij + (7 + bj)*ix
middle=bj*ij + 3.5*ix
outxcd=bj*ij + 7*ix
inxcd=bj*ij - bx*ix
print("桩号 %0.2f 旋转阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(ZH,inner,inxcd,middle,outxcd,outside))
elif ZH <= HZD and ZH >= YHD: # 在缓和曲线上超高过渡,包括ZHD和YHD的超高,可以检验超高计算是否正确
x0=iG/ih*Lc
x=HZD - ZH
bx=x/Lc*b
if x <= x0:
inn=iG
iw=x*2*ih/Lc - iG
if ij <= inn:
ij1=inn
else:
ij1=ij
outside=bj*(ij - iG) + x/x0*(2*bj + 7)*iG
middle=bj*ij + 3.5*iG
inner=bj*ij - bx*iG-bj*ij1
outxcd=bj*ij + x/x0*7*iG # B2
inxcd=bj*ij - bx*iG
print("桩号 %0.2f 双坡阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(ZH,inner,inxcd,middle,outxcd,outside))
if x > x0:
ix=x/Lc*ih
iw=x*ih/Lc
inn=iw
if ij <= inn:
ij1=inn
else:
ij1=ij
inner=bj*ij - (bj + bx)*ix
outside=bj*ij + (7 + bj)*ix
middle=bj*ij + 3.5*ix
outxcd=bj*ij + 7*ix
inxcd=bj*ij - bx*ix
print("桩号 %0.2f 旋转阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(ZH,inner,inxcd,middle,outxcd,outside))
elif ZH > HYD and ZH < YHD: # 在圆曲线上全超高
outside=bj*ij + (bj + 7)*ih
middle=bj*ij + 3.5*ih
inner=bj*ij - (bj + b)*ih
outxcd=bj*ij + 7*ih
inxcd=bj*ij -b*ih # inxcd=bj*ij - bx*inn
print("桩号 %0.2f 为全超高,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(ZH,inner,inxcd,middle,outxcd,outside))
else: # 不在平曲线上不超高 if ZH <ZHD or ZH>HZD:
print("桩号 %0.2f 为不超高,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(ZH, 0, bj*ij, bj*ij + 3.5*iG, bj*ij, 0))
else:
print("Lc不能取Ls,请重新取值!!")
for ZH in [6168.7,6218.7,6267.5,6316.3,6366.3]:
if ZH >= ZHD and ZH <= HYD: # 在缓和曲线上超高过渡,包括ZHD和YHD的超高,可以检验超高计算是否正确
x0=iG/ih*Lc
x=ZH - ZHD
bx=x/Lc*b
if x <= x0: # 双坡阶段 路面外缘高程按比例抬高x0/Lc=iG/ih
inn=iG
iw=x*2*ih/Lc - iG
if ij <= inn:
ij1=inn
else:
ij1=ij
outside=bj*(ij - iG) + x/x0*(2*bj + 7)*iG
middle=bj*ij + 3.5*iG
inner=bj*ij - bx*iG - bj*ij1
outxcd=bj*ij + x/x0*7*iG # B2
inxcd=bj*ij - bx*iG
print("桩号 %0.2f 双坡阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, inner, inxcd, middle, outxcd, outside))
if x > x0: # 旋转阶段 路面横坡度按比例增加 ix=x/Lc*ih
ix=x/Lc*ih
iw=x*ih/Lc
inn=iw
if ij <= inn:
ij1=inn
else:
ij1=ij
inner=bj*ij - (bj + bx)*ix
outside=bj*ij + (7 + bj)*ix
middle=bj*ij + 3.5*ix
outxcd=bj*ij + 7*ix
inxcd=bj*ij - bx*ix
print("桩号 %0.2f 旋转阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, inner, inxcd, middle, outxcd, outside))
elif ZH <= HZD and ZH >= YHD: # 在缓和曲线上超高过渡,包括ZHD和YHD的超高,可以检验超高计算是否正确
x0=iG/ih*Lc
x=HZD - ZH
bx=x/Lc*b
if x <= x0:
inn=iG
iw=x*2*ih/Lc - iG
if ij <= inn:
ij1=inn
else:
ij1=ij
outside=bj*(ij - iG) + x/x0*(2*bj + 7)*iG
middle=bj*ij + 3.5*iG
inner=bj*ij - bx*iG-bj*ij1
outxcd=bj*ij + x/x0*7*iG # B2
inxcd=bj*ij - bx*iG
print("桩号 %0.2f 双坡阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, inner, inxcd, middle, outxcd, outside))
if x > x0:
ix=x/Lc*ih
iw=x*ih/Lc
inn=iw
if ij <= inn:
ij1=inn
else:
ij1=ij
inner=bj*ij - (bj + bx)*ix
outside=bj*ij + (7 + bj)*ix
middle=bj*ij + 3.5*ix
outxcd=bj*ij + 7*ix
inxcd=bj*ij - bx*ix
print("桩号 %0.2f 旋转阶段超高值,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, inner, inxcd, middle, outxcd, outside))
elif ZH > HYD and ZH < YHD: # 在圆曲线上全超高
outside=bj*ij + (bj + 7)*ih
middle=bj*ij + 3.5*ih
inner=bj*ij - (bj + b)*ih
outxcd=bj*ij + 7*ih
inxcd=bj*ij -b*ih # inxcd=bj*ij - bx*inn
print("桩号 %0.2f 为全超高,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(
ZH, inner, inxcd, middle, outxcd, outside))
else: # 不在平曲线上不超高 if ZH <ZHD or ZH>HZD:
print("桩号 %0.2f 为不超高,B1:%0.2f,B2:%0.2f,中桩:%0.2f,A2:%0.2f,A1:%0.2f"%(ZH, 0, bj*ij, bj*ij + 3.5*iG, bj*ij, 0))