计算物理第12次作业

Name: 贺一珺
Student Number: 2014302290002

Question

  • 5.1 Solve for the potential in the prism geometry in Figure 5.4.
  • 5.4 Investigate how the magnitude of the fringing field of a parallel plate capacitor, that is, the electric field outside the central region of the capacitor in Figure 5.6, varies as a function of the plate seperation.
  • 5.6 Calculate the electric potential and field near a lightning rod. Model this as a very long and narrow metal rod held at a high voltage, with one end near a conducting plane. Of special interest is the field near the tip of the rod.
  • 5.7 Write two progrems to solve the capacitor problem of Figure 5.6 and 5.7, one using the Jacobi method and one using the SOR algorithm. For a fixed accuracy compare the number of iterations, N_iter, that each algorithm requires as a function of the number of grid elements, L. Show that for the Jacobi method N_iter ~ L^2, while with SOR N_iter ~ L.

Abstract

In last chapter I calculated the trejectory of planets and analys several conditions that lead to chaos. In this chapter I will try to use python to solve several diffrential equations under different boundary conditions.
The potential in space satisfies the Laplace equation:

Laplace equation

Given specific boundary conditions, we can work out the eqaution analytically. However, the boundary conditions in the real world has never been that easy. Thus we need to find numberical ways to solve the problem. In this chapter we learned that in 2-dimensional cases, the whole space can be approximate as a net and the value on each point is the average of the volue of its surrending points.
In this homework, I will try to use Jacobi method, Gauss-Seidel method and simultaneous over-relaxation method which increase the speed of approximation.

Background

Relaxation (iterative method)

In numerical mathematics, relaxation methods are iterative methods for solving systems of equations, including nonlinear systems.

Relaxation methods were developed for solving large sparse linear systems, which arose as finite-difference discretizations of differential equations. They are also used for the solution of linear equations for linear least-squares problems and also for systems of linear inequalities, such as those arising in linear programming. They have also been developed for solving nonlinear systems of equations.

Relaxation methods are important especially in the solution of linear systems used to model elliptic partial differential equations, such as Laplace's equation and its generalization, Poisson's equation. These equations describe boundary-value problems, in which the solution-function's values are specified on boundary of a domain; the problem is to compute a solution also on its interior. Relaxation methods are used to solve the linear equations resulting from a discretization of the differential equation, for example by finite differences.

These iterative methods of relaxation should not be confused with "relaxations" in mathematical optimization, which approximate a difficult problem by a simpler problem, whose "relaxed" solution provides information about the solution of the original problem.

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. This algorithm is a stripped-down version of the Jacobi transformation method of matrix diagonalization.

Gauss–Seidel 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. Though it can be applied to any matrix with non-zero elements on the diagonals, convergence is only guaranteed if the matrix is either diagonally dominant, or symmetric and positive definite.

Plotting

(For concenience, small changes of my code will not be shown here.)

5.1

Here is code1
Here is code2

I use Gauss-Seidel to do this calculation and here I get the result:
The potential is:

Electrical potential

Here is the 3D picture:


3D plotting

And here I get the electric field:


Electric field

5.4

Here is code

I use Gauss-Seidel to do this calculation and here I get the result:

Plate seperation: 0.6

The potential is:

Electrical potential

Here is the 3D picture:

3D plotting

And here I get the electric field:

Electric field
Plate seperation: 0.4
Electrical potential

Here is 3D picture:

3D plotting
Plate seperation: 0.1

Here is electric potential:

potential

3D plotting:

3D plotting
Plate seperation: 0.5

Here is electric potential:

potential

Here is 3D picture:

3D plotting

5.6

Here is code1
Here is code2
Here is the electric potential:

Electric potential

Here is 3D picture:

3D plotting

Here is electric field:

Electric field

5.7

Here is code
Now I will compare the G-S method and SOR method:

Comparasion

It can be easily concluded from this picture that the speed of converence of SOR method is significantly better than that of Gauss-Seidel method.

Acknowledgement

  • Prof. Cai
  • Yuqiao Wu
  • wikipedia

How to contect me?

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 文/素心说 2006年,有个人从我家里走了就没再回来过;十年后,又一个人来了家里再也不会走了。 06年离开的那个人...
    素心说阅读 452评论 3 10
  • 怀着一颗犹疑的心。 这是就要奔向远方了么。 一辈子的生活,要怎么计划,未来怎样发展,我好像从来没想过。 这世上最难...
    梵谷脸谱阅读 487评论 0 51
  • 那时你一头乌发 夜晚倒扣在你的脸上 两颗星辰闪烁 灰色的泥巴长在脚上 紧紧抓住那一方土地 为了温饱 后来在家乡的稻...
    何圳鑫阅读 167评论 0 0