COMPUTER METHODS IN PHYSICS
COMPUTER METHODS IN PHYSICS PHZ 3151
University of Central Florida
Popular in Course
Popular in Physics 2
This 12 page Class Notes was uploaded by Humberto Romaguera II on Thursday October 22, 2015. The Class Notes belongs to PHZ 3151 at University of Central Florida taught by Staff in Fall. Since its upload, it has received 15 views. For similar materials see /class/227504/phz-3151-university-of-central-florida in Physics 2 at University of Central Florida.
Reviews for COMPUTER METHODS IN PHYSICS
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 10/22/15
x2 Fortran 90 a little more concise approach for arrays IMPLICIT NONE INTEGER PARAMETER PreC14SELECTEDREALKND14 INTEGER jnt INTEGER PARAMETER jmax1000 ntmax1000 COMPLEXKNDPrec14 DIMENSIONOjmaX1 abCChi COMPLEXKNDPrec14 DIMENSIONOjmaX1 psi COMPLEXKNDPrec14 arai REALKINDPrec14 PARAMETER REALKINDPrec14 PARAMETER REALKINDPrec14 PARAMETER REALKINDPrec14 PARAMETER REALKINDPrec14 PARAMETER REALKINDPrec14 xsspipi L2000d0sigma30d0 x0L60d0k01414213562 dxLjmax dt01d0 alphadtldx2 For convenience define ar1 aii ai00d010d0 isqrt1 imaginary ar10d000d0 1 real Then to get complex arrays populated we can take the real part ar and the imaginary part ai Some useful things then if psij is complex psir realpsij Real part of psij psii imagpsij Imaginary part of psij mag conjgpsijpsij conjg give complex conjugate Here psir psii are real variables and mag is complex However mag should in fact have zero imaginary component Tridag solves the linear equations does all the hard work call tridagabcpsichijmax abcpsi are the inputs chi is what is returned by tridag after solving equations jmax is the length of the input arrays SUBROUTINE TRIDAGABCRUN From numerical recipes but modified for complex numbers linear equations Tridagf subroutine Solves the matrix equation Aur Here A is a tridiagonal matrix and u and r are column vectors We assume we can find ALU Here L is lower triangular and U is upper triangular So we solve LUur or Lyr where yUu Good description online in Numerical Recipes I M quot quot II 39 HI I i 39I 39II quot quot quot 1 ii 7 I 39 39I Ii I if It I l I in 39 39 I I39I 39l I l 39 39 III II in I n u L L n Forward substitution 339 N l l Backward substitution Assumes 3 1 A final note on declarations precision etc To make a single precision real number we declare REAL X Y Z These are accurate to 7 significant digits usually stored in 32 bits Single precision is the default If we want double precision REAL8 X Y Z DOUBLE PRECISION A B C INTEGER PARAMETER Prec14 SELECTEDREALKND14 REALKND Prec14 D E F Each of these gives 14 digit precision in 64 bits What physics to check We should have that the magnitude squared of the wave function Integrated over are space 1 at all times probability conservatior We can check this numerically 39339 I Enidquotiian39f IicltiT 1 l 3939 Also we can estimate the group velocity of the wave packet and compare with our calculation next time Remember it is critical that we check the physics that we know must apply eg conservation laws to verify that our code is obeying at least the minimal physical requirements Prnhahxlxly The probability is conserved Spreadingre ecting of packet amplitude Initial wave packet real and imaginary parts Spreadingre ecting of packet Rpltd Final packet real and imaginary parts while re ecting 1000 steps with dt01 what is group velocity Group velocity used k0 sqrt20 Different from project In units we are using s k0 So in 100 time units the center of the wave packet should move 100sqrt20 or 141 Just guessing from figure it starts and L6 and is at about L with L200 in final frame so this is about s167 I could be more accurate for shorter times packet spreading and reflecting makes it hard to be accurate Final packet real and imaginary parts while reflecting 1000 steps with dt01 what is group velocity
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'