# 無限多個電阻器連接的等效電阻 > 作者:王一哲 > 日期:2023/4/17 <br /> ## 題目 下圖的每一個電阻器的電阻值皆為 $r$,若每3個電阻器為一組,不斷地向右連接了無窮多組的電阻器,則節點 a、b 之間的等效電阻量值為何? <img style="display: block; margin-left: auto; margin-right: auto" height="70%" width="70%" src="https://imgur.com/pXB57fF.png"> <div style="text-align:center">等效電阻題目電路圖</div> <br /><br /> ## 理論解 由於題目的圖中有無窮多組電阻器,若在節點 a、b 的右側另取兩個節點 c、d,則 a、b 及 c、d 的等效電阻值應該會相等,也就是 $R = R_{ab} = R_{cd}$,可以將電路圖改為下圖。 <img style="display: block; margin-left: auto; margin-right: auto" height="40%" width="40%" src="https://imgur.com/8ZT7FiO.png"> <div style="text-align:center">等效電阻題目電路圖</div> <br /><br /> 由上圖可得 $$ R = (R /\mkern-5mu/ r) + 2r ~\Rightarrow~ R = \frac{Rr}{R+r} + 2r ~\Rightarrow~ R^2 + Rr = Rr + 2Rr + 2r^2 \\ \Rightarrow~ R^2 - 2Rr - 2r^2 = 0 ~\Rightarrow~ R = \frac{2r \pm \sqrt{4r^2 + 8r^2}}{2} = (1 \pm \sqrt 3)r $$ 由於電阻值不可能是負值,因此答案為 $(\sqrt 3 + 1)r$ <br /><br /> ## 數值解 假設只有3個電阻器時,等效電阻 $R_0 = 3r$;再連接1組電阻器時,等效電阻 $$ R_1 = (R_0 /\mkern-5mu/ r) + 2r = \frac{R_0 r}{R_0 + r} + 2r $$ 依此類推,除了最右側的3個電阻器之外若連接了 $i$ 組電阻器時,等效電阻 $$ R_i = (R_{i-1} /\mkern-5mu/ r) + 2r = \frac{R_{i-1} r}{R_{i-1} + r} + 2r $$ 我們可以使用試算表軟體代入幾組數據,也可以寫一支只有幾何的小程式,應該就能算出很接近 $(\sqrt 3 + 1)r$ 的結果。 <br /><br /> ## 試算表軟體 不管是用 Google 試算表、MicroSoft Excel 還是 LibreOffice Calc,基本上作法都一樣。先在儲存格 A2 輸入 r 的量值 1,再於儲存格 A4 輸入以下公式計算等效電阻 $R$ 的理論值 ```python =(sqrt(3)+1)*A2 ``` 於儲存格 B2 輸入 0,再於儲存格 A3 輸入 ```python =B3+1 ``` 於儲存格 C2 輸入 ```python =3*$A$2 ``` 再於儲存格 C3 輸入 ```python =(C2*$A$2)/(C2+$A$2)+2*$A$2 ``` 框選儲存格 B3 及 C3,將滑鼠游標移到 C3 的右下角,當滑鼠游標變成黑色十字時按入滑鼠左鍵向下拖曳,讓試算表自動填滿儲存格 B4 到 C21,第12次代入數值時計算結果已經與理論值相同。 <img style="display: block; margin-left: auto; margin-right: auto" height="80%" width="80%" src="https://imgur.com/pOTQztN.png"> <div style="text-align:center"></div> <br /><br /> ## 程式語言 以下使用了 Python、C、C++,先定義變數 r = 1、R = 3\*r,接下來使用 for 迴圈計算連接第i組電阻器時的等效電阻值,第14次計算時數值已經不會再變動了。 ### Python 程式碼 ```python= r = 1 R = 3*r for i in range(1, 20): R = (R*r)/(R+r) + 2*r print("i = {:d}\tR = {:.16f}".format(i, R)) ``` <br /> 輸出結果 ``` i = 1 R = 2.7500000000000000 i = 2 R = 2.7333333333333334 i = 3 R = 2.7321428571428572 i = 4 R = 2.7320574162679425 i = 5 R = 2.7320512820512821 i = 6 R = 2.7320508416351768 i = 7 R = 2.7320508100147274 i = 8 R = 2.7320508077444812 i = 9 R = 2.7320508075814853 i = 10 R = 2.7320508075697827 i = 11 R = 2.7320508075689425 i = 12 R = 2.7320508075688821 i = 13 R = 2.7320508075688776 i = 14 R = 2.7320508075688772 i = 15 R = 2.7320508075688772 i = 16 R = 2.7320508075688772 i = 17 R = 2.7320508075688772 i = 18 R = 2.7320508075688772 i = 19 R = 2.7320508075688772 ``` <br /><br /> ### C語言程式碼 ```c= #include <stdio.h> int main() { double r = 1; double R = 3*r; for(int i=1; i<20; i++) { R = (R*r)/(R+r) + 2*r; printf("i = %d\tR = %.16f\n", i, R); } return 0; } ``` <br /> 輸出結果 ``` i = 1 R = 2.7500000000000000 i = 2 R = 2.7333333333333334 i = 3 R = 2.7321428571428572 i = 4 R = 2.7320574162679425 i = 5 R = 2.7320512820512821 i = 6 R = 2.7320508416351768 i = 7 R = 2.7320508100147274 i = 8 R = 2.7320508077444812 i = 9 R = 2.7320508075814853 i = 10 R = 2.7320508075697827 i = 11 R = 2.7320508075689425 i = 12 R = 2.7320508075688821 i = 13 R = 2.7320508075688776 i = 14 R = 2.7320508075688772 i = 15 R = 2.7320508075688772 i = 16 R = 2.7320508075688772 i = 17 R = 2.7320508075688772 i = 18 R = 2.7320508075688772 i = 19 R = 2.7320508075688772 ``` <br /><br /> ### C++程式碼 ```cpp= #include <iostream> #include <bits/stdc++.h> using namespace std; int main() { double r = 1; double R = 3*r; for(int i=1; i<20; i++) { R = (R*r)/(R+r) + 2*r; cout << "i = " << i << "\t" <<"R = " << setprecision(16) << R << endl; } return 0; } ``` <br /> 輸出結果 ``` i = 1 R = 2.75 i = 2 R = 2.733333333333333 i = 3 R = 2.732142857142857 i = 4 R = 2.732057416267943 i = 5 R = 2.732051282051282 i = 6 R = 2.732050841635177 i = 7 R = 2.732050810014727 i = 8 R = 2.732050807744481 i = 9 R = 2.732050807581485 i = 10 R = 2.732050807569783 i = 11 R = 2.732050807568942 i = 12 R = 2.732050807568882 i = 13 R = 2.732050807568878 i = 14 R = 2.732050807568877 i = 15 R = 2.732050807568877 i = 16 R = 2.732050807568877 i = 17 R = 2.732050807568877 i = 18 R = 2.732050807568877 i = 19 R = 2.732050807568877 ``` <br /><br /> ## 結語 雖然這個題目的理論計算方法很奇特,實際上也不太會遇到這樣的電路,但是卻很適合用來示範電腦及程式語言在重複代入數值計算上的優勢。我在上課時會示範給學生看,希望其中有幾個學生會因此而更想學習這些工具。 <br /><br /> --- ###### tags:`Physics`、`Google Sheets`、`Python`、`C`、`C++`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up