开云体育

Plotting expressions in LTSPICE


 

Hi,

?

? I am trying to plot a few graphs in LTSPICE XVII and have a couple of queries. Hope someone will answer:

?

** Can I define a constant capacitance value in LTSPICE such as Cox = 8.5fF/u^2 so that after simulation, I can manipulate the graph to plot expressions like fT = gm/2*3.14*W*L*Cox? If I simply use the magnitude of Cox as 8.5f in Expression Editor, though I get the graph, the unit of the Y-axis isn’t frequency (as it should be). I event tried by saving the value in “plot.defs” file. I am still getting the same graph with the unit on Y axis as something else. Basically, the Farad quantity is getting neglected and only the numerical value is getting used. ?The x-axis is a voltage source (swept by a dc sweep command).



** As I know, after the simulation, I can manipulate the graph to plot expressions on the y-axis (such as for fT as in above query). Is it possible to plot a graph with expressions on both Y axis and X axis? For eg. how to plot a graph of fT vs gm/Id (where the fT expression will be on y axis and ‘gm/Id’ expression on x axis).

?


Looking towards your pointers.

?

Thanks and regards,

Arvind Gupta


 

开云体育

What you want to do can be done. Note the following:

  1. In the Cox formula, LTspice stops parsing after the 'f'. What is 'u' anyway? Is it a fixed voltage?
  2. You say that the y-axis unit isn't frequency, but you don't help us by saying what it is. If it is volts, divide the formula by (1V*1s).
  3. You often have to divide a node voltage or current (which is what can be plotted) by '1 unit' to get the y-axis unit correct. For example, if you apply a 1 A current generator to a node and plot the node voltage, to get the y-axis to be 'ohms', you plot 'Vnode/1A'.
  4. You can plot an expression on the x-axis, unless you have done an AC sweep. Right-click on it and you get a pane in which you can type the variable you want to plot. For example, you can enter 'V(in)' to use the input voltage as the x-axis. With an AC sweep, you can only have frequency as the x-axis.
======================================================================================
Best wishes John Woodgate OOO-Own Opinions Only

Rayleigh, Essex UK

I hear, and I forget. I see, and I remember. I do, and I understand. Xunzi (340 - 245 BC)


On 2023-07-06 08:13, garvind25@... wrote:

Hi,

?

? I am trying to plot a few graphs in LTSPICE XVII and have a couple of queries. Hope someone will answer:

?

** Can I define a constant capacitance value in LTSPICE such as Cox = 8.5fF/u^2 so that after simulation, I can manipulate the graph to plot expressions like fT = gm/2*3.14*W*L*Cox? If I simply use the magnitude of Cox as 8.5f in Expression Editor, though I get the graph, the unit of the Y-axis isn’t frequency (as it should be). I event tried by saving the value in “plot.defs” file. I am still getting the same graph with the unit on Y axis as something else. Basically, the Farad quantity is getting neglected and only the numerical value is getting used. ?The x-axis is a voltage source (swept by a dc sweep command).



** As I know, after the simulation, I can manipulate the graph to plot expressions on the y-axis (such as for fT as in above query). Is it possible to plot a graph with expressions on both Y axis and X axis? For eg. how to plot a graph of fT vs gm/Id (where the fT expression will be on y axis and ‘gm/Id’ expression on x axis).

?


Looking towards your pointers.

?

Thanks and regards,

Arvind Gupta


 
Edited

On 06/07/2023 09:13, garvind25@... wrote:

I am trying to plot a few graphs in LTSPICE XVII and have a couple of queries. Hope someone will answer:

?

** Can I define a constant capacitance value in LTSPICE such as Cox = 8.5fF/u^2 so that after simulation, I can manipulate the graph to plot expressions like fT = gm/2*3.14*W*L*Cox? If I simply use the magnitude of Cox as 8.5f in Expression Editor, though I get the graph, the unit of the Y-axis isn’t frequency (as it should be). I event tried by saving the value in “plot.defs” file. I am still getting the same graph with the unit on Y axis as something else. Basically, the Farad quantity is getting neglected and only the numerical value is getting used. ?The x-axis is a voltage source (swept by a dc sweep command).



