Midterm 1 (Due 28 Feb)#

Spring 2025

import numpy as np
from math import *
import matplotlib.pyplot as plt
import pandas as pd
%matplotlib inline
plt.style.use('seaborn-v0_8-colorblind')

Part 1, Particle in a one-dimensional potential (60 points)#

We consider a particle (for example an atom) of mass \(m\) moving in a one-dimensional potential,

\[ V(x)=\frac{V_0}{d^4}\left(x^4-2x^2d^2+d^4\right). \]

We will assume all other forces on the particle are small in comparison, and neglect them in our model. The parameters \(V_0\) and \(d\) are known constants.

  1. (5pt) Sketch or plot the potential and find the equilibrium points (stable and unstable) by requiring that the first derivative of the potential is zero. Make an energy diagram (see for example Malthe-Sørenssen chapter 11.3) and mark the equilibrium points on the diagram and characterize their stability. The position of the particle is \(x\).

  1. (5pt) Choose two different energies that give two distinct types of motions, draw them on the energy diagram, and describe the motion in each case.

  1. (5pt) If the particle starts at rest at \(x=2d\), what is the velocity of the particle at the point \(x=d\)?

  1. (5pt) If the particle starts at \(x=d\) with velocity \(v_0\), how large must \(v_0\) be for the particle to reach the point \(x=−d\)?

  1. (5pt) Use the above potential to find the net force acting on the particle. Find the acceleration acting on the particle. Is this net force conservative? Calculate the curl of the force \(\boldsymbol{\nabla}\times \boldsymbol{F}\) in order to validate your conclusion.

  2. (5pt) Are linear momentum and angular momentum conserved? You need to show this by calculating these quantities.

  1. (10pt) Write a numerical algorithm to find the position and velocity of the particle at a time \(t+\Delta t\) given the position and velocity at a time \(t\). Here you can use either the standard forward Euler, or the Euler-Cromer or the Velocity Verlet algorithms. You need to justify your choice here (hint: consider energy conservation).

  1. (10pt) Use now your program to find the position of the particle as function of time from \(t=0\) to \(t=30\) s using a mass \(m=1.0\) kg, the parameter \(V_0=1\) J and \(d=0.1\) m. Make a plot of three distinct positions with initial conditions \(x_0=d\) and \(v_0=0.5\) m/s, \(x_0=d\) and \(v_0=1.5\) m/s, and \(x_0=d\) and \(v_0=2.5\) m/s. Plot the velocity. Perform these analyses with and without the term \(x^4\) in the potential. Do you see a difference? What do you notice?

  1. (10pt) Describe the behavior of the particle for the three initial conditions and sketch the motion in an energy diagram. Is energy conserved in your simulations?

Part 2, model your own system (50 points)#

In this problem, you will choose a one dimensional system of your own. You may choose a known potential, or you may invent your own. Your potential must:

  1. Have at least one stable equilibrium point.

  2. Have at least one unstable equilibrium point, or some other interesting feature (e.g., asymptotic behavior).

  3. For some choice of total energy, it should have oscillatory motion (i.e., classical turning points).

  4. Produce a non-linear and conservative force.

  5. Be continuous and differentiable over the range of interest.

For this problem, you will need to perform the following tasks:

  1. (5pts) Write down the potential and start to demonstrate that it meets the above criteria. Make sure it is conservative and that the force is nonlinear before proceeding.

  2. (5pts) Sketch or plot the potential and find the equilibrium points. You need to show you can compute the equilibrium points and characterize their stability. For some choices of potential, you may need to use a numerical method to find the equilibrium points and conceptual arguments to determine their stability.

  3. (10pts) Pick a total energy that gives rise to oscillatory motion. Show this by sketching or plotting the energy diagram and describing the motion. Are there any other kinds of motion that can occur for other choices of total energy?

  4. (20pts) Write a numerical algorithm to find the position and velocity of the particle (it’s trajectories) for the choice of total energy where the motion is oscillatory. Here you must use two methods: (1) the standard forward Euler, and either (2) the Euler-Cromer or the Velocity Verlet algorithms. You will need to pick the time step \(\Delta t\) and the total time \(t_{\rm max}\) for your simulation. Compare the results of the two algorithms. Which one is better? Justify your answer. You might find this numerical integration resource helpful.

  5. (10pts) Use your program to plot the energy of the particle (T), the potential energy (V), and the total energy (E) as a function of time. Discuss the behavior of the energy between each choice of algorithm. Is energy conserved in your simulations?

Part 3, Planning your project (25 points)#

Each student should complete this part individually.#

Why?

This question assesses a core part of the learning goals for our course. Even if you are working on a team for this final project, you should be able to articulate your own ideas and plans. This is an important skill for working on a team and for developing your own ideas.

On homework 4, we asked you to review the University of Oslo’s computational essay showroom. We asked you to find a computational essay that you found interesting and to write a short paragraph about why you found it interesting. In this part of the midterm, we ask you to plan your own computational essay.

We hear from students that often the hardest part of developing a computational essay is often finding a question worth investigating. So we are trying to help you with that. You are not expected to write the computational essay for this midterm. Instead, you are expected to plan it.

For your final project, you will develop a computational essay. Your answers to this question do not commit you to completing this project on the idea you present here. You can change your mind later. This is a good exercise to get you thinking about what you might want to do, and you might find that you want to work on this plan for your final project.

For each of the questions below, you should write a paragraph or two (minimum 250 words, maximum 500 words) to answer the question. You may include equations, code, or figures in any of your answers.

  1. (5pt) What is the question(s) you want to investigate? What background information do you need to understand the question(s)? Where can you find that information?

  2. (5pt) What is the motivation for the question(s)? Why is it interesting to you? Why is it interesting to others?

  3. (5pt) What is the computational aspect of the question(s)? What will you calculate? What will you simulate? What will you visualize?

  4. (5pt) Outline the structure of the set up and the analysis that you think that you need in order to answer the question(s) you have. What are the key steps you would need to take? What are the key challenges you anticipate?

  5. (5pt) How will you know if you have answered the question(s)? What are the key results you would be looking for?