2
\$\begingroup\$

How do I plot power in LTSPICE ?

I browsed a few tutorials. Acc to them, you click and ALT on the element you want to find power of.

But my problem is I do not have a schematic. I prefer to build circuits with netlists. How do I plot power now ?

Also there is this strange problem that .plot statement generates an empty plot pane and we have to manually add traces. How do overcome this problem ?

I am including a simple inverter netlist for reference.

***Inverter***

M1 pdrain pgate psource psource PMOS_1
M2 pdrain pgate 0 0 NMOS_1
C1 pdrain 0 100f

Vin pgate 0 PULSE 0 3.3 10ns 1ns 1ns 20ns 41ns
Vdd psource 0 DC 3.3

.model NMOS_1 NMOS (LEVEL=2 W=2.88u L=1.44u VT0=6E-01 KP=20E-06    GAMMA=5E-01 LAMBDA=5E-02)

.model PMOS_1 PMOS (LEVEL=2 W=5.76u L=1.44u VT0=-6E-01 KP=7E-06 GAMMA=5E-01 LAMBDA=1E-01)

.tran 0.1p 50n
.plot tran V(pdrain)

.end
\$\endgroup\$
  • \$\begingroup\$ Isn't it just .plot tran (V(pdrain)*I(pdrain))? \$\endgroup\$ – Puffafish Feb 24 '16 at 13:04
  • \$\begingroup\$ @AndyHall. I tried that. As mentioned at the end of the post, .plot command only gives an empty pane (always) and I have to manually pick traces from the list. And in the list there are only either voltages or currents. Nothing else \$\endgroup\$ – Plutonium smuggler Feb 24 '16 at 13:07
  • 1
    \$\begingroup\$ besides that ltspice isn't really meant to be used with netlists only, power is just a multiplication of some voltage and current, and if you can display those fine, the multiplication displays fine too, at least on my installation. \$\endgroup\$ – PlasmaHH Feb 24 '16 at 13:35
  • \$\begingroup\$ @PlasmaHH. Agree. But again to reiterate, the entire problem is that plot gives an empty pane w/o any trace. In the pick visible traces, only voltages and current are there. I dont know why this is happening (LTspice on ubuntu using WINE) \$\endgroup\$ – Plutonium smuggler Feb 24 '16 at 13:38
  • 1
    \$\begingroup\$ If you like to like to work with netlists, that's one thing, but part of the nice of LTspice is that it'll do all that gruntwork for you if you'll just draw the schematic, which you have to do anyway, eventually. I'm not trying to be critical, I'm just saying... \$\endgroup\$ – EM Fields Feb 24 '16 at 14:51
1
\$\begingroup\$

Ok. I figured out the answer (accidentally).

The whole problem was that .plot command was generating an empty plot pane and I had to explicitly pick traces from the list. In the list there were only currents and voltages.

So to plot another expression involving currents and voltages do this:

1) Pick visible traces by clicking on icon and plot something.

2) On the top of the pane, right click the name of the quantity plotted (Cursor changes to hand icon there). For instance, if you plot V(pdrain) as in example, right click it (which appears at the top in color)

3) A dialogue box appears in which you can input the desired expression. I entered V(pdrain)*Id(M1) instead of V(pdrain)

If someone would like to answer or solve the problem such that entire thing can be done from .plot command only without explicitly picking up traces, please feel free to answer.

\$\endgroup\$
  • 2
    \$\begingroup\$ The thing with ltspice is that it seems to internally run the simulation with all the commands, creating a .raw file with all the data, and then the gui takes over and you plot the stuff you want. Anyways you can make this thing a tiny bit quicker by hitting CTRL+A in the plot window, then copypasta your desired plot points space separated into the input box. For keeping them attached to the schematics I recommend adding a comment to your schematic \$\endgroup\$ – PlasmaHH Feb 24 '16 at 14:17
  • \$\begingroup\$ @PlasmaHH. Yes it does seem to work (And is definitely better than my workaround). Thanks ! \$\endgroup\$ – Plutonium smuggler Feb 24 '16 at 14:30
-1
\$\begingroup\$

In the following example, I'm using Win7 pro I've drawn a common emitter amplifier with a ramp feeding its base and done a transient sim. As the current into Q1 base increases, the transistor's dissipation will increase until it equals the power dissipated by R1, after which it [the power being dissipated by Q1] will decrease; a beautiful example of maximum power being dissipated by a load (Q1) when its impedance matches the source impedance.

But I digress...

To plot the power dissipated by Q1, hold down the ALT key and mouse the cursor over Q1. You'll see a little thermometer icon pop up, (as shown below) and when it does, left click the mouse and release ALT.

When you click the mouse, the power dissipated by Q1 will be plotted as a function of time.

If you want to, you can also probe around and plot other other stuff on the same screen, and I,ve plotted V2 to see how the power varies with changes uin V2,

If you want to find average power, Hold down the CTRL key, mouse over to the relevant plot text, and left-click on it. A little box will pop up with the data in it.

enter image description here

\$\endgroup\$
  • 4
    \$\begingroup\$ This answer misses the point completely. The user knows how to measure this, which is clear in the second sentence. The problem is that he does not want to use the schematic capture option, but run it from a manually crafted netlist. Thus, there is nothing to click on. \$\endgroup\$ – pipe Feb 24 '16 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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