Electronics > Beginners

How to get numerical results out of LTspice

(1/1)

ocset:
Hi ,
Supposing i want to get the power dissipated in a fet (or say the sum of power dissipated in two fets) to be spat out into the error log file (or wherever)  after a ltspice transient analysis sim has been run...do you know how i do that?

Eg in the attached, how do i get it to automatically spit out the result of
V(N016)*I(R1)  +  V(N017)*I(R2)

..eg spit it out into a log file or whatever

bson:
LTspice doesn't seem to have .echo or .print, but it does seem to have .meas, so it should be possible to add a ".meas V(N016)*I(R1)+V(N017)*I(R2)" directive somewhere following your .tran and find the results in the log.  (cmd-L on mac)  The result is a vector, probably of some trivial size for a transient analysis (I'm guessing).

macboy:
Power is measured at a point in time, so it is best to plot the values you are interested in an analyze the plot.
Alt-Click (left click) on a component to plot its power. The, in the plot plane, you can Ctl-Click the name of the trace ("V(N016)*I(R1)" or whatever) to get the Average, Integral, and other things.  You can also right-click to edit the expression, so that you can, for example, combine power dissipation of two components together in a single plot.
You can also the .MEASURE to do powerful things. Look up the help. A simple example is:
.measure TotalFetPower  AVG  V(N016)*I(R1)+V(N017)*I(R2)
.measure TotalPeakFetPower  MAX  V(N016)*I(R1)+V(N017)*I(R2)

iMo:
For example

Ian.M:
You can do all sorts of stuff with .measure. e.g:

--- Code: ---.measure tran period10  trig  V(vlc)=0  rise=1 targ V(vlc)=0  rise=11
.measure tran frequency param 1/period10
--- End code ---
measures the time between the first and eleventh rising edge zero crossing of a signal named 'vlc' (i.e. ten whole cycles), then computes its frequency.

N.B. if you don't want the nodes you are plotting or using for .measure to 'hop' around  :-// when you make a very small change to your circuit,  name *EACH* and *EVERY* node you want to plot or measure.

The key to success with .measure is RTFM and experimentation with a simple test circuit!


However, especially when dealing with power dissipated, it can be helpful to low pass filter the instantaneous value of the expression one wants to plot or measure, before attempting to plot it or take measurements off it.  This is quite difficult to do using waveform maths and its often more convenient to create a behavioural voltage source on the schematic to perform the calculation, then put it through a RC filter with an appropriate time constant and a named output node for convenient plotting or measurement.

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod