# How to integrate in LTSPICE when .step is used?

I know that I can integrate any value in a LTSPICE using CTRL+LEFT_MOUSE. But now I used .step param Y 0 10 1 to vary my input. And my aim was to get the energy consumed for different input, thus I need to integrate the product of current and Vdd. That is showing some error. Is there anyway to do it without changing the .step...?

• Plot settings -> select trace. Or something similar. I can check the exact name when I’m in front of my computer. Commented Jul 9, 2021 at 10:35
• I generally do that , it will display the voltages and currents in the circuit. But when I use the .step param , no new node is named. Its like there is only one Vm(2) / Im(2) but when I plot it it will be multiple. I want to integrate it separately. @winny Commented Jul 9, 2021 at 10:40
• If I remember correctly you can show only a single trace with the syntax V(y) @ x, change x with the number of the trace you want to plot (e.g. 1,2,3...), and V(y) with the node or current. Commented Jul 9, 2021 at 10:41
• V(y) @ x ? didnt get that @FedeWar Commented Jul 9, 2021 at 10:45
• Perhaps you can cheat around the problem with a .meas? Commented Jul 9, 2021 at 10:50

Sadly it is not possible with the graphical interface as it is.

What you can do to get around that limitation is use a .meas statement to do the integration for you.

I have drawn a very simple example:

With this measurement statement:

.meas TRAN Energy INTEG V(n001)*I(R1) FROM 0 TO 1

LTSpice will compute the integral of the expression V(n001)*I(R1) from 0 s to 1 s.

The results will be displayed in the SPICE Error Log (under view).

Which looks like this:

With a right click, you can plot the stepped data and get a result like this:

The X axis contains the actual step value (in my case resistance running from 1 to 101 ohm) and the Y axis is the measurement result (in this case the energy when integrating over 1 second from the start.

Read up on the .meas statement in the help, but the interface for it (place a .meas on the sheet and right click it) is quite comprehensive.

Side note as you didn't understand what @winny meant with using @ in the plot environment:

If you enter V(n001)*I(R1) @ 1 instead of V(n001)*I(R1) into the expression to plot, it will only show you the plot of that specific step. This is nice if you have a step which is doing extraordinary things and you want to inspect it closer and get less confused.

It does not allow you to integrate with the CTRL + Left Click functionality though.