V_AK=20.0; #VOLTAGE ACROSS ANODE
I_A=1*10**-6;
R_AK=V_AK/I_A;
print('Resistance = %d * 10^6 Ohm'%(R_AK/10**6))
R_S=10**3;
V_BIAS=110.0;
V_BE=0.7;
V_CE_sat=0.1;
V_A=V_BE+V_CE_sat; #VOLTAGE ACROSS ANODE
V_R_s=V_BIAS-V_A; #VOLTAGE ACROSS R_S
I_A=V_R_s/R_S;
print('Anode current = %f A'%I_A)
n=0.6;
V_BB=20.0;
V_pn=0.7;
V_P=n*V_BB+V_pn;
print('peak point emitter voltage = %.1f Volts'%V_P)
V_BB=30.0;
V_P=14.0;
I_P=20.0*10**-6;
V_V=1.0;
I_V=10.0*10**-3;
x=(V_BB-V_P)/I_P;
y=(V_BB-V_V)/I_V;
print('R1 should be less than %d Ohms'%x)
print('R1 should be more than %d Ohms'%y)
import math
n2=1.3; #cladding index
n1=1.35; #core index
theta=math.acos(n2/n1);
t=theta*180/math.pi;
print('critical angle in degrees \n\t%f'%t)