Código: %UNTITLED2 Summary of This Function Goes Here % Detailed Explanation Goes Here

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Código

function [ ] = T1( L1,L2,L3,L4 )


%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
w=2*pi*60;
Vmax=127;
R=3;
t=0:0.1:4*pi;
I1=zeros(1,length(t));

for i=1:length(t)
I1(1,i)=((L1*w*Vmax)/((R^2)+(L1*w)^2)*exp(-R*t(i)/(L1*w)))+(Vmax/((R^2)+
((L1*w)^2)))*(R*sin(t(i))-(L1*w*cos(t(i))));
if I1(1,i)<0
I1(1,i)=0;
end
end

I2=zeros(1,length(t));
for i=1:length(t)
I2(1,i)=((L2*w*Vmax)/((R^2)+(L2*w)^2)*exp(-R*t(i)/(L2*w)))+(Vmax/((R^2)+
((L2*w)^2)))*(R*sin(t(i))-(L2*w*cos(t(i))));
if I2(1,i)<0
I2(1,i)=0;
end
end

I3=zeros(1,length(t));
for i=1:length(t)
I3(1,i)=((L3*w*Vmax)/((R^2)+(L3*w)^2)*exp(-R*t(i)/(L3*w)))+(Vmax/((R^2)+
((L3*w)^2)))*(R*sin(t(i))-(L3*w*cos(t(i))));
if I3(1,i)<0
I3(1,i)=0;
end
end

I4=zeros(1,length(t));
for i=1:length(t)
I4(1,i)=((L4*w*Vmax)/((R^2)+(L4*w)^2)*exp(-R*t(i)/(L4*w)))+(Vmax/((R^2)+
((L4*w)^2)))*(R*sin(t(i))-(L4*w*cos(t(i))));
if I4(1,i)<0
I4(1,i)=0;
end
end

figure
subplot(2,2,1)
plot(t,I1)
title('Corriente 1')
grid on
subplot(2,2,2)
plot(t,I2)
title('Corriente 2')
grid on
subplot(2,2,3)
plot(t,I3)
title('Corriente 3')
grid on
subplot(2,2,4)
plot(t,I4)
title('Corriente 4')
grid on

V1=I1*R;
V2=I2*R;
V3=I3*R;
V4=I4*R;

figure
subplot(2,2,1)
plot(t,V1)
title('Tension 1')
grid on
subplot(2,2,2)
plot(t,V2)
title('Tension 2')
grid on
subplot(2,2,3)
plot(t,V3)
title('Tension 3')
grid on
subplot(2,2,4)
plot(t,V4)
title('Tension 4')
grid on
end
Graficas de tensión y corriente

You might also like