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...?
-
\$\begingroup\$ Plot settings -> select trace. Or something similar. I can check the exact name when I’m in front of my computer. \$\endgroup\$– winnyCommented Jul 9, 2021 at 10:35
-
\$\begingroup\$ 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 \$\endgroup\$– Hari KrishnaCommented Jul 9, 2021 at 10:40
-
\$\begingroup\$ 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. \$\endgroup\$– FedeWarCommented Jul 9, 2021 at 10:41
-
\$\begingroup\$ V(y) @ x ? didnt get that @FedeWar \$\endgroup\$– Hari KrishnaCommented Jul 9, 2021 at 10:45
-
\$\begingroup\$ Perhaps you can cheat around the problem with a .meas? \$\endgroup\$– winnyCommented Jul 9, 2021 at 10:50
1 Answer
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).
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.