Monte Carlo Analysis: R Rand Rand T T R R Rand
Monte Carlo Analysis: R Rand Rand T T R R Rand
Monte Carlo Analysis: R Rand Rand T T R R Rand
t 1 = tolerance in %
⎛ ⎛ t1 ⎞ ⎞
R1 = R1 nom ⎜⎜ 1 + ( 2* rand − 1) ⎜ ⎟ ⎟⎟ = actual resistance
⎝ ⎝ 100 ⎠⎠
⎛ t1 ⎞ ⎛ t1 ⎞
Notice that R1 nom ⎜1 − ⎟ < R1 ≤ R1 nom ⎜1 + ⎟
⎝ 100 ⎠ ⎝ 100 ⎠
Voltage Divider:
⎛ R2 ⎞
v2 = ⎜
⎜ R1 + R 2 ⎟⎟ s
v G vs
⎝ ⎠
⎛ ⎛ t ⎞⎞
R 2 nom ⎜1 + ( 2* rand 2 − 1) ⎜ 2 ⎟ ⎟
R2 ⎝ ⎝ 100 ⎠ ⎠
G= =
R1 + R 2 ⎛ ⎛ t ⎞⎞ ⎛ ⎛ t ⎞⎞
R1 nom ⎜1 + ( 2* rand 1 − 1) ⎜ 1 ⎟ ⎟ + R1 nom ⎜ 1 + ( 2* rand 2 − 1) ⎜ 2 ⎟ ⎟
⎝ ⎝ 100 ⎠ ⎠ ⎝ ⎝ 100 ⎠ ⎠
Example: Consider a voltage divider with nominal resistances R1 nom = 100 Ω and
R 2 nom = 400 Ω and tolerances t 1 = t 2 = 5% . Suppose the first two calls to rand return
rand 1 = 0.21347 and rand 2 = 0.83721 .
⎛ ⎛ t1 ⎞ ⎞ ⎛ ⎛ 5 ⎞⎞
R1 = R1 nom ⎜⎜1 + ( 2* rand − 1) ⎜ ⎟ ⎟⎟ = 100 ⎜1 + ( 2*0.21347 − 1) ⎜ ⎟⎟
⎝ ⎝ 100 ⎠ ⎠ ⎝ ⎝ 100 ⎠ ⎠
= 100 (1 − 0.57306 ( 0.05 ) ) = 97.1347 Ω
and
⎛ ⎛ t2 ⎞⎞ ⎛ ⎛ 5 ⎞⎞
R 2 = R 2 nom ⎜⎜1 + ( 2* rand 2 − 1) ⎜ ⎟ ⎟⎟ = 400 ⎜ 1 + ( 2*0.83721 − 1) ⎜ ⎟⎟
⎝ ⎝ 100 ⎠ ⎠ ⎝ ⎝ 100 ⎠ ⎠
= 400 (1 + 0.67442 ( 0.05 ) ) = 413.4884 Ω
Determine the nominal and actual values of gain of the voltage divider:
R 2 nom 400
G nom = = = 0.8 V/V
R1 nom + R 2 nom 100 + 400
and
R2 413.4884
G act = = = 0.809772 V/V
R1 + R 2 97.1374 + 413.4884
Here’s a MATLAB script that performs a Monte Carlo analysis of a voltage divider:
%vdivMonte.m
R1nom=750; %Nominal resistance values
R2nom=250;
t1=2; %Resistor tolerances in %
t2=2;
Gnom=R2nom/(R1nom+R2nom); %nominal gain
tg=1.5; %Gain tolerance
n=15; %Number of trials
m=0; %
fprintf('\n')
fprintf(' R1 R2 vo/vs \n')
fprintf('------------------------------------\n')
for i=1:n
R1=(1+(2*rand-1)*t1/100)*R1nom; %actual resistance values
R2=(1+(2*rand-1)*t1/100)*R2nom;
G = R2/(R1+R2); %voltage divider gain
if abs(G-Gnom)/Gnom<tg/100
m=m+1;
end
fprintf(' %6.3f %6.3f %6.4f \n',R1,R2,G)
end
fprintf('\n%4.1f%% of the voltage dividers have a ',100*m/n)
fprintf('gain\nthat is within %3.1f%% of %4.2f.\n',tg,Gnom)
Here’s what happens when we execute that MATLAB script:
>> vdivMonte
R1 R2 vo/vs
------------------------------------
763.504 247.311 0.2447
753.205 249.860 0.2491
761.739 252.621 0.2490
748.694 245.185 0.2467
759.642 249.447 0.2472
753.463 252.919 0.2513
762.654 252.382 0.2486
740.288 249.057 0.2517
763.064 254.169 0.2499
747.308 253.936 0.2536
736.737 248.529 0.2522
759.395 245.099 0.2440
739.167 247.028 0.2505
740.962 251.038 0.2531
743.166 246.988 0.2494
Voltage Divider:
⎛ R2 ⎞
v2 = ⎜
⎜ R1 + R 2 ⎟⎟ s
v G vs
⎝ ⎠
Determine appropriate tolerance for the gain of the voltage divider: tG = _________%
20 ( 0.98 ) 20 (1.02 )
0.1937 = <G≤ = 0.2065
80 (1.02 ) + 20 ( 0.98 ) 80 ( 0.98 ) + 20 (1.02 )
4.8696
Since 0.1937 < = 0.2029 < 0.2065
24