Not anger, emphasis. Next time I’ll be darn sure I won’t use that word.Getting upset about it is not gentleman like. Please try to remain civil. The word damn is not a good word and it can hurt peoples feelings. What are you thinking?
Not anger, emphasis. Next time I’ll be darn sure I won’t use that word.Getting upset about it is not gentleman like. Please try to remain civil. The word damn is not a good word and it can hurt peoples feelings. What are you thinking?
Curiously, it’s also the highest setting for an R-2R ladder of a certain number of stages.That's the sequence you get with 1/(1+1/2+1/4+1/8+1/16+1/32 etc.)
Not curious at all, if you write the sequence in binary:Curiously, it’s also the highest setting for an R-2R ladder of a certain number of stages.
import random
def generateResistor(val,minP,maxP):
lo = val * (1 + (minP / 100))
hi = val * (1 + (maxP / 100))
rVal = random.uniform(lo,hi)
return rVal
def generateResistorString(count,val,minP,maxP):
resistors = []
for i in range(0,count):
resistors.append(generateResistor(val, minP, maxP))
return resistors
def calculateEquivalentResistance(resistorStringList): #for Parallel strings
total = 0
for resistor in resistorStringList:
total += 1/resistor
equivalent = 1/total
return equivalent
def calculateChristmasTree(tiers,rVal,minP,maxP,printResults=False):
branches = []
individualResistors = []
for i in range(1, tiers+1):
mySeriesString = generateResistorString(i, rVal, minP, maxP)
for r in mySeriesString:
individualResistors.append(r)
total = sum(mySeriesString)
branches.append(total)
if printResults:
print(" branch", i, "total:", total, ", individual resistors:", mySeriesString)
networkResistance = calculateEquivalentResistance(branches)
if printResults:
print(" equivalent resistance of this Christmas tree:",networkResistance)
print(" minimum value resistor in this tree:",min(individualResistors))
print(" maximum value resistor in this tree:", max(individualResistors))
print(" average value resistor in this tree:", sum(individualResistors)/len(individualResistors))
return networkResistance
resistorValue = 1
minTolerance = -20 # percent
maxTolerance = 20 # percent
numTiers = 11
numSimulations = 100
idealResult = calculateChristmasTree(numTiers,resistorValue,0,0)
print(idealResult)
results = []
for i in range(numSimulations):
result = calculateChristmasTree(numTiers,resistorValue,minTolerance,maxTolerance,True)
results.append(result)
idealResult = calculateChristmasTree(numTiers,resistorValue,0,0)
print("\n\nideal result:",idealResult)
print("\n",
numSimulations,
"simulations returned the following results:",
results,
"\nmin:",
min(results),"(",(abs(idealResult-min(results))/idealResult)*100,"% error)",
"\nmax:",
max(results),"(",(abs(idealResult-max(results))/idealResult)*100,"% error)",
"\navg:",
sum(results)/numSimulations,"(",(abs(idealResult-sum(results)/numSimulations)/idealResult)*100,"% error)",)
for i in range(1,100):
idealResult = calculateChristmasTree(i,resistorValue,0,0)
print(i,"rungs:",idealResult)
1 rungs: 1.0
2 rungs: 0.6666666666666666
3 rungs: 0.5454545454545455
4 rungs: 0.4800000000000001
5 rungs: 0.43795620437956206
6 rungs: 0.4081632653061225
7 rungs: 0.38567493112947665
8 rungs: 0.3679369250985546
9 rungs: 0.3534857623790153
10 rungs: 0.34141715214740553
11 rungs: 0.3311392767975535
12 rungs: 0.32224689320049754
13 rungs: 0.31445218251769425
14 rungs: 0.3075444661881162
15 rungs: 0.30136557845783046
16 rungs: 0.2957941917269395
17 rungs: 0.2907354934740865
18 rungs: 0.28611418520598664
19 rungs: 0.28186961182070197
20 rungs: 0.2779522965244017
21 rungs: 0.27432142650145275
22 rungs: 0.27094299608389316
23 rungs: 0.26778841368732803
24 rungs: 0.26483344171861206
25 rungs: 0.26205737940993634
26 rungs: 0.2594424254818772
27 rungs: 0.256973175704523
28 rungs: 0.25463622288862675
29 rungs: 0.2524198355265356
30 rungs: 0.2503136974485356
31 rungs: 0.24830869526721436
32 rungs: 0.2463967435823077
33 rungs: 0.24457064026903105
34 rungs: 0.24282394591826978
35 rungs: 0.24115088280613664
36 rungs: 0.2395462497616113
37 rungs: 0.23800535005810808
38 rungs: 0.23652393003795535
39 rungs: 0.2350981266314061
40 rungs: 0.23372442228572157
41 rungs: 0.23239960609853114
42 rungs: 0.23112074017051143
43 rungs: 0.22988513036853536
44 rungs: 0.22869030083170094
45 rungs: 0.22753397166659284
46 rungs: 0.2264140393705265
47 rungs: 0.22532855959682738
48 rungs: 0.2242757319378673
49 rungs: 0.22325388645231492
50 rungs: 0.22226147170498
51 rungs: 0.221297044122419
52 rungs: 0.22035925849645221
53 rungs: 0.21944685949197998
54 rungs: 0.2185586740358338
55 rungs: 0.21769360448053657
56 rungs: 0.21685062245133513
57 rungs: 0.21602876329715304
58 rungs: 0.21522712107656378
59 rungs: 0.2144448440188031
60 rungs: 0.21368113040746992
61 rungs: 0.21293522484111552
62 rungs: 0.21220641483055627
63 rungs: 0.21149402769760733
64 rungs: 0.2107974277441401
65 rungs: 0.21011601366401353
66 rungs: 0.20944921617359763
67 rungs: 0.20879649583936852
68 rungs: 0.2081573410834646
69 rungs: 0.20753126635020167
70 rungs: 0.20691781041839394
71 rungs: 0.2063165348459512
72 rungs: 0.20572702253465222
73 rungs: 0.20514887640425528
74 rungs: 0.20458171816621948
75 rungs: 0.20402518718829724
76 rungs: 0.203478939442132
77 rungs: 0.20294264652677035
78 rungs: 0.20241599476168975
79 rungs: 0.20189868434355712
80 rungs: 0.20139042856148276
81 rungs: 0.20089095306602484
82 rungs: 0.20039999518763862
83 rungs: 0.19991730330065816
84 rungs: 0.1994426362292519
85 rungs: 0.19897576269211026
86 rungs: 0.19851646078291005
87 rungs: 0.19806451748385753
88 rungs: 0.19761972820984416
89 rungs: 0.19718189638095981
90 rungs: 0.19675083302129678
91 rungs: 0.19632635638215146
92 rungs: 0.19590829158788511
93 rungs: 0.19549647030284759
94 rungs: 0.19509073041789543
95 rungs: 0.19469091575515438
96 rungs: 0.1942968757897806
97 rungs: 0.19390846538757447
98 rungs: 0.19352554455738652
99 rungs: 0.19314797821733937
ideal result: 0.38567493112947665
100 simulations returned the following results: [0.3679991835011385, 0.3878181958997476, 0.35658365740031595, 0.3612450121218987, 0.40578241949815586, 0.37832981122953296, 0.3865434262936587, 0.37277184518496514, 0.3787550588177839, 0.38227746585497085, 0.4093214935510908, 0.35874099122367575, 0.3995481722220177, 0.4076645548490372, 0.3817617179902681, 0.4100525995730103, 0.372866934133545, 0.4138152225979686, 0.4070853351689972, 0.3589857238443288, 0.3991212655606562, 0.3640767960967212, 0.39872810633443445, 0.41154584406602646, 0.37359862488472545, 0.3983293883009107, 0.41003489088725115, 0.4099663690109251, 0.3869828039289924, 0.402910399073783, 0.35433114120284936, 0.3987198402191435, 0.40889340022278353, 0.40283390009239245, 0.3596365699288165, 0.3693337448891935, 0.36295299728963465, 0.4054009220329158, 0.4037578791976421, 0.40410489524718574, 0.41049474517196205, 0.3735920865522901, 0.3615667967272314, 0.380774569429817, 0.34777122300430474, 0.4105977321544697, 0.38113754702584973, 0.36664112407648164, 0.40915896443624233, 0.4122260813848114, 0.3983101054119661, 0.3525947569107138, 0.3917718668454897, 0.4009457042506503, 0.40252695012693557, 0.39615804768007107, 0.4043862452067054, 0.40250589051813407, 0.39343350349171563, 0.35820257271120287, 0.4094985010051196, 0.3751680894758583, 0.38947207052833993, 0.390350259511136, 0.3575805393571588, 0.3478613341122589, 0.38824703569972635, 0.3879909105557765, 0.3929328892519857, 0.40022865655379036, 0.35246979702228154, 0.3641714110441275, 0.36739941733521775, 0.3718412111456002, 0.3538070320140495, 0.3979497709417009, 0.37839917978908777, 0.3730101564141868, 0.4100121660330586, 0.3694808039182891, 0.3879256047854928, 0.35288612668477165, 0.40151538320376035, 0.37738111913008193, 0.39765900182450953, 0.3829988857852636, 0.3977776710072011, 0.3616192300054073, 0.4048054360179676, 0.3471440707720546, 0.40368221540412236, 0.39553365067372526, 0.4001265461833939, 0.40172475810264363, 0.3943682559952846, 0.40938514202245835, 0.4069387592133032, 0.36667728229972485, 0.40169294566507385, 0.3790666026162977]
min: 0.3471440707720546 ( 9.990501649817283 % error)
max: 0.4138152225979686 ( 7.296375573616126 % error)
avg: 0.3862678503164143 ( 0.15373547489883535 % error)
ideal result: 0.38567493112947665
100 simulations returned the following results: [0.4157411626417832, 0.41660322089427043, 0.4284123962764274, 0.4324890716966127, 0.4326317665733722, 0.41345262699222723, 0.4341128661209052, 0.4226201155569801, 0.4208764586033516, 0.4343531134623262, 0.4159350015320908, 0.4201973003051907, 0.43188454586034125, 0.42125362351679185, 0.4099435354278945, 0.43519417069939414, 0.40705299904711795, 0.42587727795498687, 0.4178700584329863, 0.41558206597527375, 0.43135651045508705, 0.4341796843463714, 0.41648457808126227, 0.41622498438257377, 0.43382436970139615, 0.4201944969541442, 0.4143843236769352, 0.43059545723097437, 0.4177004251827105, 0.41470727048715655, 0.43046587996344593, 0.42759845019441795, 0.42546668076767413, 0.4421946428936869, 0.4197970965686158, 0.42245335239221704, 0.43472665654683335, 0.43624204834824415, 0.43572012311230096, 0.4309828015710487, 0.4225325544434966, 0.41488846765369614, 0.4258659414172665, 0.42812204064720066, 0.4028790317010869, 0.41742552178862696, 0.4282790279546658, 0.40854309086363255, 0.4189870422072045, 0.4188127699974031, 0.40833415362499265, 0.42931689121528327, 0.41680297884817996, 0.42508221927313744, 0.43396445024589525, 0.42173137767697083, 0.40686081469175384, 0.44351814174004295, 0.41217912584603006, 0.4194623615223576, 0.41758275436500986, 0.42670694897936867, 0.4079153483091839, 0.42477427935295614, 0.41419130092163436, 0.4240402691912724, 0.4119175227944354, 0.4210021957437875, 0.4378860352937421, 0.4238268764834307, 0.43580261487069344, 0.4328745798615382, 0.41359955118343744, 0.4265539826629124, 0.4075660798018311, 0.4420732024595127, 0.4221312761966679, 0.41126239675647025, 0.43347209240087486, 0.4191572464902462, 0.4252387898059903, 0.4182989863963334, 0.4180595108017009, 0.4300310999173569, 0.4143403695489384, 0.4270832060450326, 0.4124186550922955, 0.4100273328665115, 0.4312792399506669, 0.43760883157900576, 0.43380871389317016, 0.44113060693932976, 0.442061788369099, 0.4302538282455981, 0.4233974952440563, 0.4298946880924554, 0.43442749816110193, 0.4296374204494558, 0.4348294868327217, 0.41501765677997393]
min: 0.4028790317010869 ( 4.460777505353231 % error)
max: 0.44351814174004295 ( 14.997918179739688 % error)
avg: 0.4238415297291613 ( 9.896053779775372 % error)
ideal result: 0.38567493112947665
100 simulations returned the following results: [0.35543145420344235, 0.33256024675673007, 0.33436167240326814, 0.35455396236803793, 0.3497312792181152, 0.34835205150308873, 0.3604073720029014, 0.34625084664141464, 0.3391779606684715, 0.3423357702516046, 0.36239453672706495, 0.338488994487437, 0.35515695015891535, 0.3536428628606264, 0.3323350078990454, 0.3669108840428139, 0.35403513346538606, 0.3536595045470849, 0.34753938043486127, 0.34073145422871215, 0.339605371593941, 0.33976062721930855, 0.35580133952749504, 0.3350790573945052, 0.3471038063780407, 0.3513343346235328, 0.3405553219581951, 0.3575922870662253, 0.33997156806283396, 0.34013998599616, 0.32791706609543747, 0.360224900956594, 0.3373894458840192, 0.3360517479674817, 0.3550771745147475, 0.33292205694703647, 0.34603739280760715, 0.33524864695596446, 0.35324474437930353, 0.3326688236744996, 0.3533771768010133, 0.33652800100114616, 0.3406978552910056, 0.3528922060255862, 0.3611331209926402, 0.3603444383505694, 0.3550900036059558, 0.34504483107881984, 0.33598367767103726, 0.3313566300716847, 0.357662453400528, 0.3373514310731015, 0.3300379328357682, 0.3460901576008271, 0.34906151840204885, 0.3438199575666421, 0.34425994374858176, 0.3322572507977756, 0.3447146972944224, 0.3517727766723346, 0.3328175612379983, 0.33977305392652823, 0.3627924185196645, 0.33222967073793375, 0.33096609288066603, 0.35136362903234014, 0.36720135856894326, 0.35508557094486615, 0.3566655873928233, 0.3495142440235436, 0.3553612088396324, 0.35913673319670997, 0.33027005827863226, 0.3408146208696064, 0.364044875032884, 0.34394377359764305, 0.35009705559106646, 0.33548443621728863, 0.33339345036758367, 0.34788786561811, 0.3262529653293234, 0.33452999507061326, 0.3579010483356357, 0.3366809716409083, 0.33156109919376753, 0.33800721782505877, 0.3537850521263846, 0.35494123745679496, 0.3550631748652846, 0.3464075602446617, 0.34035991667046545, 0.33607860221226044, 0.3376193900392194, 0.35026108646016907, 0.35314741218609164, 0.35582760490419324, 0.35803979266219005, 0.34033299811186096, 0.36265568733921405, 0.34369677441875257]
min: 0.3262529653293234 ( 15.407266846754016 % error)
max: 0.36720135856894326 ( 4.789933456766871 % error)
avg: 0.34593251937120756 ( 10.30463962017977 % error)
ideal result: 0.43795620437956206
100 simulations returned the following results: [0.44908535823536805, 0.4273500057742587, 0.41719000927856087, 0.45346593697430365, 0.4652199442178445, 0.413522440805698, 0.4635327210170268, 0.4246840405109309, 0.42969317583591543, 0.4611735420844641, 0.470964463295122, 0.42213818874203635, 0.45376587765420917, 0.46008704289791685, 0.4055234437631062, 0.43004108907150096, 0.44497307080836446, 0.39560171206338746, 0.45380036016438635, 0.42818913280044146, 0.4593117331722902, 0.44780514491213835, 0.4341872418284821, 0.3845877121596467, 0.4204944884964013, 0.4103190846942616, 0.4109400901905317, 0.48196140794298076, 0.3990620920772815, 0.4170189340011659, 0.4684189357428109, 0.4636415609609516, 0.4284064126948066, 0.48733080061216, 0.4655592665248231, 0.42411663483401413, 0.4726776053956676, 0.3876367097454139, 0.43384128586264425, 0.42814102247937863, 0.4302142161160872, 0.41091346094840003, 0.4451230721694423, 0.4509461630429328, 0.45581504448668275, 0.41839658342053854, 0.42639873922420174, 0.43508602281593767, 0.4289469287918774, 0.4171883120342411, 0.4070189822466616, 0.39556576199404225, 0.43523213817233036, 0.4624074441161056, 0.44671735671118556, 0.4579358229388935, 0.4256958255289223, 0.41694495746346344, 0.4224373155580119, 0.44396194291660934, 0.4189852138641082, 0.4548667889062452, 0.40134112320564447, 0.40368636942892744, 0.4640226854274804, 0.40971053147322506, 0.4491700926048379, 0.46736960156744717, 0.4531422226589578, 0.45312952657049893, 0.4123134352118906, 0.4416720363234403, 0.4353552207814694, 0.418024879380777, 0.4858745990092135, 0.40175990633631004, 0.44167700973796553, 0.4093422461345627, 0.4381100960734339, 0.4306170126237128, 0.4760759261216885, 0.4573065272203591, 0.4375385538127063, 0.4163262768108996, 0.4204725401138125, 0.4205874649894079, 0.41730158576857934, 0.428969919518267, 0.45053855828363937, 0.4356127730016086, 0.42807692358076577, 0.4108894273325914, 0.42901079855028584, 0.3896976277672407, 0.4406084234628073, 0.43616076191445285, 0.3964345284456861, 0.4163527634706159, 0.42634565620922854, 0.4163755830583349]
min: 0.3845877121596467 ( 12.185805723547338 % error)
max: 0.48733080061216 ( 11.273866139776528 % error)
avg: 0.43369259027772394 ( 0.9735252199197041 % error)
ideal result: 0.25463622288862675
100 simulations returned the following results: [0.23827174553901131, 0.25248996967481724, 0.2567409190812399, 0.25577504991945066, 0.2516773406729495, 0.2652602526867227, 0.243497459421913, 0.24467299180682903, 0.25007555408635684, 0.260845642150883, 0.2376143377389632, 0.25260252538194783, 0.2501445986666185, 0.25185074022413884, 0.25782632480660345, 0.26218427240684583, 0.24418953900905355, 0.2545802581838989, 0.2671655270406882, 0.25994142204633225, 0.26067634931334976, 0.2643885215697056, 0.2538346022940914, 0.249870912286135, 0.26220731717889967, 0.2684096867765843, 0.260776643271442, 0.24877250568930417, 0.25565244981397006, 0.26162960449109685, 0.2580813615568831, 0.24358612009354888, 0.2407996918251252, 0.25746182975978443, 0.25028111019922133, 0.24255848022053395, 0.2420178647628964, 0.2573721135893332, 0.247743181553078, 0.2657908292810894, 0.24838956985110558, 0.24804950434829548, 0.2486707872897904, 0.2434387888720481, 0.2541466520335396, 0.2505184577900375, 0.24310949601813076, 0.24663690752117454, 0.26649629360844024, 0.2609532431274078, 0.23880550286358707, 0.2575694596440704, 0.2487686665467908, 0.2516004695624566, 0.24723625566211951, 0.25039010364302106, 0.23704367176616445, 0.2555456176959883, 0.24947283659688183, 0.2554398368715093, 0.24264935532497905, 0.2531456367197026, 0.26411589742979835, 0.25138905014482404, 0.26233229361866195, 0.255576129898124, 0.26271112804790364, 0.24324451732289656, 0.25083903988247236, 0.2599122473237088, 0.2566033302736408, 0.24019567663315974, 0.2587622555910634, 0.2436875085434282, 0.2635682136918962, 0.25935384825264163, 0.24680482047220262, 0.2587256774365799, 0.26795455324524375, 0.2596320234538749, 0.23914661885268135, 0.2474879578577109, 0.25189937772883725, 0.2661597819871414, 0.25323667044263803, 0.2368929102275258, 0.2388611021531799, 0.2447408874822984, 0.2533464229144541, 0.24729559143937427, 0.26332840324468654, 0.26574772716699224, 0.25109498403274594, 0.2600389642472983, 0.25471081477540747, 0.24228828957138865, 0.265556022918012, 0.26002172983026517, 0.254981785592793, 0.2521508720549191]
min: 0.2368929102275258 ( 6.9681023618000975 % error)
max: 0.2684096867765843 ( 5.409074848703591 % error)
avg: 0.25301789885211046 ( 0.6355435287869942 % error)
ideal result: 0.19277563597396005
100 simulations returned the following results: [0.18886992759390656, 0.19181168376295504, 0.18663497726507938, 0.18220378595133876, 0.18324398304387204, 0.18649883078545032, 0.18756110541985366, 0.19341408690494954, 0.20038302616957457, 0.1977621512467027, 0.1835735406561566, 0.18089147985214057, 0.19832671432924048, 0.197756417861765, 0.18738228247571834, 0.1960075914794417, 0.19210369929263382, 0.18942812388988767, 0.18958783599949372, 0.18714197124552673, 0.19093764191365614, 0.19276765604327886, 0.18716733901987218, 0.19646994919667188, 0.19285620444895082, 0.1990226235220572, 0.1954425945811646, 0.19177619402799229, 0.19260447113161794, 0.19208938541954043, 0.1913581154188178, 0.19287954651469327, 0.19746365333040275, 0.19692196142540536, 0.19248165412491217, 0.19269287826649553, 0.18405208952851412, 0.1984152898349143, 0.18513701686324263, 0.1933788329688357, 0.18716643203793798, 0.1895760396809718, 0.1940519039466697, 0.19680709387414674, 0.2006474993488651, 0.18915505549803446, 0.1937989585250016, 0.20023032870196789, 0.1885012252182068, 0.18880905186093816, 0.183663885610632, 0.19752832843192109, 0.19068366965926026, 0.18872556022911482, 0.19032984866163716, 0.19069550598641757, 0.18314789197033127, 0.19463756199592944, 0.19641666105499264, 0.1921378041036111, 0.19251159227678077, 0.19688526425265915, 0.1848148888527547, 0.18209868864308418, 0.187259326341943, 0.18615617532773002, 0.18885848750741202, 0.19575747653422038, 0.1905813094860482, 0.19270666545121923, 0.19867122401191264, 0.1813370100574641, 0.19698346341618103, 0.19775218369639258, 0.19210981372099634, 0.19566668523217526, 0.19272683861085513, 0.19461446884535458, 0.20044857017899181, 0.18808123671757612, 0.18976857271361108, 0.19662206046307132, 0.18885713448524066, 0.18734678145695538, 0.18887921313733697, 0.19592995994603563, 0.18954613196863135, 0.19643459773520605, 0.1871230896215616, 0.19455374803708034, 0.1842227936748707, 0.18988660008482428, 0.18639499400078485, 0.19096081854060146, 0.18953178665853332, 0.1942242239462303, 0.18672136744248957, 0.194226341039547, 0.18731906997220008, 0.197167152227415]
min: 0.18089147985214057 ( 6.164760428244563 % error)
max: 0.2006474993488651 ( 4.0834327092913245 % error)
avg: 0.19144946425517284 ( 0.6879353358566273 % error)


