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:
- In .AC plots, Freq(uency) and Omega are also recognised.
- 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..).
- "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.
- .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, {}.
- 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