Skip to content

Exercise 7

Part of the course Computational Chemistry.

Molecular dynamics yields the time evolution of a (molecular) system. For a dimer, this is a motion in a one-dimensional potential.

Task 7.1: Task force

Write a function morse_force(distance:float) -> float which yields the force of a Morse potential at distance x with all parameters being one.

Task 7.2: Take a leap

Write a function propagate(initial_velocity: float, initial_position: float, timestep: float, duration: float) which implements an velocity verlet integrator for moving in the one-dimensional potential with given initial conditions for a fixed time in small steps. Choose the duration such that motion becomes visible. Plot the resulting trajectory (i.e. position over time).

Task 7.3: Break it

Explore how the trajectory changes if you choose differnt starting conditions and different time steps: when does it break down and which behavior is physical? Can you identify patterns in what is stable and what is not?