** As I know, after the simulation, I can manipulate the graph to plot expressions on the y-axis (such as for fT as in above query). Is it possible to plot a graph with expressions on both Y axis and X axis? For eg. how to plot a graph of fT vs gm/Id (where the fT expression will be on y axis and ‘gm/Id’ expression on x axis).

As a general rule, expressions in the waveform window can only comprise waveforms that are available in the "Add Traces to Plot" dialogue and constants. However, there are exceptions:
  1. In .AC plots, Freq(uency) and Omega are also recognised.
  2. Some other "constants" are also available for use in expressions: "k" or "K" is Boltzmann's constant and "q" or "Q", the elementary charge, pi, and "e" or "E" (2.7182..).
  3. "K" is always recognised as Boltzmann's constant, unless it is immediately preceded by an number, when it reverts to 1000x. Ditto "E", when used as, e.g. 1E-6. All other range multipliers up to "T" (1E12) and down to "f" (1E-15) are unambiguous. There is no case distinction.
  4. .Parameters defined in the schematic are normally not recognised, unless they are stepped, then they are available for use in expressions. It is not necessary to use braces, {}.
  5. The only units that are accepted in expressions are V, A and s. But LTspice provides "derived" units in axes annotations, if it can work out what they should be. Whether that's a benefit or cause for confusion is an open question. So, normally, LTspice can easily work out annotations of V, A, W and ?. Siemens (or mhos) are denoted as ?-1, but I guess it could have used the symbol, ?. Other units it might not present succinctly.

If you want to plot or use gm, then remember it is dI/dV, so you can use the d() operator.

?

Is it possible to plot a graph with expressions on both Y axis and X axis?

?

Did you try it? Depending on the analysis mode, expressions can be used for both axes. .AC plots can only use Frequency for the X-axis. It's not hard to work out why.

Except for plotting expressions, units are generally ignored in LTspice. So remember, 1F is the same as 1fF. When a range multiplier is encountered, it also acts as a delimiter, ignoring everything non-numeric that follows. So, 3k3=3300, but 1A=1V=1.

Certain things saved in plot.defs are very useful in plot expressions, but since customisation of plot.defs in kind of encouraged, it is inherently non-portable. So, for example, I have a function: dB(x)=20.log10(x), which makes trace titles much neater, but will cause an error for anyone else that does not have this function defined.

Nothing added to plot.defs will work until LTspice is closed down and re-started.


--
Regards,
Tony


 

Thanks for the quick reply. Pls find below the answers to your queries:

?

Pls read the value of Cox as 8.5fF/um^2. It is the oxide capacitance per unit area. While implementing the formula fT = gm/2*3.14*W*L*Cox, W and L are MOSFET sizes in um.

?

The y-axis is in ohm-1 (ohm inverse or siemens). This is the unit of gm. In other words, while implementing the above fT formula, the y-axis is taking the units of gm only. It should be of frequency (in Hz or KHz etc)

?

Thanks again,

Arvind Gupta

?


 

开云体育

On 06/07/2023 10:54, Tony Casey wrote:
In .AC plots, Freq(uency) and Omega are also recognised.
I forgot: in .TRAN plots, "time" is also recognised. See:

Help ?? LTspice XVII ?? Waveform Viewer ?? Waveform Arithmetic

..for definitive information.

--
Regards,
Tony


 

开云体育

On 06/07/2023 11:02, garvind25@... wrote:

Pls read the value of Cox as 8.5fF/um^2. It is the oxide capacitance per unit area. While implementing the formula fT = gm/2*3.14*W*L*Cox, W and L are MOSFET sizes in um.

?

The y-axis is in ohm-1 (ohm inverse or siemens). This is the unit of gm. In other words, while implementing the above fT formula, the y-axis is taking the units of gm only. It should be of frequency (in Hz or KHz etc)

In the Files section of the group's archives, there is a demo schematic that shows how to plot Ft vs. Id. Once you understand how it works, you can adapt it to .MEASure gm as well as Ft, then you can also plot Ft vs. gm.

--
Regards,
Tony