import random
def generateResistor(val,minP,maxP):
lo = val * (1 + (minP / 100))
hi = val * (1 + (maxP / 100))
rVal = random.uniform(lo,hi)
return rVal
def generateResistorString(count,val,minP,maxP):
resistors = []
for i in range(0,count):
resistors.append(generateResistor(val, minP, maxP))
return resistors
def calculateEquivalentResistance(resistorStringList): #for Parallel strings
total = 0
for resistor in resistorStringList:
total += 1/resistor
equivalent = 1/total
return equivalent
def calculateMatrix(resistorsPerTier, tiers, rVal, minP, maxP, printResults=False):
branches = []
individualResistors = []
for i in range(1, tiers+1):
mySeriesString = generateResistorString(resistorsPerTier, rVal, minP, maxP)
for r in mySeriesString:
individualResistors.append(r)
total = sum(mySeriesString)
branches.append(total)
if printResults:
print(" branch", i, "total:", total, ", individual resistors:", mySeriesString)
networkResistance = calculateEquivalentResistance(branches)
if printResults:
print(" equivalent resistance of this matrix:",networkResistance)
print(" minimum value resistor in this matrix:",min(individualResistors))
print(" maximum value resistor in this matrix:", max(individualResistors))
print(" average value resistor in this matrix:", sum(individualResistors)/len(individualResistors))
return networkResistance
resistorValue = 1
minTolerance = -20 # percent
maxTolerance = 20 # percent
numTiers = 4
numResistors = 4
numSimulations = 100
for i in range(1,100):
idealResult = calculateMatrix(numResistors,i, resistorValue, 0, 0)
print(i,"rungs:",idealResult)
results = []
for i in range(numSimulations):
result = calculateMatrix(numResistors,numTiers, resistorValue, minTolerance, maxTolerance, True)
results.append(result)
idealResult = calculateMatrix(numResistors,numTiers, resistorValue, 0, 0)
print("\n\nideal result:",idealResult)
print("\n",
numSimulations,
"simulations returned the following results:",
results,
"\nmin:",
min(results),"(",(abs(idealResult-min(results))/idealResult)*100,"% error)",
"\nmax:",
max(results),"(",(abs(idealResult-max(results))/idealResult)*100,"% error)",
"\navg:",
sum(results)/numSimulations,"(",(abs(idealResult-sum(results)/numSimulations)/idealResult)*100,"% error)",)
ideal result: 1.0
100 simulations returned the following results: [0.9789212891760514, 0.9985344306719774, 0.9690136572669109, 1.0175625910620119, 0.9965614364690902, 0.9982149019732224, 1.04624998958799, 1.0107882793986418, 0.957672236271445, 0.9993000670987334, 0.9982137279726447, 1.0335724215172097, 1.0019935541283347, 1.0479282108907113, 1.0802547911534015, 0.9946599921341791, 0.9767549067793089, 0.990023595336334, 0.9894514544996551, 1.0340949404893796, 1.006681346963752, 1.0239788674678305, 0.9579276387161407, 1.0007869095046829, 0.9958255348394108, 1.026483876280865, 0.9914504260531393, 1.0093391490886816, 1.0272874520999558, 0.9494690461393546, 0.9774215215861791, 1.0253201526638298, 0.9549240513461029, 1.0235349477286753, 1.0733705407678387, 0.9766582608016204, 1.0050045002198922, 1.0147624301461706, 1.0062232326674099, 0.9542793929061855, 0.9670486521365843, 1.0125766975219346, 0.9898136544672637, 0.9806289119352432, 0.9966853279728543, 1.0037358165237533, 0.9747675530622049, 1.0158624793838773, 0.9716835700914757, 1.0343467743216854, 0.9983322937653292, 0.989836397372718, 0.9637826297512135, 1.0345744785918045, 0.9942427461217929, 0.9926620554685898, 0.9648697954193125, 0.9648608274669047, 1.027183448674841, 1.0249034799773789, 1.0339037447210433, 1.0139511188383081, 0.9595910568270234, 0.951772064395024, 0.9764637615793678, 1.0176437074944513, 1.014925799082619, 1.0376066769546768, 0.9892291831147877, 0.9794627935283374, 1.0360928255777493, 0.9963987466022209, 0.9901337393323187, 1.0015499904596916, 0.9977360723546183, 1.0226849187129359, 0.9632704103942867, 0.9802150098827074, 0.9740476696398751, 1.001001998686038, 1.019573915378378, 1.0324189714715224, 1.0132851353544587, 1.0013092396806371, 0.9874683858256488, 0.9674793332220626, 0.9791646239438833, 0.9703942155127179, 1.0073897114779398, 0.964544481290691, 1.0166338808096247, 0.9959054030419638, 0.9821275593768161, 1.0076251451499845, 0.9972941970638859, 0.9896155650939906, 0.9472484632677263, 1.0082724642859358, 1.0116488260385985, 1.0288976700404089]
min: 0.9472484632677263 ( 5.275153673227373 % error)
max: 1.0802547911534015 ( 8.02547911534015 % error)
avg: 0.9988887181739671 ( 0.11112818260329282 % error)
ideal result: 1.0000000000000002
100 simulations returned the following results: [1.0049576827058486, 1.0008157708969792, 0.9824863155786936, 1.0217137333107584, 0.9974858979406056, 1.0435477152950767, 0.9884795160660557, 0.9813735301648717, 1.0216891095825722, 0.9922783126175243, 0.9974463081786098, 0.9675752958519079, 0.9888653025619266, 0.9830944208718171, 0.9966421062236366, 1.010588906154264, 0.9689147635922953, 0.9814370220938325, 1.0193344832752032, 0.9579762968118454, 0.9859286735380681, 0.9802942200697424, 0.9978103150956584, 1.0220529937317446, 0.9981756683408626, 1.0203913709428196, 0.9724963525121679, 0.9813141530579015, 1.0051471913433419, 0.9788189602959452, 0.951016354093273, 0.9838879210627086, 0.9823521679720412, 0.9687157653102039, 0.9989548286321874, 1.008400182105642, 1.0033606641413462, 1.0179740890712137, 1.0108968761195765, 1.0119696221112184, 0.9853771767649373, 0.9739776568962591, 0.9823322084568604, 1.005168854518104, 1.0358755951772294, 0.9829564889992279, 0.9881544075498752, 0.9926023187351147, 0.9998716977354134, 0.9692675270899929, 0.9752011475030674, 0.9874161722751269, 0.9867304842050943, 0.9592493715706948, 0.9986722899911787, 0.9803733518350721, 0.9781055839881151, 1.0043744375035337, 0.9606854769653048, 1.001518952237496, 0.9830205017085525, 1.0075117766685902, 1.005598859110627, 1.0150857073759678, 0.9670058788034925, 1.0185849488709804, 0.9851781297297054, 1.008263678508369, 1.0035982636784684, 1.0100442333579334, 1.006143277839647, 0.990139453538291, 1.0310978256603216, 0.9903670101064954, 1.0100544007710506, 1.0003531844711093, 1.0047734148517862, 0.9748221054752805, 1.0068456273417492, 0.9925744539310705, 1.0041240165773162, 1.0084699447632262, 1.016444134135838, 1.0097243723654228, 0.9850068446486211, 0.9739265452530685, 0.9785029635254119, 1.020550601896357, 1.0081024949751236, 0.9976909658876986, 0.9891945378183941, 1.0085686987135256, 0.9898182373068176, 0.9958345699714912, 0.985657785275066, 0.9895251064215241, 0.9914112642481931, 1.0072096555827144, 1.018289631398471, 0.9958522953537312]
min: 0.951016354093273 ( 4.89836459067272 % error)
max: 1.0435477152950767 ( 4.35477152950765 % error)
avg: 0.995195394572372 ( 0.48046054276281713 % error)
ideal result: 1.0
100 simulations returned the following results: [0.983912690846084, 1.0106811374389062, 0.9961548310893096, 1.0007982917310223, 0.9995355385409292, 0.9782069204055726, 0.9935015797147766, 1.0054247551962068, 1.0032701158182316, 1.001474792508941, 0.9861742472523618, 0.9960395229540201, 1.0060036208930032, 0.9983311411335868, 1.006467333735072, 0.9819591376992678, 1.0011793806594451, 0.9886844999595555, 1.0032304795811422, 0.9819602811372139, 1.000408230543238, 0.9904944852600411, 1.0002655968792977, 0.9933021550952424, 1.0140301274880557, 0.9861779217933253, 1.004742803799152, 0.9973131222111021, 0.9887389069456496, 1.01194369967319, 0.9971950171354457, 0.9862137315791142, 1.0221028694516143, 0.989859342998855, 0.9992523086932866, 1.0017026451023623, 0.9793011592436351, 1.001793029219336, 0.9961703613836118, 0.990019144083926, 1.0074855825457065, 1.0006993723055257, 1.0076420983110337, 0.9988758487128077, 0.9808050980663007, 1.0139869916730397, 0.9869781872494657, 1.0043029945978312, 1.0083331848957686, 0.9912444323064205, 0.9889229076021828, 0.9917399875888416, 0.9890207103220248, 1.0007996184861652, 1.0030783965193197, 0.9966832439447828, 0.9980762209100709, 1.007817748520494, 1.0020434179136566, 0.9975751739060802, 1.018721272235832, 0.9960695524092081, 0.9994201086914559, 0.9866718980190501, 1.0026891413413954, 1.0036418811118752, 1.00128154270057, 1.0039438992828715, 0.9775744583511432, 0.9896382449563653, 1.0070175849478533, 0.9797515791218288, 0.9974438796954695, 0.9936781381223438, 0.9992979053294592, 1.0020396036144075, 0.9779185334345716, 1.0019133687212267, 1.0067017253652368, 1.0028359127415045, 1.000934847117415, 0.9980024706156726, 1.014396418287406, 0.9971024156446798, 1.0035888374044775, 0.9808274245037177, 1.0136598462346897, 1.0072023402127372, 1.0085174963941452, 0.98393620882173, 1.003403396714935, 0.99901143901135, 0.9995903654185379, 1.0187684495344085, 0.9971853980034491, 1.0031224449787526, 1.0104319523617196, 0.9874717422243886, 0.9990969396355713, 0.9869400237433852]
min: 0.9775744583511432 ( 2.2425541648856795 % error)
max: 1.0221028694516143 ( 2.2102869451614326 % error)
avg: 0.9981156886030846 ( 0.18843113969153613 % error)
ideal result: 1.0
100 simulations returned the following results: [1.100820020793252, 1.1048235982753765, 1.0912548266329354, 1.0919443917483875, 1.0986670981719686, 1.1051261348887707, 1.102821042472663, 1.094905023488624, 1.0974683199374216, 1.105328925774763, 1.1001862098162858, 1.107229273719581, 1.0984962214385827, 1.1025406996316367, 1.0925642000633053, 1.1035716947683614, 1.0943582340943683, 1.0931583096967077, 1.1021216057109575, 1.10027455990558, 1.1037091452757446, 1.1074218140703584, 1.1023811765773706, 1.0989863951614887, 1.1043672702766103, 1.1016402415935738, 1.099652798173428, 1.1021457250577882, 1.1032580470287712, 1.090525909344153, 1.0971348400380294, 1.0997354571126887, 1.0964603915293156, 1.1040411572428668, 1.1069722927864816, 1.1001029379058558, 1.0934356046957896, 1.0996919869922097, 1.0970283705197572, 1.1035440805262549, 1.1035216554725649, 1.1029608921367848, 1.0925334088777465, 1.106080776088537, 1.095868149585995, 1.097843900415008, 1.1001790442204613, 1.0991682612069449, 1.1011429202741148, 1.099953423748293, 1.0970490351818898, 1.0990978276235597, 1.0995641948121968, 1.1036361007451176, 1.1139490598565314, 1.1037687590825942, 1.0962199840292224, 1.0995540683530007, 1.101900660552101, 1.0945911618368431, 1.099901423320125, 1.1006218218388828, 1.0943000114720034, 1.0992542133578616, 1.1095618839606656, 1.0936481755576237, 1.1011405072035048, 1.1027603049947021, 1.1034752957258742, 1.0965919357284082, 1.1072857585625706, 1.1014558802173458, 1.1006198966524476, 1.1013460755548987, 1.1038083312106743, 1.1088746257476667, 1.1010167057567959, 1.102403239366781, 1.095179782540306, 1.0999857745031176, 1.0924458236363912, 1.1027590167273442, 1.105751680330646, 1.0991356825006975, 1.0916208842550261, 1.0975937132335618, 1.0979990361020866, 1.1037960858177072, 1.0971129700997353, 1.097801660530011, 1.1025863340715942, 1.1000250663952253, 1.1039318513734286, 1.1008103571381216, 1.1082171276781185, 1.101189920183417, 1.0984300596711705, 1.1000122110680364, 1.1065466676413394, 1.1011549643708787]
min: 1.090525909344153 ( 9.052590934415306 % error)
max: 1.1139490598565314 ( 11.394905985653136 % error)
avg: 1.1004063207313433 ( 10.040632073134326 % error)
That series converges real fast if you use conductance in instead of resistance in that case you have:The series that is actually not converging is the series
G = 1/1 + 1/2 + 1/3 + 1/4 + ...... 1/N + 1/....
The sum of this series goes to infinity, but we are not interested in G, but rather R = 1/G, which therefore does converge, but to 1/Inf = 0.
Another, more practical, way of thinking about this case is that the sense in it which it doesn't converge is that it doesn't converge to a non-zero value that is dependent on the size of the resistors. Instead, whatever resistor size you choose to use, the limit of the total resistance will always be the same, namely zero.
Nice work! I can see you put a lot of time into this with code and I agree with everything you are saying.The whole premise of this, is that the adding of rungs of resistors to the ladder lends ever-increasing stability to the overall resistance, which I think got lost among all the focus being on the mathematical errors early on. Most of the discussion seems to have been about whether or not there will be a trend toward an unchanging equivalent resistance as the number of rungs of ideal/perfect resistor rungs are added. Rather than breadboarding thousands upon thousands of combinations of loose-tolerance resistors, I simulated it in Python. Here is what I wrote to test it:
christmasTree.py:import random def generateResistor(val,minP,maxP): lo = val * (1 + (minP / 100)) hi = val * (1 + (maxP / 100)) rVal = random.uniform(lo,hi) return rVal def generateResistorString(count,val,minP,maxP): resistors = [] for i in range(0,count): resistors.append(generateResistor(val, minP, maxP)) return resistors def calculateEquivalentResistance(resistorStringList): #for Parallel strings total = 0 for resistor in resistorStringList: total += 1/resistor equivalent = 1/total return equivalent def calculateChristmasTree(tiers,rVal,minP,maxP,printResults=False): branches = [] individualResistors = [] for i in range(1, tiers+1): mySeriesString = generateResistorString(i, rVal, minP, maxP) for r in mySeriesString: individualResistors.append(r) total = sum(mySeriesString) branches.append(total) if printResults: print(" branch", i, "total:", total, ", individual resistors:", mySeriesString) networkResistance = calculateEquivalentResistance(branches) if printResults: print(" equivalent resistance of this Christmas tree:",networkResistance) print(" minimum value resistor in this tree:",min(individualResistors)) print(" maximum value resistor in this tree:", max(individualResistors)) print(" average value resistor in this tree:", sum(individualResistors)/len(individualResistors)) return networkResistance resistorValue = 1 minTolerance = -20 # percent maxTolerance = 20 # percent numTiers = 11 numSimulations = 100 idealResult = calculateChristmasTree(numTiers,resistorValue,0,0) print(idealResult) results = [] for i in range(numSimulations): result = calculateChristmasTree(numTiers,resistorValue,minTolerance,maxTolerance,True) results.append(result) idealResult = calculateChristmasTree(numTiers,resistorValue,0,0) print("\n\nideal result:",idealResult) print("\n", numSimulations, "simulations returned the following results:", results, "\nmin:", min(results),"(",(abs(idealResult-min(results))/idealResult)*100,"% error)", "\nmax:", max(results),"(",(abs(idealResult-max(results))/idealResult)*100,"% error)", "\navg:", sum(results)/numSimulations,"(",(abs(idealResult-sum(results)/numSimulations)/idealResult)*100,"% error)",)
You are free to play with it and make changes to see the effect.
You can set the tolerance minimum and maximum separately to simulate the effect of a particular batch having been produced with resistance values near the upper tolerance limit or the lower, if desired.
My findings:
Firstly, what the script yields for increasing number of tiers of perfect/ideal 1Ω resistors:
Secondly, what it yields for non-ideal resistors within specified tolerances:Code:for i in range(1,100): idealResult = calculateChristmasTree(i,resistorValue,0,0) print(i,"rungs:",idealResult) 1 rungs: 1.0 2 rungs: 0.6666666666666666 3 rungs: 0.5454545454545455 4 rungs: 0.4800000000000001 5 rungs: 0.43795620437956206 6 rungs: 0.4081632653061225 7 rungs: 0.38567493112947665 8 rungs: 0.3679369250985546 9 rungs: 0.3534857623790153 10 rungs: 0.34141715214740553 11 rungs: 0.3311392767975535 12 rungs: 0.32224689320049754 13 rungs: 0.31445218251769425 14 rungs: 0.3075444661881162 15 rungs: 0.30136557845783046 16 rungs: 0.2957941917269395 17 rungs: 0.2907354934740865 18 rungs: 0.28611418520598664 19 rungs: 0.28186961182070197 20 rungs: 0.2779522965244017 21 rungs: 0.27432142650145275 22 rungs: 0.27094299608389316 23 rungs: 0.26778841368732803 24 rungs: 0.26483344171861206 25 rungs: 0.26205737940993634 26 rungs: 0.2594424254818772 27 rungs: 0.256973175704523 28 rungs: 0.25463622288862675 29 rungs: 0.2524198355265356 30 rungs: 0.2503136974485356 31 rungs: 0.24830869526721436 32 rungs: 0.2463967435823077 33 rungs: 0.24457064026903105 34 rungs: 0.24282394591826978 35 rungs: 0.24115088280613664 36 rungs: 0.2395462497616113 37 rungs: 0.23800535005810808 38 rungs: 0.23652393003795535 39 rungs: 0.2350981266314061 40 rungs: 0.23372442228572157 41 rungs: 0.23239960609853114 42 rungs: 0.23112074017051143 43 rungs: 0.22988513036853536 44 rungs: 0.22869030083170094 45 rungs: 0.22753397166659284 46 rungs: 0.2264140393705265 47 rungs: 0.22532855959682738 48 rungs: 0.2242757319378673 49 rungs: 0.22325388645231492 50 rungs: 0.22226147170498 51 rungs: 0.221297044122419 52 rungs: 0.22035925849645221 53 rungs: 0.21944685949197998 54 rungs: 0.2185586740358338 55 rungs: 0.21769360448053657 56 rungs: 0.21685062245133513 57 rungs: 0.21602876329715304 58 rungs: 0.21522712107656378 59 rungs: 0.2144448440188031 60 rungs: 0.21368113040746992 61 rungs: 0.21293522484111552 62 rungs: 0.21220641483055627 63 rungs: 0.21149402769760733 64 rungs: 0.2107974277441401 65 rungs: 0.21011601366401353 66 rungs: 0.20944921617359763 67 rungs: 0.20879649583936852 68 rungs: 0.2081573410834646 69 rungs: 0.20753126635020167 70 rungs: 0.20691781041839394 71 rungs: 0.2063165348459512 72 rungs: 0.20572702253465222 73 rungs: 0.20514887640425528 74 rungs: 0.20458171816621948 75 rungs: 0.20402518718829724 76 rungs: 0.203478939442132 77 rungs: 0.20294264652677035 78 rungs: 0.20241599476168975 79 rungs: 0.20189868434355712 80 rungs: 0.20139042856148276 81 rungs: 0.20089095306602484 82 rungs: 0.20039999518763862 83 rungs: 0.19991730330065816 84 rungs: 0.1994426362292519 85 rungs: 0.19897576269211026 86 rungs: 0.19851646078291005 87 rungs: 0.19806451748385753 88 rungs: 0.19761972820984416 89 rungs: 0.19718189638095981 90 rungs: 0.19675083302129678 91 rungs: 0.19632635638215146 92 rungs: 0.19590829158788511 93 rungs: 0.19549647030284759 94 rungs: 0.19509073041789543 95 rungs: 0.19469091575515438 96 rungs: 0.1942968757897806 97 rungs: 0.19390846538757447 98 rungs: 0.19352554455738652 99 rungs: 0.19314797821733937
Test #1 : 20% resistors (-20% to +20%) at 7 tiers as shown in post #2 and 100 iterations of the simulation:
Test #2 : 20% resistors (-0% to +20%) at 7 tiers as shown in post #2 and 100 iterations of the simulation:Code:ideal result: 0.38567493112947665 100 simulations returned the following results: [0.3679991835011385, 0.3878181958997476, 0.35658365740031595, 0.3612450121218987, 0.40578241949815586, 0.37832981122953296, 0.3865434262936587, 0.37277184518496514, 0.3787550588177839, 0.38227746585497085, 0.4093214935510908, 0.35874099122367575, 0.3995481722220177, 0.4076645548490372, 0.3817617179902681, 0.4100525995730103, 0.372866934133545, 0.4138152225979686, 0.4070853351689972, 0.3589857238443288, 0.3991212655606562, 0.3640767960967212, 0.39872810633443445, 0.41154584406602646, 0.37359862488472545, 0.3983293883009107, 0.41003489088725115, 0.4099663690109251, 0.3869828039289924, 0.402910399073783, 0.35433114120284936, 0.3987198402191435, 0.40889340022278353, 0.40283390009239245, 0.3596365699288165, 0.3693337448891935, 0.36295299728963465, 0.4054009220329158, 0.4037578791976421, 0.40410489524718574, 0.41049474517196205, 0.3735920865522901, 0.3615667967272314, 0.380774569429817, 0.34777122300430474, 0.4105977321544697, 0.38113754702584973, 0.36664112407648164, 0.40915896443624233, 0.4122260813848114, 0.3983101054119661, 0.3525947569107138, 0.3917718668454897, 0.4009457042506503, 0.40252695012693557, 0.39615804768007107, 0.4043862452067054, 0.40250589051813407, 0.39343350349171563, 0.35820257271120287, 0.4094985010051196, 0.3751680894758583, 0.38947207052833993, 0.390350259511136, 0.3575805393571588, 0.3478613341122589, 0.38824703569972635, 0.3879909105557765, 0.3929328892519857, 0.40022865655379036, 0.35246979702228154, 0.3641714110441275, 0.36739941733521775, 0.3718412111456002, 0.3538070320140495, 0.3979497709417009, 0.37839917978908777, 0.3730101564141868, 0.4100121660330586, 0.3694808039182891, 0.3879256047854928, 0.35288612668477165, 0.40151538320376035, 0.37738111913008193, 0.39765900182450953, 0.3829988857852636, 0.3977776710072011, 0.3616192300054073, 0.4048054360179676, 0.3471440707720546, 0.40368221540412236, 0.39553365067372526, 0.4001265461833939, 0.40172475810264363, 0.3943682559952846, 0.40938514202245835, 0.4069387592133032, 0.36667728229972485, 0.40169294566507385, 0.3790666026162977] min: 0.3471440707720546 ( 9.990501649817283 % error) max: 0.4138152225979686 ( 7.296375573616126 % error) avg: 0.3862678503164143 ( 0.15373547489883535 % error)
Test #3 : 20% resistors (-20% to +0%) at 7 tiers as shown in post #2 and 100 iterations of the simulation:Code:ideal result: 0.38567493112947665 100 simulations returned the following results: [0.4157411626417832, 0.41660322089427043, 0.4284123962764274, 0.4324890716966127, 0.4326317665733722, 0.41345262699222723, 0.4341128661209052, 0.4226201155569801, 0.4208764586033516, 0.4343531134623262, 0.4159350015320908, 0.4201973003051907, 0.43188454586034125, 0.42125362351679185, 0.4099435354278945, 0.43519417069939414, 0.40705299904711795, 0.42587727795498687, 0.4178700584329863, 0.41558206597527375, 0.43135651045508705, 0.4341796843463714, 0.41648457808126227, 0.41622498438257377, 0.43382436970139615, 0.4201944969541442, 0.4143843236769352, 0.43059545723097437, 0.4177004251827105, 0.41470727048715655, 0.43046587996344593, 0.42759845019441795, 0.42546668076767413, 0.4421946428936869, 0.4197970965686158, 0.42245335239221704, 0.43472665654683335, 0.43624204834824415, 0.43572012311230096, 0.4309828015710487, 0.4225325544434966, 0.41488846765369614, 0.4258659414172665, 0.42812204064720066, 0.4028790317010869, 0.41742552178862696, 0.4282790279546658, 0.40854309086363255, 0.4189870422072045, 0.4188127699974031, 0.40833415362499265, 0.42931689121528327, 0.41680297884817996, 0.42508221927313744, 0.43396445024589525, 0.42173137767697083, 0.40686081469175384, 0.44351814174004295, 0.41217912584603006, 0.4194623615223576, 0.41758275436500986, 0.42670694897936867, 0.4079153483091839, 0.42477427935295614, 0.41419130092163436, 0.4240402691912724, 0.4119175227944354, 0.4210021957437875, 0.4378860352937421, 0.4238268764834307, 0.43580261487069344, 0.4328745798615382, 0.41359955118343744, 0.4265539826629124, 0.4075660798018311, 0.4420732024595127, 0.4221312761966679, 0.41126239675647025, 0.43347209240087486, 0.4191572464902462, 0.4252387898059903, 0.4182989863963334, 0.4180595108017009, 0.4300310999173569, 0.4143403695489384, 0.4270832060450326, 0.4124186550922955, 0.4100273328665115, 0.4312792399506669, 0.43760883157900576, 0.43380871389317016, 0.44113060693932976, 0.442061788369099, 0.4302538282455981, 0.4233974952440563, 0.4298946880924554, 0.43442749816110193, 0.4296374204494558, 0.4348294868327217, 0.41501765677997393] min: 0.4028790317010869 ( 4.460777505353231 % error) max: 0.44351814174004295 ( 14.997918179739688 % error) avg: 0.4238415297291613 ( 9.896053779775372 % error)
Test #4 : 20% resistors (-20% to +20%) at 5 tiers as shown in post #1 and 100 iterations of the simulation:Code:ideal result: 0.38567493112947665 100 simulations returned the following results: [0.35543145420344235, 0.33256024675673007, 0.33436167240326814, 0.35455396236803793, 0.3497312792181152, 0.34835205150308873, 0.3604073720029014, 0.34625084664141464, 0.3391779606684715, 0.3423357702516046, 0.36239453672706495, 0.338488994487437, 0.35515695015891535, 0.3536428628606264, 0.3323350078990454, 0.3669108840428139, 0.35403513346538606, 0.3536595045470849, 0.34753938043486127, 0.34073145422871215, 0.339605371593941, 0.33976062721930855, 0.35580133952749504, 0.3350790573945052, 0.3471038063780407, 0.3513343346235328, 0.3405553219581951, 0.3575922870662253, 0.33997156806283396, 0.34013998599616, 0.32791706609543747, 0.360224900956594, 0.3373894458840192, 0.3360517479674817, 0.3550771745147475, 0.33292205694703647, 0.34603739280760715, 0.33524864695596446, 0.35324474437930353, 0.3326688236744996, 0.3533771768010133, 0.33652800100114616, 0.3406978552910056, 0.3528922060255862, 0.3611331209926402, 0.3603444383505694, 0.3550900036059558, 0.34504483107881984, 0.33598367767103726, 0.3313566300716847, 0.357662453400528, 0.3373514310731015, 0.3300379328357682, 0.3460901576008271, 0.34906151840204885, 0.3438199575666421, 0.34425994374858176, 0.3322572507977756, 0.3447146972944224, 0.3517727766723346, 0.3328175612379983, 0.33977305392652823, 0.3627924185196645, 0.33222967073793375, 0.33096609288066603, 0.35136362903234014, 0.36720135856894326, 0.35508557094486615, 0.3566655873928233, 0.3495142440235436, 0.3553612088396324, 0.35913673319670997, 0.33027005827863226, 0.3408146208696064, 0.364044875032884, 0.34394377359764305, 0.35009705559106646, 0.33548443621728863, 0.33339345036758367, 0.34788786561811, 0.3262529653293234, 0.33452999507061326, 0.3579010483356357, 0.3366809716409083, 0.33156109919376753, 0.33800721782505877, 0.3537850521263846, 0.35494123745679496, 0.3550631748652846, 0.3464075602446617, 0.34035991667046545, 0.33607860221226044, 0.3376193900392194, 0.35026108646016907, 0.35314741218609164, 0.35582760490419324, 0.35803979266219005, 0.34033299811186096, 0.36265568733921405, 0.34369677441875257] min: 0.3262529653293234 ( 15.407266846754016 % error) max: 0.36720135856894326 ( 4.789933456766871 % error) avg: 0.34593251937120756 ( 10.30463962017977 % error)
Test #5 : 20% resistors (-20% to +20%) at 28 tiers and 100 iterations of the simulation:Code:ideal result: 0.43795620437956206 100 simulations returned the following results: [0.44908535823536805, 0.4273500057742587, 0.41719000927856087, 0.45346593697430365, 0.4652199442178445, 0.413522440805698, 0.4635327210170268, 0.4246840405109309, 0.42969317583591543, 0.4611735420844641, 0.470964463295122, 0.42213818874203635, 0.45376587765420917, 0.46008704289791685, 0.4055234437631062, 0.43004108907150096, 0.44497307080836446, 0.39560171206338746, 0.45380036016438635, 0.42818913280044146, 0.4593117331722902, 0.44780514491213835, 0.4341872418284821, 0.3845877121596467, 0.4204944884964013, 0.4103190846942616, 0.4109400901905317, 0.48196140794298076, 0.3990620920772815, 0.4170189340011659, 0.4684189357428109, 0.4636415609609516, 0.4284064126948066, 0.48733080061216, 0.4655592665248231, 0.42411663483401413, 0.4726776053956676, 0.3876367097454139, 0.43384128586264425, 0.42814102247937863, 0.4302142161160872, 0.41091346094840003, 0.4451230721694423, 0.4509461630429328, 0.45581504448668275, 0.41839658342053854, 0.42639873922420174, 0.43508602281593767, 0.4289469287918774, 0.4171883120342411, 0.4070189822466616, 0.39556576199404225, 0.43523213817233036, 0.4624074441161056, 0.44671735671118556, 0.4579358229388935, 0.4256958255289223, 0.41694495746346344, 0.4224373155580119, 0.44396194291660934, 0.4189852138641082, 0.4548667889062452, 0.40134112320564447, 0.40368636942892744, 0.4640226854274804, 0.40971053147322506, 0.4491700926048379, 0.46736960156744717, 0.4531422226589578, 0.45312952657049893, 0.4123134352118906, 0.4416720363234403, 0.4353552207814694, 0.418024879380777, 0.4858745990092135, 0.40175990633631004, 0.44167700973796553, 0.4093422461345627, 0.4381100960734339, 0.4306170126237128, 0.4760759261216885, 0.4573065272203591, 0.4375385538127063, 0.4163262768108996, 0.4204725401138125, 0.4205874649894079, 0.41730158576857934, 0.428969919518267, 0.45053855828363937, 0.4356127730016086, 0.42807692358076577, 0.4108894273325914, 0.42901079855028584, 0.3896976277672407, 0.4406084234628073, 0.43616076191445285, 0.3964345284456861, 0.4163527634706159, 0.42634565620922854, 0.4163755830583349] min: 0.3845877121596467 ( 12.185805723547338 % error) max: 0.48733080061216 ( 11.273866139776528 % error) avg: 0.43369259027772394 ( 0.9735252199197041 % error)
Test #6 : 20% resistors (-20% to +20%) at 100 tiers and 100 iterations of the simulation:Code:ideal result: 0.25463622288862675 100 simulations returned the following results: [0.23827174553901131, 0.25248996967481724, 0.2567409190812399, 0.25577504991945066, 0.2516773406729495, 0.2652602526867227, 0.243497459421913, 0.24467299180682903, 0.25007555408635684, 0.260845642150883, 0.2376143377389632, 0.25260252538194783, 0.2501445986666185, 0.25185074022413884, 0.25782632480660345, 0.26218427240684583, 0.24418953900905355, 0.2545802581838989, 0.2671655270406882, 0.25994142204633225, 0.26067634931334976, 0.2643885215697056, 0.2538346022940914, 0.249870912286135, 0.26220731717889967, 0.2684096867765843, 0.260776643271442, 0.24877250568930417, 0.25565244981397006, 0.26162960449109685, 0.2580813615568831, 0.24358612009354888, 0.2407996918251252, 0.25746182975978443, 0.25028111019922133, 0.24255848022053395, 0.2420178647628964, 0.2573721135893332, 0.247743181553078, 0.2657908292810894, 0.24838956985110558, 0.24804950434829548, 0.2486707872897904, 0.2434387888720481, 0.2541466520335396, 0.2505184577900375, 0.24310949601813076, 0.24663690752117454, 0.26649629360844024, 0.2609532431274078, 0.23880550286358707, 0.2575694596440704, 0.2487686665467908, 0.2516004695624566, 0.24723625566211951, 0.25039010364302106, 0.23704367176616445, 0.2555456176959883, 0.24947283659688183, 0.2554398368715093, 0.24264935532497905, 0.2531456367197026, 0.26411589742979835, 0.25138905014482404, 0.26233229361866195, 0.255576129898124, 0.26271112804790364, 0.24324451732289656, 0.25083903988247236, 0.2599122473237088, 0.2566033302736408, 0.24019567663315974, 0.2587622555910634, 0.2436875085434282, 0.2635682136918962, 0.25935384825264163, 0.24680482047220262, 0.2587256774365799, 0.26795455324524375, 0.2596320234538749, 0.23914661885268135, 0.2474879578577109, 0.25189937772883725, 0.2661597819871414, 0.25323667044263803, 0.2368929102275258, 0.2388611021531799, 0.2447408874822984, 0.2533464229144541, 0.24729559143937427, 0.26332840324468654, 0.26574772716699224, 0.25109498403274594, 0.2600389642472983, 0.25471081477540747, 0.24228828957138865, 0.265556022918012, 0.26002172983026517, 0.254981785592793, 0.2521508720549191] min: 0.2368929102275258 ( 6.9681023618000975 % error) max: 0.2684096867765843 ( 5.409074848703591 % error) avg: 0.25301789885211046 ( 0.6355435287869942 % error)
Code:ideal result: 0.19277563597396005 100 simulations returned the following results: [0.18886992759390656, 0.19181168376295504, 0.18663497726507938, 0.18220378595133876, 0.18324398304387204, 0.18649883078545032, 0.18756110541985366, 0.19341408690494954, 0.20038302616957457, 0.1977621512467027, 0.1835735406561566, 0.18089147985214057, 0.19832671432924048, 0.197756417861765, 0.18738228247571834, 0.1960075914794417, 0.19210369929263382, 0.18942812388988767, 0.18958783599949372, 0.18714197124552673, 0.19093764191365614, 0.19276765604327886, 0.18716733901987218, 0.19646994919667188, 0.19285620444895082, 0.1990226235220572, 0.1954425945811646, 0.19177619402799229, 0.19260447113161794, 0.19208938541954043, 0.1913581154188178, 0.19287954651469327, 0.19746365333040275, 0.19692196142540536, 0.19248165412491217, 0.19269287826649553, 0.18405208952851412, 0.1984152898349143, 0.18513701686324263, 0.1933788329688357, 0.18716643203793798, 0.1895760396809718, 0.1940519039466697, 0.19680709387414674, 0.2006474993488651, 0.18915505549803446, 0.1937989585250016, 0.20023032870196789, 0.1885012252182068, 0.18880905186093816, 0.183663885610632, 0.19752832843192109, 0.19068366965926026, 0.18872556022911482, 0.19032984866163716, 0.19069550598641757, 0.18314789197033127, 0.19463756199592944, 0.19641666105499264, 0.1921378041036111, 0.19251159227678077, 0.19688526425265915, 0.1848148888527547, 0.18209868864308418, 0.187259326341943, 0.18615617532773002, 0.18885848750741202, 0.19575747653422038, 0.1905813094860482, 0.19270666545121923, 0.19867122401191264, 0.1813370100574641, 0.19698346341618103, 0.19775218369639258, 0.19210981372099634, 0.19566668523217526, 0.19272683861085513, 0.19461446884535458, 0.20044857017899181, 0.18808123671757612, 0.18976857271361108, 0.19662206046307132, 0.18885713448524066, 0.18734678145695538, 0.18887921313733697, 0.19592995994603563, 0.18954613196863135, 0.19643459773520605, 0.1871230896215616, 0.19455374803708034, 0.1842227936748707, 0.18988660008482428, 0.18639499400078485, 0.19096081854060146, 0.18953178665853332, 0.1942242239462303, 0.18672136744248957, 0.194226341039547, 0.18731906997220008, 0.197167152227415] min: 0.18089147985214057 ( 6.164760428244563 % error) max: 0.2006474993488651 ( 4.0834327092913245 % error) avg: 0.19144946425517284 ( 0.6879353358566273 % error)
So even at 100 rungs of the resistor ladder (or branches of the resistor Christmas tree) the error is not exactly "insanely accurate." The average result for 100 virtually breadboarded circuits in test #6 had <0.7% error, but one of them was as low as -6.16% error and one as high as 4.08% error. And this isn't much different than the 100 virtually breadboarded circuits that had only 28 tiers (test #5), and even that was hardly better than test #1 with only 7 tiers. This method seems to have no advantage over simply purchasing a single 5% resistor instead of (28) 20% resistors.
So why does this not work as well in practice as it seems like it ought to?
Let's say you're going to make yourself a Christmas tree out of (10) resistors and their ohm values are as follows: [1,1,1,1,1.2,0.8,1,1,1,1]
It totally matters where in the Christmas tree those two off-spec resistors happen to be placed.
The ideal resistance for the Christmas tree below is 0.4800000000000001Ω.
View attachment 306288
If the 1.2Ω resistor is in the R21 position (top rung) and the 0.8Ω resistor is in the R19 position (bottom rung) then the total equivalent resistance is 0.5181818181818182Ω (+7.95%)
If the 1.2Ω resistor is in the R20 position (2nd rung) and the 0.8Ω resistor is in the R19 position (bottom rung) then the total equivalent resistance is 0.48755832037325036Ω (+1.57%)
If the 1.2Ω resistor is in the R13 position (3rd rung) and the 0.8Ω resistor is in the R19 position (bottom rung) then the total equivalent resistance is 0.48177496038034867Ω (+0.37%)
If the 1.2Ω resistor is in the R11 position (bottom rung) and the 0.8Ω resistor is in the R19 position (bottom rung) then the total equivalent resistance is 0.4800000000000001Ω (+0.0%)
That one resistor at the top has way too much sway over the rest of the resistors. The whole literal pyramid is influenced by it. If that one resistor isn't just right, it doesn't matter (much) how close the rest of them are.
But let's say instead of a Christmas tree, we go with a matrix. 9 resistors instead of 10, and I'll get rid of one of the good (1.00000000000Ω) ones to make the point.
The ideal resistance for the matrix tree below is 1.00000000000000Ω (and that is one benefit of using a matrix - it does not change the overall resistance value).
View attachment 306291
If the 1.2Ω resistor is in the R1 position (top rung) and the 0.8Ω resistor is in the R9 position (bottom rung) then the total equivalent resistance is 0.9970326409495549Ω (-0.297%)
If the 1.2Ω resistor is in the R5 position (2nd rung) and the 0.8Ω resistor is in the R9 position (bottom rung) then the total equivalent resistance is still 0.9970326409495549Ω (-0.297%)
If the 1.2Ω resistor is in the R8 position (bottom rung) and the 0.8Ω resistor is in the R9 position (bottom rung) then the total equivalent resistance is 1.0000000000000000Ω (+0.00%)
But if we go to a matrix instead of a Christmas tree, what kind of real-world results can we expect?
Let's simulate again. Mostly same code, but slight change to support matrices instead of Christmas trees:
Here are the matrix results:matrix.py:import random def generateResistor(val,minP,maxP): lo = val * (1 + (minP / 100)) hi = val * (1 + (maxP / 100)) rVal = random.uniform(lo,hi) return rVal def generateResistorString(count,val,minP,maxP): resistors = [] for i in range(0,count): resistors.append(generateResistor(val, minP, maxP)) return resistors def calculateEquivalentResistance(resistorStringList): #for Parallel strings total = 0 for resistor in resistorStringList: total += 1/resistor equivalent = 1/total return equivalent def calculateMatrix(resistorsPerTier, tiers, rVal, minP, maxP, printResults=False): branches = [] individualResistors = [] for i in range(1, tiers+1): mySeriesString = generateResistorString(resistorsPerTier, rVal, minP, maxP) for r in mySeriesString: individualResistors.append(r) total = sum(mySeriesString) branches.append(total) if printResults: print(" branch", i, "total:", total, ", individual resistors:", mySeriesString) networkResistance = calculateEquivalentResistance(branches) if printResults: print(" equivalent resistance of this matrix:",networkResistance) print(" minimum value resistor in this matrix:",min(individualResistors)) print(" maximum value resistor in this matrix:", max(individualResistors)) print(" average value resistor in this matrix:", sum(individualResistors)/len(individualResistors)) return networkResistance resistorValue = 1 minTolerance = -20 # percent maxTolerance = 20 # percent numTiers = 4 numResistors = 4 numSimulations = 100 for i in range(1,100): idealResult = calculateMatrix(numResistors,i, resistorValue, 0, 0) print(i,"rungs:",idealResult) results = [] for i in range(numSimulations): result = calculateMatrix(numResistors,numTiers, resistorValue, minTolerance, maxTolerance, True) results.append(result) idealResult = calculateMatrix(numResistors,numTiers, resistorValue, 0, 0) print("\n\nideal result:",idealResult) print("\n", numSimulations, "simulations returned the following results:", results, "\nmin:", min(results),"(",(abs(idealResult-min(results))/idealResult)*100,"% error)", "\nmax:", max(results),"(",(abs(idealResult-max(results))/idealResult)*100,"% error)", "\navg:", sum(results)/numSimulations,"(",(abs(idealResult-sum(results)/numSimulations)/idealResult)*100,"% error)",)
Test #7 : 20% resistors (-20% to +20%) at 4 tiers and 4 resistors per tier and 100 iterations of the simulation:
Test #8 : 20% resistors (-20% to +20%) at 7 tiers and 7 resistors per tier and 100 iterations of the simulation:Code:ideal result: 1.0 100 simulations returned the following results: [0.9789212891760514, 0.9985344306719774, 0.9690136572669109, 1.0175625910620119, 0.9965614364690902, 0.9982149019732224, 1.04624998958799, 1.0107882793986418, 0.957672236271445, 0.9993000670987334, 0.9982137279726447, 1.0335724215172097, 1.0019935541283347, 1.0479282108907113, 1.0802547911534015, 0.9946599921341791, 0.9767549067793089, 0.990023595336334, 0.9894514544996551, 1.0340949404893796, 1.006681346963752, 1.0239788674678305, 0.9579276387161407, 1.0007869095046829, 0.9958255348394108, 1.026483876280865, 0.9914504260531393, 1.0093391490886816, 1.0272874520999558, 0.9494690461393546, 0.9774215215861791, 1.0253201526638298, 0.9549240513461029, 1.0235349477286753, 1.0733705407678387, 0.9766582608016204, 1.0050045002198922, 1.0147624301461706, 1.0062232326674099, 0.9542793929061855, 0.9670486521365843, 1.0125766975219346, 0.9898136544672637, 0.9806289119352432, 0.9966853279728543, 1.0037358165237533, 0.9747675530622049, 1.0158624793838773, 0.9716835700914757, 1.0343467743216854, 0.9983322937653292, 0.989836397372718, 0.9637826297512135, 1.0345744785918045, 0.9942427461217929, 0.9926620554685898, 0.9648697954193125, 0.9648608274669047, 1.027183448674841, 1.0249034799773789, 1.0339037447210433, 1.0139511188383081, 0.9595910568270234, 0.951772064395024, 0.9764637615793678, 1.0176437074944513, 1.014925799082619, 1.0376066769546768, 0.9892291831147877, 0.9794627935283374, 1.0360928255777493, 0.9963987466022209, 0.9901337393323187, 1.0015499904596916, 0.9977360723546183, 1.0226849187129359, 0.9632704103942867, 0.9802150098827074, 0.9740476696398751, 1.001001998686038, 1.019573915378378, 1.0324189714715224, 1.0132851353544587, 1.0013092396806371, 0.9874683858256488, 0.9674793332220626, 0.9791646239438833, 0.9703942155127179, 1.0073897114779398, 0.964544481290691, 1.0166338808096247, 0.9959054030419638, 0.9821275593768161, 1.0076251451499845, 0.9972941970638859, 0.9896155650939906, 0.9472484632677263, 1.0082724642859358, 1.0116488260385985, 1.0288976700404089] min: 0.9472484632677263 ( 5.275153673227373 % error) max: 1.0802547911534015 ( 8.02547911534015 % error) avg: 0.9988887181739671 ( 0.11112818260329282 % error)
Test #9 : 20% resistors (-20% to +20%) at 12 tiers and 12 resistors per tier and 100 iterations of the simulation:Code:ideal result: 1.0000000000000002 100 simulations returned the following results: [1.0049576827058486, 1.0008157708969792, 0.9824863155786936, 1.0217137333107584, 0.9974858979406056, 1.0435477152950767, 0.9884795160660557, 0.9813735301648717, 1.0216891095825722, 0.9922783126175243, 0.9974463081786098, 0.9675752958519079, 0.9888653025619266, 0.9830944208718171, 0.9966421062236366, 1.010588906154264, 0.9689147635922953, 0.9814370220938325, 1.0193344832752032, 0.9579762968118454, 0.9859286735380681, 0.9802942200697424, 0.9978103150956584, 1.0220529937317446, 0.9981756683408626, 1.0203913709428196, 0.9724963525121679, 0.9813141530579015, 1.0051471913433419, 0.9788189602959452, 0.951016354093273, 0.9838879210627086, 0.9823521679720412, 0.9687157653102039, 0.9989548286321874, 1.008400182105642, 1.0033606641413462, 1.0179740890712137, 1.0108968761195765, 1.0119696221112184, 0.9853771767649373, 0.9739776568962591, 0.9823322084568604, 1.005168854518104, 1.0358755951772294, 0.9829564889992279, 0.9881544075498752, 0.9926023187351147, 0.9998716977354134, 0.9692675270899929, 0.9752011475030674, 0.9874161722751269, 0.9867304842050943, 0.9592493715706948, 0.9986722899911787, 0.9803733518350721, 0.9781055839881151, 1.0043744375035337, 0.9606854769653048, 1.001518952237496, 0.9830205017085525, 1.0075117766685902, 1.005598859110627, 1.0150857073759678, 0.9670058788034925, 1.0185849488709804, 0.9851781297297054, 1.008263678508369, 1.0035982636784684, 1.0100442333579334, 1.006143277839647, 0.990139453538291, 1.0310978256603216, 0.9903670101064954, 1.0100544007710506, 1.0003531844711093, 1.0047734148517862, 0.9748221054752805, 1.0068456273417492, 0.9925744539310705, 1.0041240165773162, 1.0084699447632262, 1.016444134135838, 1.0097243723654228, 0.9850068446486211, 0.9739265452530685, 0.9785029635254119, 1.020550601896357, 1.0081024949751236, 0.9976909658876986, 0.9891945378183941, 1.0085686987135256, 0.9898182373068176, 0.9958345699714912, 0.985657785275066, 0.9895251064215241, 0.9914112642481931, 1.0072096555827144, 1.018289631398471, 0.9958522953537312] min: 0.951016354093273 ( 4.89836459067272 % error) max: 1.0435477152950767 ( 4.35477152950765 % error) avg: 0.995195394572372 ( 0.48046054276281713 % error)
Code:ideal result: 1.0 100 simulations returned the following results: [0.983912690846084, 1.0106811374389062, 0.9961548310893096, 1.0007982917310223, 0.9995355385409292, 0.9782069204055726, 0.9935015797147766, 1.0054247551962068, 1.0032701158182316, 1.001474792508941, 0.9861742472523618, 0.9960395229540201, 1.0060036208930032, 0.9983311411335868, 1.006467333735072, 0.9819591376992678, 1.0011793806594451, 0.9886844999595555, 1.0032304795811422, 0.9819602811372139, 1.000408230543238, 0.9904944852600411, 1.0002655968792977, 0.9933021550952424, 1.0140301274880557, 0.9861779217933253, 1.004742803799152, 0.9973131222111021, 0.9887389069456496, 1.01194369967319, 0.9971950171354457, 0.9862137315791142, 1.0221028694516143, 0.989859342998855, 0.9992523086932866, 1.0017026451023623, 0.9793011592436351, 1.001793029219336, 0.9961703613836118, 0.990019144083926, 1.0074855825457065, 1.0006993723055257, 1.0076420983110337, 0.9988758487128077, 0.9808050980663007, 1.0139869916730397, 0.9869781872494657, 1.0043029945978312, 1.0083331848957686, 0.9912444323064205, 0.9889229076021828, 0.9917399875888416, 0.9890207103220248, 1.0007996184861652, 1.0030783965193197, 0.9966832439447828, 0.9980762209100709, 1.007817748520494, 1.0020434179136566, 0.9975751739060802, 1.018721272235832, 0.9960695524092081, 0.9994201086914559, 0.9866718980190501, 1.0026891413413954, 1.0036418811118752, 1.00128154270057, 1.0039438992828715, 0.9775744583511432, 0.9896382449563653, 1.0070175849478533, 0.9797515791218288, 0.9974438796954695, 0.9936781381223438, 0.9992979053294592, 1.0020396036144075, 0.9779185334345716, 1.0019133687212267, 1.0067017253652368, 1.0028359127415045, 1.000934847117415, 0.9980024706156726, 1.014396418287406, 0.9971024156446798, 1.0035888374044775, 0.9808274245037177, 1.0136598462346897, 1.0072023402127372, 1.0085174963941452, 0.98393620882173, 1.003403396714935, 0.99901143901135, 0.9995903654185379, 1.0187684495344085, 0.9971853980034491, 1.0031224449787526, 1.0104319523617196, 0.9874717422243886, 0.9990969396355713, 0.9869400237433852] min: 0.9775744583511432 ( 2.2425541648856795 % error) max: 1.0221028694516143 ( 2.2102869451614326 % error) avg: 0.9981156886030846 ( 0.18843113969153613 % error)
So this matrix method does cut down on the overall error with increasing # of resistors (when there is a random distribution of error across all the resistors), much better than the Christmas tree, but at great cost. But it does not perform the same when all the resistors have their error biased in one direction (which is very possible if they all come from the same batch).
Test #10 : 20% resistors (-0% to +20%) at 12 tiers and 12 resistors per tier and 100 iterations of the simulation:
Code:ideal result: 1.0 100 simulations returned the following results: [1.100820020793252, 1.1048235982753765, 1.0912548266329354, 1.0919443917483875, 1.0986670981719686, 1.1051261348887707, 1.102821042472663, 1.094905023488624, 1.0974683199374216, 1.105328925774763, 1.1001862098162858, 1.107229273719581, 1.0984962214385827, 1.1025406996316367, 1.0925642000633053, 1.1035716947683614, 1.0943582340943683, 1.0931583096967077, 1.1021216057109575, 1.10027455990558, 1.1037091452757446, 1.1074218140703584, 1.1023811765773706, 1.0989863951614887, 1.1043672702766103, 1.1016402415935738, 1.099652798173428, 1.1021457250577882, 1.1032580470287712, 1.090525909344153, 1.0971348400380294, 1.0997354571126887, 1.0964603915293156, 1.1040411572428668, 1.1069722927864816, 1.1001029379058558, 1.0934356046957896, 1.0996919869922097, 1.0970283705197572, 1.1035440805262549, 1.1035216554725649, 1.1029608921367848, 1.0925334088777465, 1.106080776088537, 1.095868149585995, 1.097843900415008, 1.1001790442204613, 1.0991682612069449, 1.1011429202741148, 1.099953423748293, 1.0970490351818898, 1.0990978276235597, 1.0995641948121968, 1.1036361007451176, 1.1139490598565314, 1.1037687590825942, 1.0962199840292224, 1.0995540683530007, 1.101900660552101, 1.0945911618368431, 1.099901423320125, 1.1006218218388828, 1.0943000114720034, 1.0992542133578616, 1.1095618839606656, 1.0936481755576237, 1.1011405072035048, 1.1027603049947021, 1.1034752957258742, 1.0965919357284082, 1.1072857585625706, 1.1014558802173458, 1.1006198966524476, 1.1013460755548987, 1.1038083312106743, 1.1088746257476667, 1.1010167057567959, 1.102403239366781, 1.095179782540306, 1.0999857745031176, 1.0924458236363912, 1.1027590167273442, 1.105751680330646, 1.0991356825006975, 1.0916208842550261, 1.0975937132335618, 1.0979990361020866, 1.1037960858177072, 1.0971129700997353, 1.097801660530011, 1.1025863340715942, 1.1000250663952253, 1.1039318513734286, 1.1008103571381216, 1.1082171276781185, 1.101189920183417, 1.0984300596711705, 1.1000122110680364, 1.1065466676413394, 1.1011549643708787] min: 1.090525909344153 ( 9.052590934415306 % error) max: 1.1139490598565314 ( 11.394905985653136 % error) avg: 1.1004063207313433 ( 10.040632073134326 % error)
In summary:
Just buy better resistors.
You really, really need to check your math!That series converges real fast if you use conductance in instead of resistance in that case you have:
1/1 + 1/2 + 1/3 + 1/4 = 64/64 +32/64 + 16/64 + 8/64 = 94/64 = 120/64
That is the conductance in mhos. Because resistance is just the reciprocal of ohms this
short series is 64/120 = 32/60 = 16/30 = 8/15 = 0.53333333333333333333333333333333
That is very close to what I have predicted and I am simply using fractions and your own formula. It cannot be more obvious that is converges to 0.5. So I am not sure what we are arguing about?
So, you agree with everything he is saying, including the part right up front where his results agree with everyone BUT you?Nice work
Nice work! I can see you put a lot of time into this with code and I agree with everything you are saying.![]()
Absolutely! He did his homework and did it well.So, you agree with everything he is saying, including the part right up front where his results agree with everyone BUT you?
It is simple fractions and if you take 1/1 + 1/2 + 1/4 + 1/8 that is the same as 64/64+32/64+16/64+8/64 the sum is then 122/64 which is 1.90625 mhosYou really, really need to check your math!
How on Earth do you get that 1/3 is the same as 16/64.
Take out your calculator and divide 64 by 16. Do you get 3?
How do you get that 1/4 is 8/64?
Same thing. Take a calculator and divide 64 by 8. Do you get 4?
You are claiming that
1/1 + 1/2 + 1/3 + 1/4 = 64/64 +32/64 + 16/64 + 8/64
But your right hand side reduces to
1/1 + 1/2 + 1/4 + 1/8
Then you say that your right hand side evaluates to
= 94/64 = 120/64
How can that possibly be? How can 94/something be equal to 120/something?
The series 1/(2^n) converges nicely to 2.
This is the classic series that is stated in a number of ways, including as the set up for more than one engineering joke.
Start at one end of a room and each minute move halfway from where you are to the other end of the room. The distance travelled, after an infinite amount of time, converges on being the length of the room.
But that is NOT the series you have here -- and no amount of setting the left hand side equal to what you clearly want it to be will make that so.
Now you have change the parameters.It is simple fractions and if you take 1/1 + 1/2 + 1/4 + 1/8 that is the same as 64/64+32/64+16/64+8/64 the sum is then 122/64 which is 1.90625 mhos
Now I just take the reciprocal because ohms is the reciprocal of mhos which is 1/1.90625 =
0.52459016393442622950819672131148. Now that is very close to 0.5 ohms which is close to
the answer on the bench where I have found through experimentation and the answer I also is in accord with the calculation. Thus the resistance is approaching 0.5 ohms. That is it is converging on 0.5 ohms.
Sorry but not so, consider:Now you have change the parameters.
Originally it was 1/2, 1/3, 1/4, 1/5
Now it’s 1/2, 1/4, 1/8, 1/16.
That makes a difference! Especially to the number of resistors that now have to be soldered together.
So you are trying to tell me that:Sorry
Sorry but not so, consider:
No that is not what I am trying to say. Don't you understand how to add a set of fractions?So you are trying to tell me that:
1/2, 1/3, 1/4, 1/5
is the same as
1/2, 1/4, 1/8, 1/16.
?
Really?
By the time you get to the 7th layer you are needing 127 resistors.
I know exactly how to add a set of fractions, and I seem to be rather better at it than you are*; but I don't know why you started off with one set of fractions then changed to a completely different set, whilst trying to tell us that they remained the same.No that is not what I am trying to say. Don't you understand how to add a set of fractions?
1+1/2+1/3+1/4 is the same as 24/24+12/24+8/24+4/24 which is
(24+12+8+4)/(24) which is 48/24 mhos and the reciprocal of 24/48 ohms which is divisible by 24 leaving you with 0.5 the final convergence number.
1+1/2+1/3+1/4 is the same as 24/24+12/24+8/24+4/24=I know exactly how to add a set of fractions, and I seem to be rather better at it than you are*; but I don't know why you started off with one set of fractions then changed to a completely different set, whilst trying to tell us that they remained the same.
* 1+1/2+1/3+1/4 is the same as 24/24+12/24+8/24+6/24 which is 50/24.