Closed Rmano closed 5 years ago
On Tue, Jan 29, 2019 at 02:25:13AM -0800, Romano Giannetti wrote:
So, I probably am in for a scolding, but... can anyone explain to me this? Shouldn't Pr1.P equal to Pr1.V multiplied Pr1.I?
in wprobe.cc
line 57, the voltage is computed, stored as Vr. in line 68 it should be used... possibly something else is wrong.
hmmm:
void wprobe::saveOperatingPoints (void) {
nr_double_t Vr = real (getV (NODE_3) - getV (NODE_4));
nr_double_t Vi = imag (getV (NODE_3) - getV (NODE_4));
setOperatingPoint ("Vr", Vr);
setOperatingPoint ("Vi", Vi); //This section works just like a voltmeter
}
//For specific information regarding The Power triangle and Power factor:
//https://en.wikipedia.org/wiki/Power_factor#Definition_and_calculation
void wprobe::calcOperatingPoints (void) {
//Reading the current and voltage values to calculate power values
nr_double_t VAr = real (getV (NODE_3) * getJ (NODE_1));
nr_double_t VAi = -imag (getV (NODE_3) * getJ (NODE_1));
Could be a node name typo? Where are the NODE_x correspondences defined?
On Tue, Jan 29, 2019 at 02:54:27AM -0800, Romano Giannetti wrote:
hmmm:
void wprobe::saveOperatingPoints (void) { nr_double_t Vr = real (getV (NODE_3) - getV (NODE_4)); nr_double_t Vi = imag (getV (NODE_3) - getV (NODE_4)); setOperatingPoint ("Vr", Vr); setOperatingPoint ("Vi", Vi); //This section works just like a voltmeter } //For specific information regarding The Power triangle and Power factor: //https://en.wikipedia.org/wiki/Power_factor#Definition_and_calculation void wprobe::calcOperatingPoints (void) { //Reading the current and voltage values to calculate power values nr_double_t VAr = real (getV (NODE_3) * getJ (NODE_1)); nr_double_t VAi = -imag (getV (NODE_3) * getJ (NODE_1));
Could be a node name typo? Where are the NODE_x correspondences defined?
don't know.
just do it as in line 57, it seems correct. perhaps you need to multiply first, and then take the real part. so you can't just use Vr.
The correct formula should be:
VAr = real ( (getV(NODE_C)-getV(NODE_D)) * (current through AB) )
and the imaginary part the same.
This patch seems to fix it, and it feels right:
@@ -65,8 +65,8 @@ void wprobe::saveOperatingPoints (void) {
void wprobe::calcOperatingPoints (void) {
//Reading the current and voltage values to calculate power values
- nr_double_t VAr = real (getV (NODE_3) * getJ (NODE_1));
- nr_double_t VAi = -imag (getV (NODE_3) * getJ (NODE_1));
+ nr_double_t VAr = real ((getV (NODE_3) - getV(NODE_4)) * getJ (NODE_1));
+ nr_double_t VAi = -imag ((getV (NODE_3) - getV(NODE_4)) * getJ (NODE_1));
setOperatingPoint ("VAr", VAr);
setOperatingPoint ("VAi", VAi);
Would you like to have a pull request? Against which branch? I think this is quite urgent...
On Tue, Jan 29, 2019 at 03:26:39AM -0800, Romano Giannetti wrote:
Would you like to have a pull request? Against which branch? I think this is quite urgent...
perhaps it should go into the the next release candidate, i think we have a "hotfix" or so branch.
thanks
So, I probably am in for a scolding, but... can anyone explain to me this? Shouldn't Pr1.P equal to Pr1.V multiplied Pr1.I?
The netlist is: