Three atoms of a Lennard-Jones cluster lie on a line at positions , ,
PHYSICS · Multi-part · Fermi University Physics · Mathematical Methods for Physics · Computational Physics · Scientific programming for physicists
Scientific Computing for Physicists, Ch Letting the computer do advanced algebra: operators, series and differentiated programs
Problem
Three atoms of a Lennard-Jones cluster lie on a line at positions x1=0, x2=1.2σ, x3=2.4σ, with V(r)=4ϵ[(σ/r)12−(σ/r)6]. Building the full pairwise-distance array rij=∣xi−xj∣ by broadcasting the position array against itself (as in Chapter 1), the total energy is the index contraction E=21i=j∑V(rij).
((a)) Evaluate E, in units of ϵ, from the three pair distances.
((b)) Rather than differentiating by hand, generate dV/dr symbolically and use the chain rule r1j=∣xj−x1∣⇒dr1j/dx1=−1 to obtain ∂E/∂x1 (in units of ϵ/σ), summing the contributions from r12 and r13 only (the pair r23 does not involve x1).
((c)) The generic estimate says a central difference at h⋆=(3ϵmach)1/3σ≈8.7×10−6σ is good to about ϵmach2/3≈4×10−11 relative, for a third derivative of ordinary size. Generate ∂3E/∂x13 at this configuration, estimate the leading truncation error h⋆2∣∂3E/∂x13∣/6 relative to ∣∂E/∂x1∣, and say what relative tolerance a check of the generated ∂E/∂x1 against a central difference at h⋆ should use.