Qucs / qucsator

Circuit simulator of the Qucs project
http://qucs.sourceforge.net
GNU General Public License v2.0
24 stars 12 forks source link

Power probe AC results are wrong #47

Open in3otd opened 4 years ago

in3otd commented 4 years ago

The power probe (wprobe) gives wrong results when used with AC simulations:

see this circuit simulation (circuit taken from here): image note that the overall power values are correct but that the resistor is apparently generating power and has a significant reactive power component...

The issue is due to a wrong basic calculation of the power in the wprobe component, as in practice it computes the complex power as S = V I and flips the sign of the reactive power instead of using S = V I*. So when using the probe to compute the power provided by a source, so measuring the voltage across the source, the current calculation works, as the voltage from the source is purely real. But when measuring across a component, as shown above, the voltage has a phase different from zero and the results are wrong.

After correcting the formula used the results are fine: image

I'll open a PR with the fix soon...

in3otd commented 4 years ago

...and also voltage noise results from the power probe are wrong image