Post Go back to editing

.STEP log file issue

Thread Summary

The user reported that in LTspice, the .step parameter values in the log file were being rounded to 6 digits, causing issues with scripting tools like PyLTSpice. The issue was fixed in LTspice 24.0.9, with full precision values now reported, though the order of steps and some report parameters changed. In LTspice 24.1.3, the .step command generated 12 steps instead of 11 due to binary floating-point precision, but this was improved in 24.1.10, with only the last step being unnecessarily repeated.
AI Generated Content
Category: Software
Product Number: LTSpice
Software Version: 17.1.11

Hello,

When I run following netlist:

* test1.net: Test of .step
R1 N001 0 1k
V1 N001 0 {volt}
.step param volt 100 100.001 .1m
.tran 1
.meas tran volt2 param volt
.options numdgt = 15
.options measdgt = 15
.end

the steps in log are rounded to 6 digits:

Circuit: * test1.net: Test of .step

Direct Newton iteration for .op point succeeded.
.step volt=100
.step volt=100
.step volt=100
.step volt=100
.step volt=100
.step volt=100.001
.step volt=100.001
.step volt=100.001
.step volt=100.001
.step volt=100.001
.step volt=100.001


Measurement: volt2
  step    volt
     1    100
     2    100.0001
     3    100.0002
     4    100.0003
     5    100.0004
     6    100.0005
     7    100.0006
     8    100.0007
     9    100.0008
    10    100.0009
    11    100.001


Date: Tue Oct 24 08:17:24 2023
Total elapsed time: 0.601 seconds.

tnom = 27
temp = 27
method = modified trap
totiter = 2091
traniter = 2088
tranpoints = 1045
accept = 1045
rejected = 0
matrix size = 2
fillins = 0
solver = Normal
Avg thread counts: 4.5/8.1/8.1/4.5
Matrix Compiler1: off  [0.0]/0.0/0.0
Matrix Compiler2: off  [0.0]/0.0/0.0
 

Simulation, measurements works properly but this logfile data. There is a workaround but it is a big inconvenience especially when using scripting, like PyLTSpice which relies on the log file.

Is it normal? Can it be changed by settings? Or if not, will it be fixed?

Best regards,

pavo

  • Dear  ,

    Thank you for bringing this to our attention. The next release will have this changed. The values will be reported with full precision.

    Best Regards,
    Mathias

  • Dear Mathias,

    Thank you, I appreciate. Looking forward an update then.

    Best regards,

    pavo

    Edit 2024-02-19:

    Hi,

    I can see in 24.0.9 it is fixed.

     

    LTspice 24.0.9 for Windows

    Circuit: * test1.net: Test of .step

    Start Time: Mon Feb 19 09:41:15 2024

    solver = Normal

    Maximum thread count: 20

     

     

     

    Direct Newton iteration for .op point succeeded.

    .step volt=100

     

     

     

    .step volt=100.0001

     

     

     

    .step volt=100.0002

     

     

     

    .step volt=100.0003

     

     

     

    .step volt=100.0004

     

     

     

    .step volt=100.0005

     

     

     

    .step volt=100.0006

     

     

     

    .step volt=100.0007

     

     

     

    .step volt=100.0008

     

     

     

    .step volt=100.0009

    tnom = 27

    temp = 27

    method = modified trap

    .step volt=100.001

     

     

    Measurement: volt2

      step volt

         1 100

         2 100.0001

         3 100.0002

         4 100.0003

         5 100.0004

         6 100.0005

         7 100.0006

         8 100.0007

         9 100.0008

        10 100.0009

        11 100.001

     

    Total

     elapsed time: 0.216 seconds.

    Now It can be seen some mess in the lines order, extra blank lines and less report parameters comparing to 17.1.15, but the goal of this fix is reached I’d say. Thank you!

    Best regards,

    pavo

  • Dear 

    Bringing back the old topic... Since version 24.1.3 running the above netlist gives steps shorter than set. We get 12 steps instead of 11.
    We have:

    .step param volt 100 100.001 .1m

    but we get:

    LTspice 24.1.7 for Windows
    Circuit: C:\dokumenty\ltspice\test\test1.net
    Start Time: Tue Apr 15 15:09:45 2025
    Options: numdgt = 15  measdgt = 15
    solver = Alternate
    Maximum thread count: 20
    tnom = 27
    temp = 27
    method = Gear
    Direct Newton iteration for .op point succeeded.
    .step volt=100
    .step volt=100.000090909091
    .step volt=100.000181818182
    .step volt=100.000272727273
    .step volt=100.000363636364
    .step volt=100.000454545455
    .step volt=100.000545454545
    .step volt=100.000636363636
    .step volt=100.000727272727
    .step volt=100.000818181818
    .step volt=100.000909090909
    .step volt=100.001
    Total elapsed time: 0.615 seconds.

    Files loaded:
    C:\dokumenty\ltspice\test\test1.net


    Measurement: volt2
      step    volt
         1    100
         2    100.000090909091
         3    100.000181818182
         4    100.000272727273
         5    100.000363636364
         6    100.000454545455
         7    100.000545454545
         8    100.000636363636
         9    100.000727272727
        10    100.000818181818
        11    100.000909090909
        12    100.001

    Please, take a look.

    pavo

  • Hi  ,

    Will take a look. Thanks.

    mike

  • Dear  ,

    .step is handled completely differently by LTspice 24.1.x. It calculates the number of steps upfront. Your case is interesting, because the difference 100.001 - 100 = 0.001 is not representable in binary floating point. Instead, it is

    0.00100000004749745130...

    As a result, the program determines that one more step is needed. There isn't really a universal solution to this problem of limited machine precision.

    I'll have a look, there a are certainly ways to improve this.

    Best Regards,
    Mathias

  • Dear  

    Ok, then no big issue if we know the root cause. Hope will be somehow improved. Thank you.

    Best regards,
    pavo

    --------------------------
    Update 2025-09-10

    Hi

    It looks like in 24.1.10 it is improved:

    .step volt=100
    .step volt=100.0001
    .step volt=100.0002
    .step volt=100.0003
    .step volt=100.0004
    .step volt=100.0005
    .step volt=100.0006
    .step volt=100.0007
    .step volt=100.0008
    .step volt=100.0009
    .step volt=100.001
    .step volt=100.001 
     

    Only the last step is unnecessarily repeated but it's a minor issue.

    LTspice 24.1.10 for Windows
    Circuit: C:\dokumenty\ltspice\test\test1.net
    Start Time: Wed Sep 10 12:03:25 2025
    Options: numdgt = 15  measdgt = 15
    solver = Alternate
    Maximum thread count: 20
    tnom = 27
    temp = 27
    method = Gear
    Direct Newton iteration for .op point succeeded.
    .step volt=100
    .step volt=100.0001
    .step volt=100.0002
    .step volt=100.0003
    .step volt=100.0004
    .step volt=100.0005
    .step volt=100.0006
    .step volt=100.0007
    .step volt=100.0008
    .step volt=100.0009
    .step volt=100.001
    .step volt=100.001
    Total elapsed time: 0.624 seconds.
    
    Files loaded:
    C:\dokumenty\ltspice\test\test1.net
    
    
    Measurement: volt2
      step	volt
         1	100
         2	100.0001
         3	100.0002
         4	100.0003
         5	100.0004
         6	100.0005
         7	100.0006
         8	100.0007
         9	100.0008
        10	100.0009
        11	100.001
        12	100.001
    
    Kind regards
    pavo