@zhicheng-zhang1995
2016-05-31T08:25:56.000000Z
字数 3732
阅读 1791
张志城 物基一班 2013301110121
- Exercise 5.2
In this passage,I use Jacobi method to solve the partial differential equations in two cases.In both cases,the regions have no charge in them,the difference between which is the boundary condition. Besides,I consider the symmetry of the systems and get the same result by calculating only one quadrant of the x-y plane.
As we know,in regions of space that do not contain any electric charges,the electric potential obeys the Laplace's equations:
(5.1)
This is a partial differential equation,which can be solved by the following method.
We first discretize the independent variables,in this case,
x,y,z.We already know how to write a first derivative in finite difference form.For example,at the point(i,j,k) the derivative with respect to x may be written as:
(5.2)
And the second-order derivative can be written as:
(5.3)
This expression is nicely symmetric in the way it treats and ,which will turn out to reduce the overall errors in our computations.The result for the other second partial derivatives have similar forms.Inserting them all into Laplace's equation and solving for ,we have:
(5.4)
We now require a numerical strategy to determine this function,assuming that is only known at the boundaries. According to the equation (5.4),before we start calculating,we have to begin with some initial guesses for the solution;call it .To obtain the improved guess,we use equation(5.4) and to get .We then use the improved guess to get an even better guess ,etc.This general approach is called relaxation method,and is a useful way to solve several important classes of partial differential equations.The particular algorithm here we use is known as the Jacobi method.
Then I use the Jacobi method to deal with two cases.The first case is two parallel metallic walls seperately have voltage .
The second case is that a hollow metallic prism with a solid,metallic inner conductor.This prism and inner conductor are presumed to be infinite in extent along z.The inner conductor is held at and the walls of the prism at .
If I call the 'update' subroutine different times,the result will be different.
Following are figures I get separately by calling the 'update' subroutine 2,6 and 20 times.
And the following figure compares the electric field distribution I get after calling the 'update' subroutine for 2 and 20 times.
Following are the equipotential lines I get separately of this case after calling the 'update' subroutine for 2,6 and 20 times.
And the following figure shows us the electric field distribution.
Besides,I make a 3D representation of the potential distribution.
Finally,I make use of the symmetry of this system calculating the potential distribution and get the same result.
- The comparison between figures that are got after calling 'update' subroutines for different times tells us that with the increase of times of calling,the result gets improved and becomes closer to the expected result.
- Since there exists 4-symmertry in the second case,the algorithm making use of the symmetry gets the same result as the ordinary algorithm.
[1] Nicholas J.Giordano. 计算物理. 北京:清华大学出版社,2007.
[2] Thanks to the knowledge about plotting contours and field vectors I get from the website: http://matplotlib.org/examples/images_contours_and_fields/index.html