Article count:240 Read by:410258

Account Entry

Qspice 6 Monte Carlo and Gaussian distribution

Latest update time:2024-08-11
    Reads:

QSpice-(6) Monte Carlo and Gaussian distribution

Hello uu, good evening!

What is Monte Carlo analysis? Monte Carlo is usually translated as Monte Carlo, which is very abstract and you don’t even know what it is, right?

Source of Monte Carlo simulation:

The concept of Monte Carlo simulation originated in the field of physics in the 20th century, especially when a random numerical method was introduced to estimate the behavior of physical systems when solving statistical mechanics problems. The term first appeared in a 1943 article titled "The Monte Carlo Method" co-authored by Nikolaos Metropolis and Stanley Ulam. The concept was originally intended to solve the complexity of nuclear reactions.

Monte Carlo analysis is mainly used to predict the distribution of outcomes in an uncertain environment, especially when dealing with probabilities and random variables. This method estimates the expected outcomes by simulating a large number of random experiments and provides a probability range for these outcomes.

Back to the text:

In electronic circuit systems, devices will have tolerances. Monte Carlo is used to simulate how bad the impact of this tolerance will be on the circuit. If the normal distribution of the circuit output meets your product definition within the tolerance range of the device, for example, its output distribution is within 6 sigma, it means that there is no problem with the product design. The yields corresponding to different sigma levels are shown below.

Sigma level correspondence table

Sigma Level

Error rate per million

Defective percentage

Output percentage

1

691,462

69%

31%

2

308,538

31%

69%

3

66,807

6.7%

93.3%

4

6,210

0.62%

99.38%

5

233

0.023%

99.977%

6

3.4

0.00034%

99.99966%

However, as the temperature changes, the device will also change, so when selecting a device, we must not only consider the standard tolerance of the device at room temperature, but also the drift of the device at high temperature.

Since we know that Qspice has Monte Carlo, let's search for Monte to see where it is. In the manual, Monte Carlo is a function, represented by mc(x,y) as shown in Figure 1. It is still difficult to understand directly, so let's make a simple circuit to try it out, as shown in Figure 2.

Figure 1: Monte Carlo Instructions

Figure 2: Monte Carlo basic voltage divider circuit

Shortcut key review:

1.S -- Voltage Control Switch

2.R -- Res

3.T -- Spice Command

4.C -- CAP

5.D -- DIODE

After building the basic voltage divider circuit, we used the mc function with parameters x=1 y=0.1, which means its tolerance is 0.1. The simulation results are shown in Figure 3.

Figure 3: Voltage divider circuit simulation results

I found that the voltage he divided was not 2.5V, but if it was 0.1, shouldn't it be 2.6xV or around 2.38V? Why did he simulate such a voltage?

Because Monte Carlo only guarantees that it is within this 0.1 range, it is not necessarily that voltage. In order to see more of R1, we need to add Step. Here is an example, as shown in Figure 4 below, and the scan result is shown in Figure 5.

Figure 4: Monte Carlo scan using STEP

Figure 5: Step Monte Carlo scan results

Did you find that this thing is not normally distributed? Why? Again, it only guarantees that it is within 0.1, not how it is distributed. What should I do if I want to see a normal distribution? Normal distribution is usually also called Gaussian distribution. Let's find Gaussian distribution and find the following content: agauss(nom, var, sigma). Although there is no detailed description in Qspice, Hspice has it! I won't go into details. If you are interested, just look for the content in the reference document. The modified circuit is shown in Figure 6. The simulation results are shown in Figure 7.

Figure 6: High-profile scan

Figure 7: Gaussian distribution simulation results

We can see that the density in the middle is higher, but the voltage is very close to 2.5V, which does not seem right because it is not proportional. Var is the absolute value of the change. If we change it to Var = 1, it means that the maximum value is 11 and the minimum value is 9. The simulation result when Var is changed to 1 is shown in Figure 8 below.

Figure 8: agauss(10,1,6) simulation results

Simulation code:

*R1 N01 Vout {mc(10,0.1)} monte carlo analysis comment second line

R1 N01 Vout {agauss(10,1,6)}

R2 Vout 0 10

V1 N01 0 5

.TRAN 8m

.step param X 0 100 1

.end

That’s all for tonight. We’ll talk about temperature next time.

Reference Documentation

Ai -- qianwen2

6 sigma -- wiki

HSPICE Compatibility Functions

 
EEWorld WeChat Subscription

 
EEWorld WeChat Service Number

 
AutoDevelopers

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building,Block B, 18 Zhongguancun Street, Haidian District,Beijing, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号