¿ªÔÆÌåÓý

Re: .MEAS Failure


 

¿ªÔÆÌåÓý

On 25/02/2025 08:53, eewiz via groups.io wrote:
Yes, I agree.
Rather than assume such was true, I sought to prove that in my case there actually was no 2.0000000000 volts.
In general, it is usually impossible to prove the non-existence of something.
Therefore the effect, however it may be accomplished, is to print the time at which the next sample found is LESS-THAN 2 volts.
?
Wouldn't it be a phenomnal waste of processor time to interpolate between points, following the resultant curve, to find a point on that curve that is exactly 2.0000000000 volts when simply looking for the first value of data less-than 2 volts provides the same result.
Hardly a phenomenal waste of processor power. Linear interpolation between two points is a trivially simple operation. The .MEAS already finds the last data point before, and the first data point after the target is reached. Interpolation means you always get a more accurate answer even when not using very small values of maximum timestep, with very little overhead.
?
Regardless of how it is accomplished, the end result of using FALL=1 is to print the time at which the first data value less-than 2 is found.
This is obviously not true. The end result of using FALL=1 is to print out the interpolated value.

The reason why you found that apparently two points at the same time had two different voltages is due the printed precision of the time points. The time points are printed in single precision in the logfile. You can get double precision by adding .option measdgt=15. This is true whether or not you also use .option numdgt=15.

For example, to find the first falling value of 0, I added:

.MEAS T1 when V(test)=0 fall=1

..when analysing a 0.999Hz sine wave with .TRAN 1.1. By default the logfile was:

LTspice 24.0.12 for Windows
Circuit: * C:\users\tony\Desktop\LTspice\_Temp\Eewiz\MEAS_example.asc
Start Time: Tue Feb 25 10:09:09 2025
solver = Normal
Maximum thread count: 32
tnom = 27
temp = 27
method = modified trap
Direct Newton iteration for .op point succeeded.

t1: v(test)=0 AT 0.500501

Total elapsed time: 0.054 seconds.

After adding .option measdgt=15:

LTspice 24.0.12 for Windows
Circuit: * C:\users\tony\Desktop\LTspice\_Temp\Eewiz\MEAS_example.asc
Start Time: Tue Feb 25 10:10:33 2025
solver = Normal
Maximum thread count: 32
tnom = 27
temp = 27
method = modified trap
Direct Newton iteration for .op point succeeded.

t1: v(test)=0 AT 0.500500582598

Total elapsed time: 0.044 seconds.
Note: this option is sticky. It remains active for the session (until you close and restart LTspice), even if it is removed. Whether this is intended or not is not known. AFAIK, it is not documented.

--
Regards,
Tony`

Join [email protected] to automatically receive all group messages.