¿ªÔÆÌåÓý

Using parameters and functions when defining a plot


 

Is it possible to scale a trace by a parameter defined on the schematic?

Like:? .param maxvolts=122, and then plot V(c1)/maxvolts . Such a thing works when adding the parameter statement to the plotdef file in the scad3.exe directory, but that is not very?handy because these constants aren't universal?(in the project directory would be better already).


Likewise, I sometimes scale a plot by a computed number, say the max value of the current when doing an FFT. It would be nice if these constants could be evaluated before a plot is made ( V(c1)/max(V(c1)) or something like that?


-marcel


 

Hello

You could add a few bits to the schematic, such as abs(v(c1)) with an ideal diode + capacitor, then use that voltage, say v(max), to divide the final answer, v(c1)/v(max). If you want to avoid doing this manually, everytime you plot v(c1), you could simply add a B-source to your liking with that expression.
There could be another solution with the integrated S&H, but that would require a clock, or others, it's just a suggestion.


Vlad
______________________
-- holding, among others:
a universal analog/digital filter, block-level models
for power electronics (and not only), math blocks
with a more stream-lined approach, some digital
ADC, DAC, (synchronous-)counter, JKflop, etc.