# AC power - Simulation and hand calculated values different

1. Dec 4, 2016

### eehelp150

1. The problem statement, all variables and given/known data

2. Relevant equations
P=I*(I*)*R/2

3. The attempt at a solution
R1 = 12
R2 = 20
L = 0.0531H
C = 265.26*10^(-6)F
W = 2*pi*60
L -> jwL = 20j
C = 1/(jwc) = -j10

Mesh equations:
Mesh 1 (left mesh, clockwise)
-Vs +I1(R1+L+C)-I2(C)=0

Mesh2 (right mesh, clockwise)
I2(C+R2)-I1(C)=0

I1=6.78-j5.09
I2=-0.68-j3.73

Hand calculated:
PowerR1 = (I1 * I1conjugate *R1)/2 = 431W
PowerR2 = (I2*I2conjugate*R2)/2 = 143W

PowerL = (I1 * I1conjugate *L)/2=j719.87VAR
PowerC = -j297.79VAR

When I simulate in MATLAB, I get different results for reactive power of L and C:
Matlab provides these following RMS Voltages:
VL = 119
VC = 53.53

PowerL = $\frac{VL^2}{L}$ = -j719.87VAR
PowerC = $\frac{V_C^2}{C}$=j297.79VAR

Is my MATLAB simulation wrong or my hand worked calculations wrong?

2. Dec 4, 2016

### Staff: Mentor

What value are you using for the source voltage?

3. Dec 4, 2016

### eehelp150

Completely forgot that, sorry.
Voltage Source is $120\sqrt2cos(2\pi60)$

4. Dec 4, 2016

### Staff: Mentor

Okay, so it's a 120 V rms source. You'll want to use rms if you're doing power calculations.

5. Dec 4, 2016

### eehelp150

The formula I'm using accounts for RMS, doesn't it? The divided by 2 should account for that.

6. Dec 4, 2016

### Staff: Mentor

I suppose it would. Personally I find it simpler to just use 120V in the calculations and stick to P = VI*, where P is the complex power.

7. Dec 4, 2016

### eehelp150

Is there any reason I'm getting 90degrees (+i) when I calculate it by hand and -90degrees(-i) when I use the measured values from MATLAB?
Note: For "measured" values of power, I am squaring the RMS voltage given by Matlab and dividing by the impedance.

8. Dec 4, 2016

### Staff: Mentor

From what I can see, your RMS voltages from Matlab don't include their phase angles. So only the impedance angle is contributing to the calculation.

9. Dec 4, 2016

### eehelp150

Would it be 'acceptable' to exclude the phase angles? If I recall correctly they are irrelevant without context, right?

10. Dec 4, 2016

### Staff: Mentor

I think it would depend upon what you want to do with the result. If you were determining the power factor for a circuit you'd probably want to know if it were leading or lagging. If you just want to know the magnitude of the reactive power in a component, losing the angle wouldn't matter.

11. Dec 4, 2016

### eehelp150

For percent error I could ignore it right?
The assignment is to solve the circuit by hand and get the real/reactive power for each element.
Then use MATLAB to solve the circuit and get the real/reactive power for each element
Then calculate percent error

12. Dec 4, 2016

### Staff: Mentor

Sure, since I presume you'll be comparing the magnitudes.

13. Dec 4, 2016

### eehelp150

If I want the total reactive power, I just add Q1 and Q2 right?
Do I ignore the phases as well for that?

14. Dec 4, 2016

### Staff: Mentor

I wouldn't ignore the phases for the total. The reactive powers being out of phase will at least partially cancel.

Instead, why not use the complex current supplied by the source and determine the total complex power? Then you can pull out the real and reactive components.

15. Dec 4, 2016

### eehelp150

How would I get total complex power using MATLAB? I can get the RMS Current of the source, but I wouldn't have any degree, only magnitude.

16. Dec 4, 2016

### Staff: Mentor

You used mesh analysis did you not? That gives you the complex current in the first loop...

17. Dec 4, 2016

### eehelp150

Yes, but the professor wants the Total Real/Reactive power measured with MATLAB as well as by hand. I already have the by hand part.

18. Dec 4, 2016

### Staff: Mentor

I don't have any idea how the Matlab portion was implemented, so I can't really advise. Did you write equations or run some kind of simulation?

19. Dec 4, 2016

### eehelp150

I am using Simulink + SimPowerSystems. I think I am only able to get the RMS values.
Edit:
Nevermind. I found a power measurement tool.

20. Dec 4, 2016

### Staff: Mentor

Cool. Sorry I can't be of more help there, I've never used Matlab.