Gaussian and Monte Carlo truly random?


 

I am using the gauss() and mc() functions from a circuit file recreated from https://www.analog.com/en/resources/technical-articles/how-to-model-statistical-tolerance-analysis.html
 
The output of both functions, while "random" upon a single run (Alt+R) of say 10 dummy parameter steps, repeat to the be same on another run for another 10 steps.  Is this by design?
 
The functions as described in the manual:
 

gauss(x)

Random number from Gaussian distribution with sigma of x.

mc(x,y)

A random number between x*(1+y) and x*(1-y) with uniform distribution.


 

On Mon, Nov 25, 2024 at 03:00 PM, HoMeR wrote:
The output of both functions, while "random" upon a single run (Alt+R) of say 10 dummy parameter steps, repeat to the be same on another run for another 10 steps.  Is this by design?
Yes, it is!  That is helpful when diagnosing your simulation.
 
But you might have missed this.  In the LTspice Control Panel (Settings), go to the "Hacks" section.  Look for the checkbox next to "Use the clock to reseed the MC generator[*]".
 
That setting applies to gauss() as well.
 
Andy
 


 

Wonderful.  Thank you, Andy. 
 
I also tested that the seed is also random across components in a single netlist, and it is.  It's also nice to know that both Monte Carlo and Gaussian distributions can be used with AC analysis.  All the examples I saw online were time-domain analysis.  Maybe that is obvious to some.


 

It can be shown that no pseudo-random process is truly random in the sense that Beta decay is random and unpredictable.