You are on page 1of 3

Tito, Lloyd Angelo

Patulot, Gian Franco

Ceribo, Nathaniel

SPICE CIRCUIT DIAGRAM

SPICE TEST RESULTS


SOLUTION
MATLAB
%%KVL, 2-Loop Circuit, 3 resistors, 1 1n4001(MIC) Diode

%Initial Commands
clc; clear

%Resistors
R_1 = 99.6;
R_2 = 101;
R_3 = 100;
R_B = 0.23;

%Voltages
V_S = 8.96;
V_Fwd = 1.1;

%Mesh Analysis
R = [R_1+R_2,-(R_2);-(R_2),R_2+R_3+R_B];
V = [V_S,-(V_Fwd)]';
I = R\V;

%current passed through each resistor


I_R1=I(1);
I_R2=I(1)-I(2);
I_R3=I(2);

%voltage across each component


V_R1=I_R1*R_1;
V_R2=I_R2*R_2;
V_R3=I_R3*R_3;
V_D =V_Fwd+(I_R3*R_B);

%Print Current
fprintf('I_R1 is %8.8f A \n',I_R1)
fprintf('I_R2 is %8.8f A \n',I_R2)
fprintf('I_R3 is %8.8f A \n \n',I_R3)

%Print Potential
fprintf('V_R1 is %8.8f V \n',V_R1)
fprintf('V_R2 is %8.8f V \n',V_R2)
fprintf('V_R3 is %8.8f V \n',V_R3)

Result
I_R1 is 0.05608750 A
I_R2 is 0.03340282 A
I_R3 is 0.02268468 A

V_R1 is 5.58631490 V
V_R2 is 3.37368510 V
V_R3 is 2.26846762 V

You might also like