Uploaded by Gazi Ertugrul

MATLAB Script for instantaneous voltage

advertisement
clear all; close all; clc;
f = 50; %frequency
t= 0 : .00001 : (1/f); %time array
Vm = 10; %peak voltage in Volts
theta_V = 0;
v = Vm*sin (2 * pi * f * t + theta_V); %voltage aarray
L = 6.4e-3; %Inductane in Henry
Xl = 2*pi*f*L;
Z = 0 + j*Xl; % Impdance of load
angle_Z = angle(Z); %impedance angle
Im = Vm / abs (Z); %magnitude of load current in Ampere
i = Im*sin(2*pi*f*t-angle_Z); %current array
plot(t, v, t, i);
hold on
p_L = v.*i; %instantaneous power
plot(t, p_L,'*')
xlabel('time axis')
ylabel('voltage,current and power')
legend('Voltage','Current','Power')
title('instantaneous quantities of Inductor')
grid on
Download