Exemplo n.º 1
0
import numpy as np
import calc_prism as cp

y = 10.0
v = 10.0

ys = np.arange(0.001,10.0,0.001)
p_trap = {}
p_trap['y'] = 22.0
p_trap['g'] = 32.2
p_trap['Q'] = 12600.0
p_trap['m'] = 2.0
p_trap['b'] = 75.0
a_trap = cp.area_trap(p_trap)
print a_trap
b_trap = cp.width_trap(p_trap)
print b_trap
p_trap['v'] = 12600.0/a_trap

f_trap = cp.f_trap(p_trap)
print f_trap


Exemplo n.º 2
0
import numpy as np
import calc_prism as cp

y = 10.0
v = 10.0

ys = np.arange(0.001, 10.0, 0.001)
p_trap = {}
p_trap['y'] = 22.0
p_trap['g'] = 32.2
p_trap['Q'] = 12600.0
p_trap['m'] = 2.0
p_trap['b'] = 75.0
a_trap = cp.area_trap(p_trap)
print a_trap
b_trap = cp.width_trap(p_trap)
print b_trap
p_trap['v'] = 12600.0 / a_trap

f_trap = cp.f_trap(p_trap)
print f_trap
Exemplo n.º 3
0
p_dict['g'] = 32.2
p_dict['m'] = 1.0/(3.0)**0.5
p_dict['Q'] = 1500.0

#nm_2_lbft = 47.9
n = 0.015
kn = 1.49
s = 0.0005

Y = np.arange(0.001,20.0,0.001)
r = 1.0e+20
correct_y1 = -999
correct_n = -999
correct_b = -999
for y in Y:
    p_dict['y'] = y
    p_dict['b'] = (2.0/3.0) * y * (3.0)**0.5
    rh = cp.r_trap(p_dict)
    rhs = (n * p_dict['Q']) / (kn * (s**0.5))
    lhs = (cp.area_trap(p_dict)**(5.0/3.0)) /  (cp.p_trap(p_dict)**(2.0/3.0))
    this_r = abs(lhs-rhs)
    if this_r < r:
        r = this_r
        correct_y1 = y
        correct_n = n
        correct_b = p_dict['b']
print 'y',correct_y1
p_dict['y'] = correct_y1
print 'f',cp.f_trap(p_dict)
print 'n',correct_n
print 'b',correct_b
Exemplo n.º 4
0
p_dict['m'] = 1.0 / (3.0)**0.5
p_dict['Q'] = 1500.0

#nm_2_lbft = 47.9
n = 0.015
kn = 1.49
s = 0.0005

Y = np.arange(0.001, 20.0, 0.001)
r = 1.0e+20
correct_y1 = -999
correct_n = -999
correct_b = -999
for y in Y:
    p_dict['y'] = y
    p_dict['b'] = (2.0 / 3.0) * y * (3.0)**0.5
    rh = cp.r_trap(p_dict)
    rhs = (n * p_dict['Q']) / (kn * (s**0.5))
    lhs = (cp.area_trap(p_dict)**(5.0 / 3.0)) / (cp.p_trap(p_dict)
                                                 **(2.0 / 3.0))
    this_r = abs(lhs - rhs)
    if this_r < r:
        r = this_r
        correct_y1 = y
        correct_n = n
        correct_b = p_dict['b']
print 'y', correct_y1
p_dict['y'] = correct_y1
print 'f', cp.f_trap(p_dict)
print 'n', correct_n
print 'b', correct_b
Exemplo n.º 5
0
rhs = (n * p_dict['Q']) / (kn * (s**0.5))
Y = np.arange(0.001,10.0,0.001)
r = 1.0e+20
correct_y1 = -999

for y in Y:
    p_dict['y'] = y
    lhs = (cp.area_trap(p_dict)**(5.0/3.0)) /  (cp.p_trap(p_dict)**(2.0/3.0))
    this_r = abs(lhs-rhs)
    if this_r < r:
        r = this_r
        correct_y1 = y
print 'y',correct_y1
p_dict['y'] = correct_y1
print 'f1',cp.f_trap(p_dict)
p_dict['Y'] = Y
yc1 = cp.yc_trap(p_dict)
print 'yc1',yc1
p_dict['y'] = yc1
print 'fc1',cp.f_trap(p_dict)

s = 0.012
rhs = (n * p_dict['Q']) / (kn * (s**0.5))
r = 1.0e+20
correct_y2 = -999

for y in Y:
    p_dict['y'] = y
    lhs = (cp.area_trap(p_dict)**(5.0/3.0)) /  (cp.p_trap(p_dict)**(2.0/3.0))
    this_r = abs(lhs-rhs)