from __future__ import division
from numpy import pi, sqrt
#Given data
C1= 5 # in pF
C1= C1*10**-12 # in F
C2= 50 # in pF
C2= C2*10**-12 # in F
L= 10 # in mH
L= L*10**-3 # in H
TuningRange= 1/(2*pi*sqrt(L*C1*C2/(C1+C2))) # in Hz
print " The tuning range for the circuit = %0.3f kHz" %(TuningRange*10**-3)
# Note : In the book, this example is not solved. Only given data is shown.
#Given data
C_T1= 15 # in pF
Vb1=8 # in V
Vb2= 12 # in V
# As C_T proportional to 1/sqrt(Vb), and
# C_T1/C_T2= sqrt(Vb2/Vb1), so
C_T2= C_T1*sqrt(Vb1/Vb2) # in pF
print " The value of C_T2 = %0.2f pF" %C_T2
#Given data
epsilon_Ge= 16/(36*pi*10**-11) # in f/C
A=10**-12
d=2*10**-4 # in cm
# C_T= epsilon_0*A/d= epsilon_Ge*A/d
C_T= epsilon_Ge*A/d #in pF
print " The space charge capacitance = %0.2f pF" %C_T
#Given data
D= 0.102 # in cm
sigma_P= 0.286 # in Ωcm
q= 1.6*10**-19 # in C
miuP= 500
Vb= 5+0.35 #in V
A= pi*D**2/4 # in cm**2
N_A= sigma_P/(q*miuP) # at/c
C_T= 2.92*10**-4*(N_A/Vb)**(1/2)*A #
print " The value of transition = %0.2f pf/cm**2" %C_T
#Given data
epsilon= 12/(36*pi*10**11) # in F/cm (value of epsilon for silicon)
q= 1.6*10**-19 # in C
# C_T= epsilon*A/d , where d= 2*epsilon*Vi/(q*NA)**(/2)
# Hence C_T/A= epsilon/d= sqrt(q*epsilon/2)*sqrt(NA/Vi)
# Let
value = sqrt(q*epsilon/2)
print "C_T= %0.1e sqrt(NA/Vi) pF/cm**2" %(value*10**12)
#Given data
V1= 5 # in V
IncreaseInVolt= 1.5 # in V
C_T1= 20 # in pF
# Formula C_T= lamda/sqrt(V)
lamda= C_T1*sqrt(V1)
# When
V2= V1+IncreaseInVolt # in V
C_T2= lamda/sqrt(V2)
print " The decrease in capacitance = %0.2f pF" %(C_T1-C_T2)
#Given data
Vf= 0.7 # in V
If= 10 # in mA
If= If*10**-3 # in A
toh= 70 # in ns
Cd= toh*If/Vf # in nf
print " Diffusion capacitance for a si diode = %0.f nf" %Cd
#Given data
N_A= 4*10**20 # per m**3
Vi= 0.2 # in V
q= 1.6*10**-19
V= -1 # in V
A= 0.8*10**-6 #/ in m**2
epsilon_r= 16
epsilon_o= 8.854*10**-12 # in F
epsilon= epsilon_o*epsilon_r
d= (2*epsilon*(Vi-V)/(q*N_A))**(1/2)
C_T= epsilon*A/d # in F
print " The transition capacitance = %0.2f pF" %(C_T*10**12)
from math import sqrt
#Given data
V1= 5 # in V
V2 = V1+1 # in V
C_T1= 20 # in pF
# C_T2/C_T1 = sqrt(V1/V2)
C_T2= C_T1* sqrt(V1/V2)
print " The capacitance for 1-V increase in bias = %0.2f pF" %C_T2
print " Therefore, the decrease in capacitance = %0.2f pF" %(C_T1-C_T2)
# NOTE: The answer in the book is wrong due to calculation error to evalaute the value of C_T2.
#Given data
C1= 4 # in pF
C2= 60 # in pF
L=8*10**-3 # in H
C_Tmin= C1*C1/(C1+C1) # in pF
C_Tmin= C_Tmin*10**-12 # in F
C_Tmax= C2*C2/(C2+C2) # in pF
C_Tmax= C_Tmax*10**-12 # in F
Fc_max= 1/(2*pi*sqrt(L*C_Tmin)) # in Hz
Fc_min= 1/(2*pi*sqrt(L*C_Tmax)) # in Hz
print " Maximum resonance frequency = %0.2f MHz" %(Fc_max*10**-6)
print " Minimum resonance frequency = %0.3f MHz" %(Fc_min*10**-6)
#Given data
C1= 6 # in pF
C2= 50 # in pF
L=12*10**-3 # in H
C_Tmin= C1*C1/(C1+C1) # in pF
C_Tmin= C_Tmin*10**-12 # in F
C_Tmax= C2*C2/(C2+C2) # in pF
C_Tmax= C_Tmax*10**-12 # in F
Fc_max= 1/(2*pi*sqrt(L*C_Tmin)) # in Hz
Fc_min= 1/(2*pi*sqrt(L*C_Tmax)) # in Hz
print " Maximum resonance frequency = %0.3f MHz" %(Fc_max*10**-6)
print " Minimum resonance frequency = %0.3f MHz" %(Fc_min*10**-6)