Homework1

Homework1 - Homework #1 (page 1 of 2) Simple MD code with...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
MSE 4270/6270: Introduction to Atomistic Simulations, Leonid Zhigilei Homework #1 (page 1 of 2) Simple MD code with Velocity Verlet algorithm Write the simplest possible one-dimensional “molecular dynamics code” for two particles connected by a spring (Force = k(x 2 -x 1 -x 0 )) where Δ x=x 2 -x 1 is the distance between particles, x 0 is the equilibrium length of the spring. Your code can have the following structure: • Define the parameters of the system (k, x 0 , m 1 , m 2 ), initial coordinates and velocities of the particles in the system (x 1 0 , x 2 0 , v 1 0 , v 2 0 ), initial time = 0, time of the simulation, and timestep of integration, Δ t. • Calculate initial force F init = k(x 2 0 -x 1 0 -x 0 ) •F old = F init , x 1 old = x 1 0 , x 2 old = x 2 0 , v 1 old = v 1 0 , v 2 old = v 2 0 • Time loop: 1. Calculate position at the current time x 1 new = x 1 old + Δ t v 1 old + Δ t 2 F old /2m 1 x 2 new = x 2 old + Δ t v 2 old - Δ t 2 F old /2m 2 2. Calculate new forces F new = k(x 2 new -x 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Homework1 - Homework #1 (page 1 of 2) Simple MD code with...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online