计算物理ComputationalPhysics计算物理 (6).pdf
《计算物理ComputationalPhysics计算物理 (6).pdf》由会员分享,可在线阅读,更多相关《计算物理ComputationalPhysics计算物理 (6).pdf(40页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Computational physiCsNumerical methods for matrices Matrices in physics Basic matrix operations Linear equation systems Eigenvalue problemsMany problems in physics can be formulated in a matrix form Q:Where is matrix?A:Matrices are everywhere in physics!An eigenvalue problem given in the form of a p
2、artial differential equation can be rewritten as a matrix problem.A boundary-value problem after discretization is essentially a linear algebra problem.The vibrational spectrum of a molecule with n vibrational degrees of freedom can be also sloved using matrix methods.Vibration of a Moleculenjijiijn
3、qqAqqqU1,2121),(Elastic energyKinetic energynjijiijnqqMqqqT1,2121),(Lagrange equationL=T-U0iiqLdtdqLnnnnnnnnnnxxMMMMxxAAAA1111111111The roots of this secular equation,k with k=1,2,.,n,give all the possible vibrational angular frequencies wk2=k of the molecule.2 w MxAxThe determinant0MALet:0)(1njjijj
4、ijqMqA tijjexqw0)(12jnjijijxMAwKirchhoff Equations for Circuits The unbalanced Wheatstone bridge,0)(,0)(,v3322133211032211irrririririrrririri riraaaaxxsvR iaaaaxxsrrrrrrrrrrrrr323121RvR1-ii1i2i3i1-i2i2-i3i1-i3Ohms lawMatrix Quantum Mechanics In fact,any operators can be written as matrices.For examp
5、le:The spin-1/2 electron.Bases:spin up:|;spin down:|Choosing a set of bases:orthogonal,complete,unitary.Then the Hamiltonian can be written as a matrix with the elements as:jiijHThe Schrodinger equationkkk 1001 00 0110321zyxiiBasic matrix operations An n x m matrix A is defined through its elements
6、Aij with the row index i=1,2,.,n and the column index j=1,2,.,m.It is called a square matrix if n=m.A variable array x with elements x1,x2,.,xn arranged into a column is viewed as an n 1 matrix,or an n-element column matrix.A typical set of linear algebraic equations is given byfor i=1,2,.,n,where x
7、j are the unknowns to be solved,Aij are the given coefficients,and bi are the given constants.njijijbxA1bAxThe standard matrix multiplication:The summation over k requires the number of columns of the first matrix to be the same as the number of rows of the second matrix.Otherwise,the product does n
8、ot exist.The inverse of a square matrix A(written as A-1)is defined bywhere I is a unit matrix with the elements Iij=dij.ABC kkjikijBACIAAAA-1-1 for any j=1,2,.,n,where|Rij|is the determinant of the residual matrix Rij of A with its ith row and jth column removed.Cij=(-1)i+j|Rij|is called a cofactor
9、 of Aij.The determinant of an n x n matrix A is defined as:ijijnijiRA1)1(ADeterminantInverse of A In principle,the inverse of A can be obtained throughIf a matrix has an inverse or nonzero determinant,it is called a nonsingular matrix.Otherwise,it is a singular matrix.AAjiijC1-The trace of a matrix
10、A is the sum of all its diagonal elements,written asThe transpose of a matrix A(written as AT)has elements with the row and column indices of A interchanged,that is,We call A an orthogonal matrix if AT=A-1.The complex conjugate of AT is called the Hermitian operation of A(written as A)with Aij=A*ji.
11、We call A a Hermitian matrix if A=A and a unitary matrix if A=A-1.niiiAA1Tr jiijAA Tcode example To calculate the determinant,trace,transpose,and inverse of a square matrix.5.1.Matrix.cppTriangular matrixA matrix is called an upper-triangular(lower-triangular)matrix if the elements below(above)the d
12、iagonal are all zero.Ax=b.|A|!=0 and b!=0 -a unique solution.Method:Gaussian elimination-to transform the original matrix A to a triangular matrix The original matrix A=A(0)A(j):the resultant matrix after j matrix operations.Similar notation is used for the transformed b:b(j)Linear equationGaussian
13、elimination for linear equation systems CoefficientmatrixA(0)&b(0)intermediatematrixA(j)&b(j)Gaussianeliminationtriangularmatrixroots of equationsbackward substitutionsThe inverse and the determinant of a matrix can also be obtained in such a manner.)()()()()()()()(0000000012222111211nnnnnAAAAAAAAmu
14、ltiply the first equation by-Ai1(0)/A11(0)add it to the ith equation for i 1)()()()()()()()()()()()(0000000000001222211111111121nnnniniiAAAAAAAAAAAA)1()1()1()1()1()1(0022211211nnnnAAAAAAmultiply the second equation by-Ai2(1)/A22(1)1()1()1()1()1()1()1()1(002222211211nnininAAAAAAAAadd it to the ith eq
15、uation for i 2)2()2()2()2()2()2(00022211211nnnnAAAAAAcontinued with the third,fourth,.,and(n-1)th equations)1()1()1()1()1()1(000000022211211nnnnnnnnnnAAAAAAThen the coefficient matrix becomes an upper-triangular matrix A(n-1).A linear equation set with an upper-triangularcoefficient matrix can easil
16、y be solved with backward substitutions.Because all the diagonal elements are used in the denominators,the scheme would fail if any of them happened to be zero or a very small quantity.This problem can be circumvented in most cases by interchanging the rows to have the elements used for divisions be
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算物理ComputationalPhysics计算物理 6 计算 物理 ComputationalPhysics
限制150内