I'm simulating with an envlp + pss simulation a rectifier and I would like to estimate the power that goes in input to a subcircuit that implements it. The input voltage of the subcircuit is constant and the current is given by a constant plus an alternating contribution. I tried the following expression, but it gives strange results. I used a dummy voltage generator V2 to calculate the input current. I'm sure there is something of wrong. Does someone know where is the error?
(power = ((harmonic((v("/I35/Vin" ?result "pss-fd.pss")) 0) * harmonic((i("/I35/V2/PLUS" ?result "pss-fd.pss") 0)))) + ((harmonic((v("/I35/Vin" ?result "pss-fd.pss") 0)) * harmonic(rms(i("/I35/V2/PLUS" ?result "pss-fd.pss") 1)))))
Thanks a lot,