Menu ▾ ▴

#888 ".option minbreak" is ignored when the transient is started by a "tran" command

v1.0 (example)
open-fixed
None
5
2026-11-01
2026-10-31
No

.option minbreak=... in the netlist, or option minbreak=... in .control, has no effect on a transient started by a tran command. It takes effect when the same analysis is a .tran line started by run.

Version: ngspice-47+, pre-master-48 at 059066b53 (2026-10-05), built from source with the default configure options (XSPICE enabled) plus --without-x --disable-openmp --disable-debug, on macOS 26.5.2, arm64, Apple clang 21.

Run ngspice -b minbreak_tran.cir and ngspice -b minbreak_run.cir (see attached files), with no .spiceinit. The two decks differ only in how the transient is started. With ngspice's default minbreak, this circuit stops at 1 ms. That is a separate bug. minbreak=1e-15 avoids the stop, so whether the run reaches its end shows whether the option was applied.

minbreak_tran.cir:

* .option minbreak=1e-15, transient started by a tran command: the option is ignored and the run fails at 1 ms
V0 a0 0 PWL(0 0 0.000999992 0 0.001 0 0.001000001 1)
V1 a1 0 PWL(0 0 0.000999993 0 0.001 0 0.001000001 1)
V2 a2 0 PWL(0 0 0.000999996 0 0.001 0 0.001000001 1)
V3 a3 0 PWL(0 0 0.000999997 0 0.001 0 0.001000001 1)
R0 a0 out 1k
R1 a1 out 1k
R2 a2 out 1k
R3 a3 out 1k
C1 out 0 1n
.option minbreak=1e-15
.control
tran 2n 0.001002 0.000999 4n
print vecmax(time)
quit
.endc
.end

minbreak_run.cir replaces the tran command with a .tran line and run, and the run then succeeds.

.option minbreak=1e-15
.tran 2n 0.001002 0.000999 4n
.control
run
print vecmax(time)
quit
.endc
.end

Giving the option as option minbreak=1e-15 inside .control behaves the same way: the tran command ignores it, and run applies it.

Cause, in brief

The task built for an analysis command copies each option from the circuit's default task except minBreak, delmin and fixLimit (src/spicelib/analysis/cktntask.c, lines 51, 62 and 69). The new task is zero-filled, so minbreak reads as 0 there, and DCtran falls back to its default. The attached ROOT_CAUSE.md traces it through the code and suggests a fix.

1 Attachments

Discussion

  • Holger Vogt

    Holger Vogt - 2026-11-01
    • status: open --> open-fixed
    • assigned_to: Holger Vogt
     
  • Holger Vogt

    Holger Vogt - 2026-11-01

    Fixed by commit to git branch pre-master-48.

     

Log in to post a comment.