@guoxiaowhu
2016-05-27T13:40:53.000000Z
字数 2731
阅读 1391
未分类
Author:GUO Xiao
This article will solve the electric potential and electric field of figure 5.7 and compare 3 different methods to solve this problem.
In regions of space that don't contain any electric charges,the electric potential obeys Laplace's equation
Exercise 5.7
When boundary condition is given as shown in following figure:
We can solve the distribution of electric potential by numerical method.
program code
potential.py This program used Jacobi method.
Next, I use this porgram problem5.7.py to obtain the data which describes the relationship between numbers of iterations and L.
The comparison of 3 different methods at the same accuracy:
We can see that under the same L, the convergent speeds of SOR method is faster than SOR method, which is faster than that of Jacobi method. (The smaller number of iterations is, the faster convergent speed is.)
Concretely,
Fit equation:
The number of iterations N is about proportional to .
Fit equation:
The number of iterations N is approximately proportional to .
Because most elements of the array of V are very small, the difference between and will approach 0 very much.
This a part of array .
Due to error of calculation, all elements of the array are easily regarded as 0 by computer. This may lead to some bugs.
This problem can be solved by beginning calculation from a random array, not all-zero array.
There is a little bug shortly before.Thanks to Chen Yangyao classmate, who helped me to modify my faults.