With the following schema:
C1 N002 0 22µR1 N001 N002 220V1 N001 0 5.tran 0.02 startup.meas tran EnergieFournie integ ( 5 * I(R1)).meas tran EnergieDissipee integ ( I(R1) * (V(N002)-V(N001)) ).backanno.end
If I run it, the log file is fiving error (like: Measurement "energiefournie" FAIL'ed ). But if I run each ".meas" command individually, in test mode (right clicking on the command), I get a valid result. What am I doing wrong ?
I tried a little bit with your .MEAS SPICE-directives. When I have removed the parantheses, it has worked.
.meas tran EnergieFournie integ 5*I(R1)
.meas tran EnergieDissipee integ I(R1)*(V(N002)-V(N001))
I highly recommend not tuse the default net names N001 and N002 in .MEAS, because these names can change whenever you change the circuit. Instead name the nets which you use in .MEAS SPICE-directives with specific names.
That was that! Many thanks!