[关闭]
@zy-0815 2016-12-11T21:58:30.000000Z 字数 5592 阅读 1864

张梓桐计算物理第十二次作业

1 Problem

5.1& 5.4& 5.5

2 Abstract

The partial differential equation is of physicists' great interest for its widely applicaiton in decribing physical systems. Jacobi method and simultaneous over relaxation method are two algrithm that keep a balance of the simplicity for comprehension and accuracy of computation. Here in this passage,we are going to discuss the relation and difference with differnet methods in tackling same problem.

3 Background

3.1 Electrical Field

1.png-201.5kB

An electric field is a vector field that associates to each point in space the Coulomb force that would be experienced per unit of electric charge, by an infinitesimal test charge at that point.1 Electric fields converge and diverge at electric charges and can be induced by time-varying magnetic fields. The electric field combines with the magnetic field to form the electromagnetic field.--Wikipedia,the free Encylopeida.

a23675af8e3f092f4376057e38d8a5cf.gif-194.6kB

3.2 Jacobi Method

In numerical linear algebra, the Jacobi method (or Jacobi iterative method) is an algorithm for determining the solutions of a diagonally dominant system of linear equations. Each diagonal element is solved for, and an approximate value is plugged in. The process is then iterated until it converges.

Particularly,in our dicussion in this passage,Jacobi Method can be easily expressed as below:

3.3 Gauss-Sideal Method

In numerical linear algebra, the Gauss–Seidel method, also known as the Liebmann method or the method of successive displacement, is an iterative method used to solve a linear system of equations. It is named after the German mathematicians Carl Friedrich Gauss and Philipp Ludwig von Seidel, and is similar to the Jacobi method.

Particularly,in our dicussion in this passage,Gauss-Seidel Method can be easily expressed as below:

Worth mentioning,whilw the performance if the Gauss-Seidel akgorithm is better than that of the Jacobi method,the imporvement is only modest.It turns out that the number of iterations required for convergence with the Gauss-Siedel method is smaller,but only by a factor of 2.

But the benefits in Gauss-Seidel method is obvious,cause there is no need for us to save the old values seperately.In other words, the updating can be performed in place with using an algorithm of the form.

3.4 Simulatneous over-relaxation(SOR)

With this method ,the problem of relatively low convergence rate can be easily solved.Let be the new value of calculated.Then the change of is represented as:


However,we have seen in our previous examples that this choice of is too conservative.So to speed up convergence we will change the potential by a larger amount calculated according to:

where is a factor that measures how much we "over-relax".Choosing tuekds the Gauss-Seidel method.It turns out that if , the method does bit converge.The best choice of is

4 Source Code

1.Electric field
2.Potential

There are some points in my code that I want to illustrate:

  1. v=np.zeros((100,100))

The sentence above is to set a grids for the upcoming potential value,and we intialize them to be zero all.

  1. self.q=np.zeros((100,100))
  2. self.q[49:50,49:50]=1

Those sentences above are to set the unit charge at position (50,50),and the other part of the space to be zero.

  1. v[40:60,60]=1
  2. v[40:60,40]=-1

Those sentences above are to set the intial condition of in both and with length extended from to .

5 Results

5.1 Potential with single charge(Jacobi Method)

Now we set the unit charge at sites(50,50),and plot the potential versue(x-y) plane.

exp1.png-106.7kB

Next are the plot with distribution of potentials in 2D plane.That is the form of Coulomb's law! We now know the power of the numerrical mathod. Actually we can apply this method to more complicated systems where analytical ways can not work.

exp2.png-28.1kB

Now we set q=-1,we obtain his figurs.Its and reversed edition of q=1,obviously.

exp3.png-69.4kB

What if we set the area of all to be negative charges?

exp4.png-72.6kB

Two positive charge seperated by a distance.

0165c5deab0370ca2a733b8a4403837e.jpg.png-32.1kB

Simulated plot:

exp7.png-84.6kB

Next will be the electric field line between two repelling charge.

exp18.png-107.8kB

Two attractive points charge seperated by a distance

exp11.png-46.6kB

Simulated plot:

exp8.png-58kB

Here are the electric field lines of two attractive charges.

16.png-116.8kB

Now we change one of the charge to be ,and the other remains to be ,we will see the plot has already displayed evident insymmetry.

exp17.png-114.5kB

5.2 Potential for capacitor plates

e48884b2d40b548362f242a78e303368.gif-7.2kB

Here we plot the two parallel capaciotor with and .It is pretty symmetry and applies to the realistic situation pretty well.As the array we chosed is relatively big, so we obtained a smoth counter plot, where different color stand for different value of potential. Look pretty beautiful! Now we know the poential distribution of the capacitor system.

exp5.png-77.2kB

What the electric fields line has just told us is that the electric filed between two parallel plates are almost uniform,which corresponds to our preceding expectation.

exp14.png-112.9kB

Now we change one of the capacitor from to .In this figure, we are able to observe obvoulsy shift of the symmetry plot.

exp6.png-82.8kB

Here are the electric field plot.What is obvious to us is that the field lines are no longer symmetric at all due to the v Capacitor plates versus v

exp12.png-126kB

5.3 Potential for prism

IMG_4312(20161210-150642).jpg-193.3kB

Schematic cross-section of a hollow metallic prism with a solid metallic inner conductor.The prism and inner conductor are persumed to be infinite in extend along z.The inner conductors are held at and the walls of the prism at

exp9.png-90.6kB

Here are the electric fields line,which shows that inside the conductors,there is no electric field,which leads to the conclusion that the conductors are equal-potential body.

exp15.png-83.6kB

5.4 A lighting rod

With the limitation of grid,we only set the leght of the chaged rod from to .

exp19.png-93.7kB

Electric fields line:

exp21.png-111.1kB

6 Acknowledge

1.Wikipedia, the free encyclopedia
2.Computational Physics,Nicholas J.Giordano,Hisao Nakanishi,the second edition,2006.
3.Electric Field-Wikipedia, the free encyclopedia

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注