This week's sets of classical pen and paper and computational exercises deal with the motion of different objects under the influence of various forces. The relevant reading background is
In both textbooks there are many nice worked out examples. Malthe-Sørenssen's text contains also several coding examples you may find useful.
There are several pedagogical aims we have in mind with these exercises:
The above steps outline important elements of our understanding of the scientific method. Furthermore, there are also explicit coding skills we aim at such as setting up arrays, solving differential equations numerically and plotting your results. Coding practice is also an important aspect. The more we practice the better we get (hopefully). From a numerical mathematics point of view, we will solve the differential equations using Euler's method (forward Euler).
The code we will develop can be reused as a basis for coming homeworks. We can also extend the numerical solver we write here to include other methods (later) like the modified Euler method (Euler-Cromer, midpoint Euler) and more advanced methods like the family of Runge-Kutta methods and the Velocity-Verlet method.
At the end of this course, we will thus have developed a larger code (or set of codes) which will allow us to study different numerical methods (integration and differential equations) as well as being able to study different physical systems. Combined with analytical skills, the hope is that this can allow us to explore interesting and realistic physics problems. By doing so, the hope is that can lead to deeper insights about the laws of motion which govern a system.
And hopefully you can reuse many of the above solvers in other courses (our ideal).
An electron is sent through a varying electrical field. Initially, the electron is moving in the \( x \)-direction with a velocity \( v_x = 100 \) m/s. The electron enters the field when it passes the origin. The field varies with time, causing an acceleration of the electron that varies in time
$$ \boldsymbol{a}(t)=\left(−20 \mathrm{m/s}^2 −10\mathrm{m/s}^3t\right) \boldsymbol{e}_y $$The field is only acting inside a box of length \( L = 2m \).
Taylor exercise 2.3
Taylor exercise 2.6
Taylor exercise 2.26
In this example we study the motion of an object subject to a constant force, a velocity dependent force. We will reuse the code we develop here in homework 4 for a position-dependent force.
Here we limit ourselves to a ball that is thrown from a height \( h \) above the ground with an initial velocity \( \boldsymbol{v}_0 \) at time \( t=t_0 \). We assume the air resistance is proportional to the square velocity, Together with the gravitational force these are the forces acting on our system. Note that due to the specific velocity dependence, we cannot find an analytical solution for motion in the \( x \) and \( y \) directions, see the discussion in Taylor after eq. (2.61). In order to find an analytical solution we need to assume that the object is falling in the \( y \)-direction (negative direction) only.
The position of the ball as function of time is \( \boldsymbol{r}(t) \) where \( t \) is time. The position is measured with respect to a coordinate system with origin at the floor.
We assume we have an initial position \( \boldsymbol{r}(t_0)=h\boldsymbol{e}_y \) and an initial velocity \( \boldsymbol{v}_0=v_{x,0}\boldsymbol{e}_x+v_{y,0}\boldsymbol{e}_y \).
In this exercise we assume the system is influenced by the gravitational force
$$ \boldsymbol{G}=-mg\boldsymbol{e}_y $$and an air resistance given by a square law
$$ -Dv\boldsymbol{v}. $$The analytical expressions for velocity and position as functions of time will be used to compare with the numerical results in exercise 6.
We will use the above analytical results in our numerical calculations in exercise 6. The analytical solution in the \( y \)-direction only will serve as a test for our numerical solution.
This exercise should be handed in as a jupyter-notebook at D2L. Remember to write your name(s).
Last week we:
This week we will:
# let's start by importing useful packages we are familiar with
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
We will choose the following values
Can you find a reasonable value for the drag coefficient \( D \)? You need also to define an initial time and the step size \( \Delta t \). We can define the step size \( \Delta t \) as the difference between any two neighboring values in time (time steps) that we analyze within some range. It can be determined by dividing the interval we are analyzing, which in our case is time \( t_{\mathrm{final}}-t_0 \), by the number of steps we are taking \( (N) \). This gives us a step size \( \Delta t = \dfrac{t_{\mathrm{final}}-t_0}{N} \).
With these preliminaries we are now ready to plot our results from exercise 5.
We move now to the numerical solution of the differential equations as discussed in the lecture notes or Malthe-Sørenssen chapter 7.5. Let us remind ourselves about Euler's Method.
Suppose we know \( f(t) \) and its derivative \( f'(t) \). To find \( f(t+\Delta t) \) at the next step, \( t+\Delta t \), we can consider the Taylor expansion:
\( f(t+\Delta t) = f(t) + \dfrac{(\Delta t)f'(t)}{1!} + \dfrac{(\Delta t)^2f''(t)}{2!} + ... \)If we ignore the \( f'' \) term and higher derivatives, we obtain
\( f(t+\Delta t) \approx f(t) + (\Delta t)f'(t) \).This approximation is the basis of Euler's method, and the Taylor expansion suggests that it will have errors of \( O(\Delta t^2) \). Thus, one would expect it to work better, the smaller the step size \( h \) that you use. In our case the step size is \( \Delta t \).
In setting up our code we need to
The following gives you an opportunity to earn five extra credit points on each of the remaining homeworks and ten extra credit points on the midterms and finals. This assignment also covers an aspect of the scientific process that is not taught in most undergraduate programs: scientific writing. Writing scientific reports is how scientist communicate their results to the rest of the field. Knowing how to assemble a well written scientific report will greatly benefit you in you upper level classes, in graduate school, and in the work place.
The full information on extra credits is found at https://github.com/mhjensen/Physics321/blob/master/doc/Homeworks/ExtraCredits/. There you will also find examples on how to write a scientific article. Below you can also find a description on how to gain extra credits by attending scientific talks.
This assignment allows you to gain extra credit points by practicing your scientific writing. For each of the remaining homeworks you can submit the specified section of a scientific report (written about the numerical aspect of the homework) for five extra credit points on the assignment. For the two midterms and the final, submitting a full scientific report covering the numerical analysis problem will be worth ten extra points. For credit the grader must be able to tell that you put effort into the assignment (i.e. well written, well formatted, etc.). If you are unfamiliar with writing scientific reports, see the information here
The following table explains what aspect of a scientific report is due with which homework. You can submit the assignment in any format you like, in the same document as your homework, or in a different one. Remember to cite any external references you use and include a reference list. There are no length requirements, but make sure what you turn in is complete and through. If you have any questions, please contact Julie Butler at butler@frib.msu.edu.
HW/Project | Due Date | Extra Credit Assignment |
---|---|---|
HW 3 | 2-4 | Abstract |
HW 4 | 2-11 | Introduction |
HW 5 | 2-18 | Methods |
HW 6 | 3-18 | Results and Discussion |
Midterm 1 | 3-4 | Full Written Report |
HW 7 | 3-25 | Abstract |
HW 8 | 4-15 | Introduction |
HW 9 | 4-22 | Results and Discussion |
Midterm 2 | _4-8_ | Full Written Report |
HW 10 | 4-29 | Abstract |
Final | 5-6 | Full Written Report |
You can also gain extra credits if you attend scientific talks. This is described here.
This opportunity will allow you to earn up to 5 extra credit points on a Homework per week. These points can push you above 100% or help make up for missed exercises. In order to earn all points you must:
Approved talks: Talks given by researchers through the following clubs:
If you have any questions please consult Julie or Morten
All the material on extra credits is at https://github.com/mhjensen/Physics321/blob/master/doc/Homeworks/ExtraCredits/.