#Variable declaration
V_S=10.0; #Supply voltage in V
V_D=1.6; #Forward voltage drop of LED, in V
I_F=20.0; #Required limited current through LED, in mA
#Calculations
R_S=(V_S-V_D)/(I_F/1000); #Series resistor required to limit the current through the LED, in Ω
#Result
print("The value of series resistor required to limit the current through the LED = %d Ω."%R_S);
#Variable declaration
V_S=15.0; #Supply voltage in V
V_D=2.0; #Forward voltage drop of LED, in V
R_S=2200.0; #Series resistor required to limit the current through the LED, in Ω
#Calculations
I_F=((V_S-V_D)/R_S)*1000; #Required limited current through LED, in mA
#Result
print("The current through the LED in the circuit = %.2f mA"%I_F);
#Variable declaration
Ir=50.0; #Dark current as observed from the current Illumination curve, in mA
V_R=10.0; #Reverse voltage in V
#Calculation
R_R=V_R/(Ir/pow(10,6)); #Dark Resistance in Ω
#Result
print("The dark resistance is=%d kΩ"%(R_R/1000));
#Variable declaration
E=2.5; #Illumination in mW/cm²
m=37.4; #sensitivity of the photodiode in 𝜇A/mW/cm²
#Calculations
I_R=m*E; #Reverse current in 𝜇A
#Result
print("The reverese current in the photodiode = %.1f 𝜇A"%I_R);
from math import pi
from math import sqrt
#Variable declaration
L=1.0; #Inductance of the inductor in mH
C=100.0; #Capacitance of the varactor in pF
#Result
f_r=1/(2*pi*sqrt(L*pow(10,-3)*C*pow(10,-12))); #Resonant frequency of the circuit in Hz
f_r=f_r/1000; #Resonant frequency of the circuit in kHz
#Result
print("The resonant frequency of the circuit = %.1f kHz"%f_r);