3
\$\begingroup\$

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...?

enter image description here

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

1 Answer 1

6
\$\begingroup\$

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: Small circuit

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: Spice Error Log

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

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.