Write a user defined MATLAB program that performs power factor correction. The inputs to the MATLAB function should be
voltage across the load (in Vrms, assume 0 phase), frequency
Resistance of the load
Inductance of the load
power factor of the load
target power factor
The output of the function should be the size of the capacitor that one would need to place in parallel with the load to reach the target power factor.
Please submit the code for the MATLAB function and include a sample command line call to the function showing reasonable inputs and correct outputs.
Provide a generic MATLAB code, an example of a circuit diagram, MAATLAB output, and a backup calculation.
MATLAB code:
clc;
close all;
clear all;
v = input('Enter Voltage across load:');
R = input('Enter R:');
L = input('Enter L:');
p = input('Enter Target Power Factor p:');
f = input('Enter frequency:');
w = 2*pi*f;
x = solve('(R*(1-w^2*L*x) +
w^2*R*L*x)/sqrt((w*L*(1-w^2*L*x)-w*R^2*x)^2+(R*(1-w^2*L*x)+w^2*R*L*x)^2)
= p');
Result:
Enter Voltage across load:6
Enter R:1e3
Enter L:0.01
Enter Target Power Factor p:0.99
Enter frequency:1e4
>> x
x =
8.7955e-009
Capacitor needed to achieve the power factor is 8.8nF
Get Answers For Free
Most questions answered within 1 hours.