logo elektroda
logo elektroda
X
logo elektroda

LTspice vs ngspice: Why Do I Get Different Results With the Same Netlist?

906 9
Best answers LABEL_AI_GENERATED

Why do LTspice and ngspice produce different transient results when I run the same netlist with the same apparent simulation settings?

They can differ because the two simulators do not necessarily use the same numerical algorithms, convergence tricks, or interpretation of options, even when the netlist looks identical [#21666437][#21666442] Check and compare the actual simulator settings such as reltol, max step time, and min step time, since these can change results dramatically [#21666437][#21666440] If you want meaningful transient detail, first run long enough to get past the initial transient, then zoom in and use a sufficiently small step size for the behavior you care about [#21666440] A useful way to judge which result is “right” is to compare both against a Berkeley-SPICE-compliant simulator benchmark, because different engines may trade accuracy for convergence differently [#21666442] In this thread, the results became comparable once the circuit was corrected so that R2 and R3 had the same value, suggesting the mismatch was tied to an invalid operating condition plus solver differences [#21666443]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
  • Different transient results from LTspice and ngspice

    #1 21666434
    Tiziano B
    Anonymous  
  • ADVERTISEMENT
  • #2 21666435
    Todd Hayden
    Anonymous  
  • ADVERTISEMENT
  • #3 21666436
    Tiziano B
    Anonymous  
  • ADVERTISEMENT
  • Simulator options can cause netlist result differences

    #4 21666437
    Earl Albin
    Anonymous  
  • ADVERTISEMENT
  • LTspice likely more accurate for mixed simulations

    #5 21666438
    Tiziano B
    Anonymous  
  • Limit simulation time to improve resolution

    #6 21666439
    Steve Lawson
    Anonymous  
  • Simulation accuracy depends on transient settings

    #7 21666440
    Earl Albin
    Anonymous  
  • Admits missing simulation parameters in comparison

    #8 21666441
    Tiziano B
    Anonymous  
  • Use Berkeley SPICE as benchmark

    #9 21666442
    Earl Albin
    Anonymous  
  • Matching R2 and R3 makes simulators agree

    #10 21666443
    Tiziano B
    Anonymous  

Topic summary

LABEL_AI_GENERATED
A comparison between LTspice and ngspice simulations using the same netlist revealed significant differences in results. The discrepancies are attributed primarily to differences in simulator algorithms, convergence techniques, and simulation parameters such as relative tolerance (reltol), maximum and minimum step times. Both simulators apply trade-offs between accuracy and convergence speed, which can lead to divergent outputs even with identical netlists. Adjusting component values to theoretically correct conditions yielded more comparable results, indicating that simulation accuracy depends on circuit conditions and solver approaches. It is recommended to benchmark against a Berkeley SPICE-compliant simulator to identify which simulator provides more accurate results. The discussion highlights the importance of understanding transient analysis, steady-state conditions, and simulation parameter tuning to achieve meaningful and comparable outcomes in free SPICE tools.
AI summary based on the discussion. May contain errors.
ADVERTISEMENT