# Tutorial 1 MD Simulation on the Harmonic Oscillator

## 1.1 Introduction

In this tutorial, you will learn how to set up, run, and display a molecular dynamics (MD) simulation using Sophia. The simple harmonic oscillator is an ideal system for this, because it has only one moving atom– a mass connected to a fixed point by a spring – and a simple, common energy function. In the second tutorial, you will learn some of the ways of analyzing the MD trajectory.

Create a new folder for your work on this tutorial. Download the following files and put them in that folder:

## 1.3 Running the Simulation

1. Launch Sophia
2. In the Sophia Main window, click New Simulation. Optional: you may close the Sophia Main window.

1. In the Sophia Universe window, make the following selections:

• PDB File: N2_w_fixed_atom.pdb
• Force Field: GAFF
• FF Mod File: harmonic_oscillator.frcmod

1. Click “Load Universe”. You should see a blue bar in the Chimera window:

2. In the Chimera menu, select Actions / Atoms/Bonds / ball and stick. You should see a blue dumbbell in the Chimera window:

3. In the Sophia Recipe window:

• Click on Recipe #1 to highlight it. This is essential. Click “Run All Ingredients”.
• After a few seconds, the trajectory will be loaded for viewing.

## 1.4 Viewing the Energy Plot

1. The Sophia Trajectory Viewer window has controls that allow you to follow the evolution of the energy and other quantities that you will calculate later. Click on the play button (center arrow) in the Viewer Controls window to replay the trajectory. You can speed up the display by changing the step size (5 is a convenient value).

If you set your screen up so you can see the Chimera window while working in the Trajectory Viewer window, as in the figure below, you can watch the atomic motions at the same time as you monitor the energy.

## 1.5 Viewing the Bond Length Plot

1. Select both atoms in the Chimera main window. You can either

• Pull down the “Select” menu and click “Select All” or
• Hold down “control” and “shift” on your keyboard while clicking on the left atom. Select the right atom the same way. Both atoms should be highlighted in green, as in the image below.
2. From the Chimera menu, select Tools / Structure Analysis / Distances.
3. The Chimera Structure Measurements window should open.
• Click “Create”. The pair of atoms defining the distance should be highlighted in pale blue, as shown in the figure below.
4. In the Sophia Trajectory Viewer window, click “bonds”. A plot of the bond length vs. time will appear in the Bonds Plot window. The fixed atom is at x = 0, so the bond length is identical to the position of the moving atom.

You can animate the trajectory by using the arrows in the Sophia Trajectory Viewer window, shown below. Note how the oscillating values of energy and bond length are highlighted by vertical bars and dots, in coordination with the molecular image as you move through the trajectory.

## 1.6 Qualitative Description of the Simulation

Arrange the Chimera window and the Sophia Trajectory Viewer, Bonds Plot and Energy Plot windows so you can see them all at once; the arrangement below is just one example.

The image shows the simulation stopped at frame 204. The values of the potential energy, kinetic energy, total energy and bond length are highlighted with the vertical bars and dots (dots circled in red here).

Use the Trajectory Viewer controls to play the trajectory. Watch the atomic motions and the oscillations in bond length and energy.

Replay the trajectory as needed and write short answers to the following questions:

• What is the relationship between the oscillations in potential energy and kinetic energy?

• What does energy conservation have to do with the answer to the previous question?

• Why is the frequency of oscillations in potential energy (and kinetic energy) twice the frequency of the oscillations in bond length?

## 1.7 Saving the Simulation

In the Sophia Main window, click “Save Simulation…”. (If the Sophia Main Window isn’t available, you can always open it by clicking on the Sophia logo in the Chimera window.)

Navigate to a folder where you’d like to save the simulation (or create a new folder) and save it as “harm_osc1”. Sophia will create a series of files.

To reload this simulation later, open the Sophia Main Window, click on “Load Simulation…”, navigate to the appropriate folder, and select harm_osc1.sophia.

You may now either quit Sophia, or continue directly to the next tutorial.