The attached circuit does not work as expected.
A "set rndseed=33" in a control section does not have
the expected effect that multiple runs of the file all
give exactly the same output. Using the command in
spinit is OK, but less convenient.
-marcel
test rndseed v1 1 0 DC 150 trnoise ( 1V 10m 0 0 ) .tran 0.01 0.4 .control set rndseed=33 run plot -i(v1) .endc .end
Diff:
Here is a possible fix that allows to set rndseed on the
OS shell commandline before running ngspice. Setting rndseed
in the spinit file should also be OK. Setting rndseed in
a control section will not work.
The observed behavior of rndseed is not a bug as
it is clearly documented in the manual that rndseed
should be changed in the spinit or .spiceinit file.
Setting it in a .control section is not mentioned
anywhere.
That the patch causes rndseed to be (also) under
control of the OS shell is a convenient new feature,
not a bugfix.
This bug will be closed.
~~~~~
:::html
Hello marcel,
There is an obscure feature in the ngspice frontend
which allows prefixing .control commands with "pre_"
I forgot the exact syntax,
but would you please try something like
pre_set rndseed = 42
Regards,
Robert