¿ªÔÆÌåÓý

How to extract a value from a STEP run to use in .measure?


 

I'm running a simulation with a parameter to optimise, so I use a "step" command and then ".measure" to look at the calculated value as the step variable changes in the spice error log which shows a table of values. ?So if one of the table values is a value I want to use later how can I extract the value?


For instance:


.measure tran i_in_avg AVG(I(V3)*-1) FROM start TO end


returns a table of six values below:


Measurement: i_in_avg

? step AVG(i(v3)*-1) FROM TO

? ? ?1 0.974689 4e-006 5e-006

? ? ?2 1.16049 4e-006 5e-006

? ? ?3 1.28148 4e-006 5e-006

? ? ?4 1.27502 4e-006 5e-006

? ? ?5 1.14129 4e-006 5e-006

? ? ?6 0.945641 4e-006 5e-006


looking at this table in the error file I can see the value at step 3 is my optimum value, but how do I get it out and pass it to a parameter to return in the same error log file?


Thanks all.


 

To my knowledge, you can't, but there was someone some time ago working on a least-squares algorithm and he used the .WAVE command to write and then WAVEFILE for voltage(/current) source to read the values between simulations (sort of like a swap memory). Maybe this rings a bell?


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.