You are on page 1of 2

2)

A = [
1 1 0 0
0 0 1 1
1j -1j 0 0
0 0 1j -1j
];
%2a
%b = [1; 1; -1; 1;];
% 2b
%b = [1; 1; 1;

-1;];

x = A\b

2a

4)

2b

L = 20e-3;
R = 30;
V_source = 500;
t = 0;
%Parallel resistance
R_eq = (R*R)/(R+R);
i_0 = V_source/R_eq;
i_0f = V_source/R;
Current = zeros(1,6);
Voltage = zeros(1,5);
%Sets the current and voltage calculations
Final_Voltage = zeros(1,6);
Current(1)= i_0 - i_0f*exp(-(t*10^-3)*R_eq/L);
Final_Voltage(1) = V_source - Current(1)*R_eq;
for t = 1:5
Current(t)= i_0 - i_0f*exp(-((t)*10^-3)*R_eq/L);
Voltage(t)= V_source - Current(t)*R_eq;
end

Final_Voltage(2:6) = Voltage(1:5);
time = (0:5);
figure
plot(time,Final_Voltage, 'LineWidth',2)
title('Inductor Voltage V_L vs time','FontWeight','bold')
xlabel('time(ms)','FontWeight','bold')
ylabel(' Voltage (V)','FontWeight','bold')

You might also like