import itertools
import math
_E24=[1.0,1.1,1.2,1.3,1.5,1.6,1.8,2.0,2.2,2.4,2.7,3.0,3.3,3.6,4.3,4.7,5.1,5.6,6.2,6.8,7.5,8.2,9.1]
E24=[]
C=100e-9
for i in range(0,6):
E24.extend(list(map(lambda x:(x*(10**i)),_E24)))
def get_omega(r1,r2,r3,c):
return math.sqrt((1/r1+1/r2)*(1/r3))/c
def get_f(r1,r2,r3,c):
return get_omega(r1,r2,r3,c)/2/3.1415926
def get_h0(r1,r2,r3,c):
return 1/(2*3.1415926*50*r1*c)
def get_Q(r1,r2,r3,c):
return 2*3.1415926*50*r3*c/2
def good_enough(v1,v2,error):
return abs(v1-v2)<error
for r1 in E24:
for r2 in E24:
for r3 in E24:
if(good_enough(50,get_f(r1,r2,r3,C),0.5) and good_enough(1.5,get_h0(r1,r2,r3,C),0.5) and good_enough(15,get_Q(r1,r2,r3,C),5)):
print(r1,r2,r3,'H0=',get_h0(r1,r2,r3,C),'Q=',get_Q(r1,r2,r3,C))