«Texnologik jarayonlarni modellashtirish va optimallashtirish asoslari» fanidan kurs ishi bajardi


Download 1.85 Mb.
bet7/15
Sana08.05.2023
Hajmi1.85 Mb.
#1447099
1   2   3   4   5   6   7   8   9   10   ...   15
Bog'liq
Islom karimov nomidagi toshkent davlat texnika universiteti (1)

import math
p1 = float(input("Bosimni kiriting (MPa) P1="))
p2 = float(input("Bosimni kiriting (MPa) P2="))
p3 = float(input("Bosimni kiriting (MPa) P3="))
p4 = float(input("Bosimni kiriting (MPa) P4="))
p5 = float(input("Bosimni kiriting (MPa) P5="))
p6 = float(input("Bosimni kiriting (MPa) P6="))
p7 = float(input("Bosimni kiriting (MPa) P7="))
k1 = float(input("O'tkazuvchanlik koefitsenti oraligi[0-1] K1="))
k2 = float(input("O'tkazuvchanlik koefitsenti oraligi[0-1] K2="))
k3 = float(input("O'tkazuvchanlik koefitsenti oraligi[0-1] K3="))
k4 = float(input("O'tkazuvchanlik koefitsenti oraligi[0-1] K4="))
k5 = float(input("O'tkazuvchanlik koefitsenti oraligi[0-1] K5="))
k6 = float(input("O'tkazuvchanlik koefitsenti oraligi[0-1] K6="))
k7 = float(input("O'tkazuvchanlik koefitsenti oraligi[0-1] K7="))
k8 = float(input("O'tkazuvchanlik koefitsenti oraligi[0-1] K8="))
po = float(input("Pn ning qiymatini kiriting (MPa) Pn="))
p = float(input("Suyuqlik zichligini kiriting (kg/m3) p="))
e = float(input("e ning qiymatini kiriting e="))
H1G = float(input("H1G qiymatini kiriting (m) H1G="))
H2G = float(input("H2G qiymatini kiriting (m) H2G="))
H1 = float(input("H1 ning boshlang'ich qiymatini kiriting (m) H1="))
g=9.81

def sign(n, m):


if (n-m)<0:
l = -1
return l
if (n-m) == 0:
l=0
return l
if (n-m)>0:
l = 1
return l

def signn(n):


if n<0:
l = -1
return l
if n == 0:
l=0
return l
if n>0:
l = 1
return l
h1=H1

while True:


p10 = (po*H1G)/(H1G-h1)
p8 = p10 + p*g*h1
v1 = k1*pow(abs((p1-p8)), 0.5)*sign(p1, p8)
v2 = k2*pow(abs((p2-p8)), 0.5)*sign(p2, p8)
v3 = k3*pow(abs((p3-p8)), 0.5)*sign(p3, p8)
v6 = k6*pow(abs((p8-p6)), 0.5)*sign(p8, p6)
v7 = k7*pow(abs((p8-p7)), 0.5)*sign(p8, p7)
v8= v1+v2+v3-v6-v7
p9 = p8-signn(v8)*pow((v8/k8), 2)
v4 = k4*pow(abs((p9-p4)), 0.5)*sign(p9, p4)
v5 = k5*pow(abs((p9-p5)), 0.5)*sign(p9, p5)
h1 = h1+e
if (v8-v4-v5)<=e:
break

aa = p*g
bb = p*g*H2G+p9


cc = p9*H2G -po*H2G

D=bb**2-4*aa*cc


if D<0:
print("H2 noldan kichik bolmaydi")
if D == 0:
H2 = (bb)/(2*aa)
p11 = (po*H2G)/(H2G-H2)
if D > 0:
H11 = (bb+pow(D, 0.5))/(2*aa)
H22 = (bb-pow(D, 0.5))/(2*aa)
if H11 > 0:
H2 = H11
p11 = (po*H2G)/(H2G-H2)
if H22 > 0:
H2 = H22
p11 = (po*H2G)/(H2G-H2)

print(f"V1={round(v1, 3)} P8={abs(round(p8, 3))} H1=[{H1} {round(h1, 3)}]")


print(f"V2={round(v2, 3)} P9={abs(round(p9, 3))} H2={round(H2, 3)}")
print(f"V3={round(v3, 3)} P10={abs(round(p10, 3))}")
print(f"V4={round(v4, 3)} P11={abs(round(p11, 3))}")
print(f"V5={round(v5, 3)}")
print(f"V6={round(v6, 3)}")
print(f"V7={round(v7, 3)}")
print(f"V8={round(v8, 3)}")



Download 1.85 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   10   ...   15




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling