Skip to content

Instantly share code, notes, and snippets.

@spellancer
Created May 10, 2015 11:20
Show Gist options
  • Save spellancer/d8e549cab8140f5d1832 to your computer and use it in GitHub Desktop.
Save spellancer/d8e549cab8140f5d1832 to your computer and use it in GitHub Desktop.
NNPP
# -*- coding: utf-8 -*-
# Вариант 10. Нанян Саркис АК5-101
from math import exp
M = 25
Hf = 0.1
Gw_1 = 1
Gw_2 = 3
def st (e1,e2,d1,d2):
st = e1 * (M ** d1) + e2 * Hf * (M ** d2)
return st
def getgamma (b1, b2, b3=7777):
if b3 != 7777:
res = b1 * Hf ** 0 + b2 * Hf ** 1 + b3 * Hf ** 2
else:
res = b1 * Hf ** b2
return res
def getB (gamma, G):
return gamma * G
def getBz (c4, G):
return c4 * G
def getksi_z (c):
res = []
s1 = 0
s2 = 0
for i in c:
s1 += i * Gw_1 ** c.index(i)
s2 += i * Gw_2 ** c.index(i)
res.append (exp(s1))
res.append (exp(s2))
return res
def getKsi1 (a, b):
f = 1
for i in a:
f += i * b ** (a.index(i) + 1)
return f
def getKsi2 (a, b, bz, ksiz):
s = 1
for i in a:
s += i * (b/bz) ** a.index(i)
return s*ksiz
# Введите исходные данные для получения решения
sq = st (1.089127,-0.00361,0.695347,1.753235)
stau = st (2.264503,0.80803,0.665936,0.742669)
gq = getgamma (0.691800, -0.034458, 0)
gtau = getgamma (0.691870, -0.472683, 0.220466)
Bq1 = getB (gq, Gw_1)
Bq2 = getB (gq, Gw_2)
Btau1 = getB (gtau, Gw_1)
Btau2 = getB (gtau, Gw_2)
#Bzq1 = getBz (0.6560, Gw_1)
Bzq2 = getBz (0.6560, Gw_2)
#Bztau1 = getBz (0.4471, Gw_1)
Bztau2 = getBz (0.4471, Gw_2)
Ksi_z_q = getksi_z ([-0.286198, -0.181912, -0.391534])
Ksi_z_q1 = Ksi_z_q[0]
Ksi_z_q2 = Ksi_z_q[1]
Ksi_z_tau = getksi_z ([-0.156685, -0.473388, 0.023530])
Ksi_z_tau1 = Ksi_z_tau[0]
Ksi_z_tau2 = Ksi_z_tau[1]
# RESULT
Ksi_q1 = getKsi1 ([-1, 0.089074, 0.254418, -0.139110], Bq1)
Ksi_q2 = getKsi2 ([7.677872, -6.704910, 3.806378, -4.687349], Bq2, Bzq2, Ksi_z_q2)
Ksi_tau1 = getKsi1 ([-1.023982, 0.313225, 0.138553, -0.259920], Btau1)
Ksi_tau2 = getKsi2 ([1.098277,-0.517455, -0.957957, 0.384277], Btau2, Bztau2, Ksi_z_tau2)
# Теплообмен:
print "\nРезультаты для теплообмена: "
print " S = " , sq
print " Gamma = " , gq
print " G1 = ", Gw_1, ", B = ", Bq1
print " G2 = ", Gw_2, ", B = ", Bq2, ", B* = ", Bzq2, ", Ksi* = ", Ksi_z_q2
print "Итог:"
print "Ksi1 = ", Ksi_q1
print "Ksi2 = ", Ksi_q2
print "\n----------------------------\n"
# Трение:
print "Результаты для трения: "
print " S = " , stau
print " Gamma = " , gtau
print " G1 = ", Gw_1, ", B = ", Btau1
print " G2 = ", Gw_2, ", B = ", Btau2, ", B* = ", Bztau2, ", Ksi* = ", Ksi_z_tau2
print "Итог:"
print "Ksi1 = ", Ksi_tau1
print "Ksi2 = ", Ksi_tau2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment