Question

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.

Answer #1

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

Write a MATLAB function and test bench script code to solve the
above simple RL/RC circuits by following the instructions noted
below. The input signal and impulse response generation should be
done in the function. The test bench script should be used only to
call the function and for signal plotting purposes. No plotting
should be done inside the function itself. Name your function
L2_C
Instructions: Input voltage ,x(t), can be AC or DC. Consider a
variable ‘w1’ which can...

You will write a program that loops until the user selects 0 to
exit. In the loop the user interactively selects a menu choice to
compress or decompress a file. There are three menu options: Option
0: allows the user to exit the program.
Option 1: allows the user to compress the specified input file
and store the result in an output file.
Option 2: allows the user to decompress the specified input file
and store the result in an...

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 17 minutes ago

asked 21 minutes ago

asked 21 minutes ago

asked 21 minutes ago

asked 27 minutes ago

asked 28 minutes ago

asked 46 minutes ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago