PySpice-org / PySpice

Simulate electronic circuit using Python and the Ngspice / Xyce simulators
https://pyspice.fabrice-salvaire.fr
GNU General Public License v3.0
661 stars 175 forks source link

Gaussian and Exponential numerical codes are inverted for random source simulation #363

Open ronanpaixao opened 11 months ago

ronanpaixao commented 11 months ago

Lines 560 and 562 are inverted in HighLevelElement.py (reference).

According to the documentation itself in line 525, the code for a gaussian distribution is 2 and for exponential is 3, but they are inverted in code.

TL;DR: Actual code using a gaussian random voltage source showed the bug, by generating only positive voltages, which is true for exponential distribution but false for gaussian distribution.