Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion
|
|
- Audrey Hopkins
- 5 years ago
- Views:
Transcription
1 Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion Peter Young (Dated: April 14, 2009) I. INTRODUCTION One frequently obtains detailed dynamical information about interacting classical systems from molecular dynamics (MD) simulations, which require integrating Newton s equations of motion over a long period of time starting from some initial conditions. One might be interested, for example, in following the motion of atoms in a fluid. As another example, astronomers might want to integrate the motion of the solar system for a long period of time, or consider the evolution of a galaxy by following the motions of its constituent stars. (In an astronomical setting, molecular dynamics simulations are called N-body simulations.) In this handout I will discuss an algorithm, called leapfrog, which is particularly suited for these simulations because (i) it is simple, and (ii) it has a sort of global stability (in technical jargon, the algorithm is symplectic ). I will explain what this term means, and also discuss briefly some higher order symplectic algorithms. II. THE LEAPFROG ALGORITHM We have already seen in our discussion of numerical differentiation and of numerical integration (midpoint method) that the slope of a chord between two points on a function, (x 0, f 0 ) and (x 1, f 1 ), is a much better approximation of the derivative at the midpoint, f 1/2, than at either end. We can use the same idea in a simple, elegant method for integrating Newton s laws of motion, which takes advantage of the property that the equation for dx/dt does not involve x itself and the equation for dv/dt (v is the velocity) does not involve v (assuming velocity independent forces). More precisely, for a single degree of freedom, the equations of motion are dx dt dv dt = v (1) = F (x) ( = du(x) ) dx (2)
2 2 where F (x) is the force on the particle when it is at x, U(x) is the potential energy, and for simplicity we set the mass equal to unity. (To put back the mass replace F by F/m throughout.) The Euler method would approximate Eq. (1) by x 1 = x 0 + hv 0, (3) where as usual h is the interval between time steps. A better approximation would be to replace v by its value at the midpoint of the interval, i.e. x 1 = x 0 + hv 1/2. (4) Of course, you would protest that we don t yet know v 1/2 so how can we use this. Let s finesse this for now and assume that we can get v 1/2 in some way. Then we can immediately apply a similar midpoint rule to Eq. (2) to step v forward in time, i.e. v 3/2 = v 1/2 + hf (x 1 ), (5) since we do know x 1. Then we can step forward x with x 2 = x 1 + hv 3/2 and so on. Thus, once we have started off with x 0 and v 1/2 we can continue with x and v leapfrogging over each other as shown in Fig. 1. x t/h v FIG. 1: Sketch showing the structure of the leapfrog method. The basic integration formula for the leapfrog algorithm is therefore x n+1 = x n + hv n+1/2, (6a) v n+3/2 = v n+1/2 + hf (x n+1 ) (leapfrog). (6b) How accurate is this approach? Well x 1 x 0 is of order h, and we showed earlier in the class that the expected leading error h 2 vanishes for the midpoint approximation, and so the error for one interval is h 3. To integrate over a finite time T the number of intervals is T/h and so the overall error is of proportional to h 3 (1/h) = h 2. Leapfrog is therefore a second order method,
3 3 like RK2, and better than Euler, which is only first order. We shall see shortly that, in addition to leapfrog being of higher order than Euler even though it is hardly more complicated, it has other desirable features connected with its global properties. The leapfrog method has a long history. I don t know who first introduced it but there is a nice discussion in the Feynman Lectures on Physics, Vol. I, Sec The leapfrog method, which is second order, is closely related to a modification of the Euler method called Euler-Cromer. Both Euler and Euler-Cromer are first order approximations, but Euler-Cromer is more stable. Whereas the Euler method is x n+1 = x n + hv n, (7a) v n+1 = v n + hf (x n ) (Euler), (7b) the Euler-Cromer method uses the (already computed) new value of x when computing the force in Eq. (7b), i.e. x n+1 = x n + hv n, (8a) v n+1 = v n + hf (x n+1 ) (Euler-Cromer). (8b) The Euler-Cromer method, Eqs. (8), is seen to be the same as the leapfrog method, Eqs. (6), except that the velocity is computed at the same times as the position rather than intermediate times. Thus, Euler-Cromer becomes leapfrog simply by updating the velocity by an extra half-step at the beginning, and using the resulting value of v as the starting value in Eq. (8a). By this simple change, a first order method (Euler-Cromer) becomes a second order method (leapfrog). I therefore recommend always using leapfrog rather than Euler-Cromer. More discussion on how to start the leapfrog algorithm is given in the next section. III. THE VELOCITY VERLET ALGORITHM To make leapfrog useful, however, two questions have to be addressed. The first, which we have already mentioned, is how to we start since we need v 1/2, but we only have the initial velocity v 0 (as well as the initial position x 0 ). The simplest approximation is just to do a single half step v 1/2 = v 0 + 1hF (x 2 0). (9) Although this is not a midpoint method, and so has an error of h 2 we only do this once so it does not lower the order of the method, which remains second order.
4 4 The second question to be addressed is how can we get the velocity at the same time as the position, which is needed, for example, to produce phase space plots (see below) and to to compute the energy and angular momentum. The simplest approach is to consider Eq. (6b) to be made up of two equal half steps, which successively relate v n+1 to v n+1/2 and v n+3/2 to v n+1. The leapfrog algorithm with a means of starting the algorithm and determining x and v at the same times in the way just mentioned, is called velocity Verlet. A single time step can be written as v n+1/2 = v n hf (x n), (10a) x n+1 = x n + hv n+1/2 (velocity Verlet), (10b) v n+1 = v n+1/ hf (x n+1), (10c) where n = 0, 1, 2,. Equation (10) is equivalent to Eq. (6) with the addition of a prescription for starting the algorithm off and for evaluating v and x at the same time. It looks as though we have to do two force calculations per time step in Eq. (10) but this is not so because the force in the third line is the same as the force in the first line of the next step, so it can be stored and reused. Since velocity Verlet is the same as leapfrog, it is a second order method. It is often useful to show the trajectory as a phase space plot i.e. the path in the p-x plane (where p = mv is the momentum). As an example consider the simple harmonic oscillator for which the energy is given by E = p 2 /2m + kx 2 /2, where k is the spring constant. Here we have set m = 1 and we will also set k = 1 so E = p2 2 + x2 2 (= const.) (11) Hence the phase space plot is a circle with radius equal to 2E. Figure 2 shows a phase space plot for one period of a simple harmonic oscillator using the velocity Verlet method with time step h = 0.02T, where T = 2π is the period. The starting values are x = 1, v = 0, so E = 1/2. The figure shows that the leapfrog/velocity Verlet method correctly follows the circular path in phase space (at least for one period T ). Note that instead of starting with a half step for v followed by full step for x and another half step for v, one could do the opposite: a half step for x followed by full step for v and another half step for x, i.e. x n+1/2 = x n hv n, (12a) v n+1 = v n + hf (x n+1/2 ) (position Verlet), (12b) x n+1 = x n+1/ hv n+1, (12c)
5 5 FIG. 2: Phase space plot for one orbit showing the expected circular trajectory. for n = 0, 1, 2,. This is called position Verlet. Once the algorithm has been started it is the same as velocity Verlet. It is trivial to generalize the equations of the leapfrog/verlet method to the case of more than one position and velocity. For example, for the position Verlet algorithm one has x i n+1/2 = xi n hvi n (i = 1,, N), (13a) vn+1 i = vn i + hf i ({x n+1/2 }) (i = 1,, N), (13b) x i n+1 = x i n+1/ hvi n+1 (i = 1,, N), (13c) where x i, v i (i = 1, 2,, N) are the positions and velocities, and F i ({x}) is the force which gives the acceleration of the coordinate x i, i.e. F i ({x}) = U({x})/ x i, where U is the potential energy. Each force depends, of course, on the set of all positions {x}. It is important that all the positions are updated in Eq. (13a), then all the forces are calculated using the new positions, then all the velocities are updated in Eq. (13b), and finally all the positions are updated again in Eq. (13c). IV. THE VERLET ALGORITHM If we are not interested in the velocities, but just the trajectory of the particle, we can eliminate the velocities from the algorithm since x n+2 = x n+1 + hv n+3/2 = x n+1 + h(v n+1/2 + hf (x n+1 )). (14)
6 6 In velocity Verlet we have hv n+1/2 = x n+1 x n and so we get an equation entirely for x variables: x n+2 = 2x n+1 x n + h 2 F (x n+1 ) (Verlet). (15) This Verlet algorithm is less often used than velocity or position Verlet because: (i) having the velocities is frequently useful, (ii) the Verlet algorithm is not self starting, and (iii) it is more susceptible to roundoff errors because it involves adding a very small term of order h 2 to terms of order unity. By contrast, the velocity or position Verlet schemes only add terms of order h (which is larger than h 2 since h is small) to terms of order unity. V. ADVANTAGES OF THE LEAPFROG/(VELOCITY OR POSITION) VERLET ALGORITHM In addition to combining great simplicity with second order accuracy, the leapfrog/(velocity or position) Verlet algorithm has several other desirable features: 1. Time reversal invariant. Newton s equations of motion are invariant under time reversal. What this means is as follows. Suppose we follow a trajectory from x i at some initial time t i (when the particle has velocity v i ) to x f at a later time t f (when the velocity is v f ). Now consider the time reversed trajectory which starts, at time t i, at position x f but with the opposite velocity v f. Then, at time t f, the particle will have reached the initial position x i and the velocity will be v i, see Fig. 3. original trajectory x, v, t f f f x i, v i, t i x v i t i,, f time reversed trajectory t x, v, f f i FIG. 3: Illustration of a trajectory and the time reversed trajectory. This time reversed trajectory is what you would see if you took a movie of the original trajectory and ran it backwards. Thus both the trajectory forward in time and the one backwards in time are possible trajectories. Since this is an exact symmetry of the equations, it is desirable that a numerical approximation respect it.
7 7 It is a matter of simple algebra to check that Eqs. (10) or (12) respect time reversal. Start with x 0 = X, v 0 = V, say, and determine x 1 and v 1. Then start the time reversed trajectory with x r 0 = x 1 and v0 r = v 1. The three steps of Eqs. (10) or (12) in the reversed trajectory correspond precisely to the three steps in the forward trajectory (with positions the same and velocities reversed) but in the reverse order, so one finds x r 1 = X (= x 0), v1 r = V (= v 0). The time-reversed trajectory thus retraces the forward trajectory. 2. Conserves Angular Momentum In a spherically symmetric potential, angular momentum is conserved and, remarkably, the leapfrog/(velocity or position) Verlet algorithm conserves it exactly. If the potential energy U only depends on the magnitude of r and not its direction then the force is along the direction of r, i.e. F (r) = ˆr du(r) dr where ˆr is a unit vector in the direction of r., (16) It is left as a homework exercise to show that the leapfrog algorithm conserves angular momentum for such a force. (Unfortunately, the other quantity conserved by Newton s equations, energy, is not exactly conserved in the algorithm.) It is obviously desirable that a numerical approximation respect symmetries exactly, and I m not aware of any other algorithms which conserve angular momentum exactly, though they may exist. This is obviously a plus for the leapfrog algorithm. 3. Symplectic (area preserving) The leapfrog/(velocity or position) Verlet algorithm is symplectic, i.e. area preserving. To understand what this means consider a small rectangular region of phase space of area da as shown in the left part of the Fig. 4. Let the four corners of the square, (x, p), (x + dx, p), (x, p + dp), (x + dx, p + dp) represent four possible coordinates of a particle at time t. These are labeled 1, 2, 3, 4. Then, at a later time t each of these four points will have changed, to form the corners of a parallelogram, as shown on the right of Fig. 4. Let the area of the parallelogram be da. An important theorem (Liouville s theorem) states that the areas are equal, i.e. da = da. (17)
8 8 p p da dp 1 dx 4 1 da 3 4 time t time t x x FIG. 4: Illustration which shows that integrating forward Newton s equations by a finite time can be regarded as a map in phase space (i.e. x-p space). Each point in the left hand figure, which is for time t, maps into a corresponding point in the right hand figure, which is for a later time t. The area of a region on the left, like the rectangle formed by points 1 4, is equal to the area of the corresponding region on the right, so Newtonian dynamics gives rise to an area-preserving map. I have not been able to find a simple derivation of Liouville s theorem. For a more advanced text which gives a proof, see Landau and Lifshitz, Classical Mechanics. Now (x, p) transforms to (x, p ), where x and p are some (complicated non-linear) functions of x, and p, i.e. x = X(x, p) p = P (x, p). (18) A set of equations like (18), in which the values of one set of variables (x, p here), is transformed to new values (x, p here), is called a map. Thus, the result of integration of Newton s laws by a finite amount of time can be represented as an area preserving map. Since the area preserving property is an exact feature of the equations, it is desirable that a numerical approximation preserve it. Such approximations are called symplectic. What is the condition for a map to be symplectic? To see this we need to compute the area da in the above figure, and set it equal to da (= dx dp). The area da is given by da = d e 1 d e 2, (19) where d e 1 and d e 2 are the vectors describing the two sides of the parallelogram, 1 4 and 1 2. Now the components of d e 1 are just the changes in x and p when x is changed by
9 9 dx but p is fixed, i.e. and similarly ( x d e 1 = x ( x d e 2 = p ) p ˆx + x ˆp dx, (20) ) p ˆx + p ˆp dp. (21) It is well known that the vector product in Eq. (19) can be represented as a determinant, and so we get da = JdA, (22) where J = x x p x x p p p (Jacobian) (23) is the Jacobian of the transformation from (x, p ) to (x, p) which occurs when you change variables in an integral, i.e.... dx dp =... J dxdp. (24) Hence a symplectic algorithm has det J = 1. (25) To show that Eq. (25) is satisfied for leapfrog algorithm it is convenient to consider each of the three steps in Eq. (10) separately (remember we have m = 1 here so p and v can be used interchangeably): δx 1 = C δx 1, δv 1 δv 1/2 δx 1 = B δx 0, δv 1/2 δv 1/2 δx 0 = A δx 0, (26) δv 0 δv 1/2 where C = 1 0, B = 1 h, A = 1 0, (27) h 2 F (x 1 ) h 2 F (x 0 ) 1
10 10 so δx 1 = J δx 0, (28) δv 1 δv 0 where J is given by the matrix product J = CBA. (29) It is an important (but not sufficiently well known) theorem that the determinant of a product of matrices is the the product of the determinants, i.e. det J = det C det B det A. (30) By inspection, det A = det B = det C = 1, and so det J = 1 as required, see Eq. (25). Hence the leapfrog/velocity Verlet algorithm is symplectic. However, det J is not equal to unity for the other algorithms that we have considered, Euler, RK2 and RK4. (Since RK4 is very accurate the change in area will be small, of order h 4, but not zero.) The advantage of symplectic algorithms is that they possess a sort of global stability. Since the area bounded by adjacent trajectories is preserved, we can never have the situation that we saw for the Euler algorithm earlier in the class, where the coordinates (and hence the energy) increase without bound, because this would expand the area. Even in better nonsymplectic approximations, such as RK2 and RK4, the energy will deviate substantially from its initial value at very long times. In fact one can show that the results from an approximate symplectic integrator are equal to the exact dynamics of a close by Hamiltonian, H (h) where, for the case of a second order method like leapfrog, H (h) = H + (...) h 2 + (...) h 3 +, (31) in which H = p2 + V (x) (32) 2m is the actual Hamiltonian and (...) represent the extra pieces of H (h).
11 11 VI. NUMERICAL RESULTS We now show some numerical data which illustrates the symplectic behavior of the leapfrog algorithm. As usual, we take the simple harmonic oscillator, with time step h = 0.02T (where T is the period). FIG. 5: Variation of (twice) the energy E as a function of time for the simple harmonic oscillator using the velocity Verlet algorithm (solid line) and second order Runge-Kutta (RK2) (dashed line). This for m = k = 1, with initial conditions, x = 1, v = 0 and a timestep of h = 0.02T, where the period T is 2π. Since velocity Verlet is symplectic, 2E never deviates much from its exact value of 1, but the energy in RK2 deviates more and more at long times. Figure 5 shows that although the energy deviates from the exact value, it never wanders far from the exact result. By contrast, in the RK2 algorithm the energy deviates more and more from the exact value as t increases, as shown by the thick dashed line in the figure. The energy in the leapfrog method oscillates around the correct value because the method is symplectic. Note that for very small times (less than about a half period), the error with leapfrog is actually rather worse than with RK2 (though both are of order h 2 ). It is in the long time behavior that leapfrog is better since it has global stability.
12 12 VII. HIGHER ORDER SYMPLECTIC ALGORITHMS (242 STUDENTS) Recently there has been interest in higher order algorithms which respect time reversal invariance and which are symplectic. The simplest higher order symplectic algorithm is that of E. Forest and R.D. Ruth[1], and extensions discussed in Omelyan et al.[2], which is fourth order. If initially x = x(t), v = v(t) then, in the Forest-Ruth algorithm, the following steps x = x + θ h 2 v v = v + θhf (x) x = x + (1 θ) h 2 v (33a) (33b) (33c) v = v + (1 2θ)hF (x) (FR algorithm) (33d) x = x + (1 θ) h 2 v v = v + θhf (x) x = x + θ h 2 v, (33e) (33f) (33g) with θ = , (34) yield x(t + h), v(t + h) and so generate one time step. Note that this method requires three evaluations of the force per time step, as opposed to just one for leapfrog. Note too that the steps are symmetric about the middle one (this ensures time reversal invariance). Since each step involves simply moving forward either the position or the velocity, the Jacobian of the transformation can be written, as for the leapfrog method discussed above, as a the product of determinants (7 here) each of which trivially has determinant unity. Hence the algorithm is symplectic. The hard work is to show that the algorithm gives an error of order h 5 for one interval (and hence of order h 4 when integrated over n = T/h time steps for a fixed time increment T ). This is where the strange value for θ comes from. It is curious that the middle step of the Forest-Ruth algorithm, Eq. (33d), is (i) larger in magnitude than h, since 1 2θ , and (ii), like some of the other steps, it goes backwards in time. This large step turns out out to be necessary to get a 4-th order symplectic algorithm requiring only three force evaluations per time step. If one is willing to accept more than 3 force evaluations one can avoid having a step greater in magnitude than h, as discussed in the next paragraph. However, to my knowledge, all higher order symplectic algorithms have some steps
13 13 which go backwards in time. To avoid a step which goes backward in time by more than h, one could use the Position Extended Forest-Ruth Like (PEFRL) algorithm of Omelyan et al.[2] Integrating forward one time step in this algorithm involves the following steps: x = x + ξhv v = v + (1 2λ) h 2 F (x) x = x + χhv v = v + λhf (x) (35a) (35b) (35c) (35d) x = x + (1 2(χ + ξ))hv (PEFRL algorithm) (35e) v = v + λhf (x) x = x + χhv v = v + (1 2λ) h 2 F (x) x = x + ξhv (35f) (35g) (35h) (35i) with ξ = E+00 λ = E+00 χ = E 01 (36a) (36b) (36c) This algorithm requires 4 force evaluations per time step rather than 3 for Forrest-Ruth, but it is more accurate, as we will see below, since it avoids the large time step. The following table shows results for the maximum error in 2E over one period (2E = 1 for the specified initial conditions x = 1, v = 0) for the leapfrog algorithm, Forest-Ruth (FR) algorithm, and the PEFRL algorithm of Omelyan et al. h/t leapfrog FR PEFRL By comparing the errors for the two different values of h/t one can see, as expected, that the error in the leapfrog algorithm varies as h 2 while that in the FR and PEFRL algorithms varies as h 4. Furthermore the PEFRL algorithm is about 26 times more accurate than the FR algorithm for the same value of h.
14 14 To make a fair comparison of the efficiency of the leapfrog and PEFRL algorithms, one should note that the PEFRL algorithm requires 4 times as many function evaluations per step. Hence we compare PEFRL with h/t = 0.02 and leapfrog with h/t = 0.005, which require the same number of steps; the result is that PEFRL is about still about 340 times more accurate. VIII. CONCLUSIONS Fourth-order symplectic algorithms have many advantages; they are are not very complicated but have good accuracy and global stability, so they are likely to play a major role in MD simulations in the future. However I agree with Omelyan et al. that symplectic integrators of order greater than 4 are probably not worth the extra complexity. For work in which high precision is not essential, the very simple second order velocity or position Verlet (leapfrog) method works very well, and I recommend it. [1] E. Forest and R.D. Ruth, Physica D, 43, 105 (1990) [2] I.M. Omelyan, I.M. Mryglod and R. Folk, Computer Physics Communications 146, 188 (2002),
Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion
Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion Peter Young (Dated: April 17, 23) I. INTRODUCTION One frequently obtains detailed dynamical information
More informationPhysics 115/242 Comparison of methods for integrating the simple harmonic oscillator.
Physics 115/4 Comparison of methods for integrating the simple harmonic oscillator. Peter Young I. THE SIMPLE HARMONIC OSCILLATOR The energy (sometimes called the Hamiltonian ) of the simple harmonic oscillator
More informationRunga-Kutta Schemes. Exact evolution over a small time step: Expand both sides in a small time increment: d(δt) F (x(t + δt),t+ δt) Ft + FF x ( t)
Runga-Kutta Schemes Exact evolution over a small time step: x(t + t) =x(t)+ t 0 d(δt) F (x(t + δt),t+ δt) Expand both sides in a small time increment: x(t + t) =x(t)+x (t) t + 1 2 x (t)( t) 2 + 1 6 x (t)+
More informationLecture IV: Time Discretization
Lecture IV: Time Discretization Motivation Kinematics: continuous motion in continuous time Computer simulation: Discrete time steps t Discrete Space (mesh particles) Updating Position Force induces acceleration.
More informationLecture V: The game-engine loop & Time Integration
Lecture V: The game-engine loop & Time Integration The Basic Game-Engine Loop Previous state: " #, %(#) ( #, )(#) Forces -(#) Integrate velocities and positions Resolve Interpenetrations Per-body change
More informationComputing the Universe, Dynamics IV: Liouville, Boltzmann, Jeans [DRAFT]
Computing the Universe, Dynamics IV: Liouville, Boltzmann, Jeans [DRAFT] Martin Weinberg June 24, 1998 1 Liouville s Theorem Liouville s theorem is a fairly straightforward consequence of Hamiltonian dynamics.
More informationGeometric methods for orbit integration. PiTP 2009 Scott Tremaine
Geometric methods for orbit integration PiTP 2009 Scott Tremaine spacecraft trajectories Cassini-Huygens trajectory around Saturn, 2004-2008 Planetary orbits lines = current orbits of the four inner planets
More informationScientific Computing II
Scientific Computing II Molecular Dynamics Numerics Michael Bader SCCS Technical University of Munich Summer 018 Recall: Molecular Dynamics System of ODEs resulting force acting on a molecule: F i = j
More informationAM 205 Final Project The N-Body Problem
AM 205 Final Project The N-Body Problem Leah Birch Elizabeth Finn Karen Yu December 14, 2012 Abstract The N-Body Problem can be solved using a variety of numeric integrators. Newton s Law of Universal
More informationNotes on numerical solution of differential equations
Notes on numerical solution of differential equations Some definitions, for those who don t know: A differential equation is any equation that relates a thing to its derivatives. For instance, Newton s
More informationPhysics 299: Computational Physics II Project II
Physics 99: Computational Physics II Project II Due: Feb 01 Handed out: 6 Jan 01 This project begins with a description of the Runge-Kutta numerical integration method, and then describes a project to
More informationFundamentals Physics
Fundamentals Physics And Differential Equations 1 Dynamics Dynamics of a material point Ideal case, but often sufficient Dynamics of a solid Including rotation, torques 2 Position, Velocity, Acceleration
More informationCircular motion. Aug. 22, 2017
Circular motion Aug. 22, 2017 Until now, we have been observers to Newtonian physics through inertial reference frames. From our discussion of Newton s laws, these are frames which obey Newton s first
More informationLecture 3 Dynamics 29
Lecture 3 Dynamics 29 30 LECTURE 3. DYNAMICS 3.1 Introduction Having described the states and the observables of a quantum system, we shall now introduce the rules that determine their time evolution.
More informationLecture Notes for PHY 405 Classical Mechanics
Lecture Notes for PHY 405 Classical Mechanics From Thorton & Marion s Classical Mechanics Prepared by Dr. Joseph M. Hahn Saint Mary s University Department of Astronomy & Physics September 1, 2005 Chapter
More informationPhysics 202 Laboratory 3. Root-Finding 1. Laboratory 3. Physics 202 Laboratory
Physics 202 Laboratory 3 Root-Finding 1 Laboratory 3 Physics 202 Laboratory The fundamental question answered by this week s lab work will be: Given a function F (x), find some/all of the values {x i }
More informationPh 22.1 Return of the ODEs: higher-order methods
Ph 22.1 Return of the ODEs: higher-order methods -v20130111- Introduction This week we are going to build on the experience that you gathered in the Ph20, and program more advanced (and accurate!) solvers
More informationIntegration of Differential Equations
Integration of Differential Equations Gabriel S. Cabrera August 4, 018 Contents 1 Introduction 1 Theory.1 Linear 1 st Order ODEs................................. 3.1.1 Analytical Solution...............................
More informationPhysics 115/242 The Kepler Problem
Physics 115/242 The Kepler Problem Peter Young (Dated: April 21, 23) I. INTRODUCTION We consider motion of a planet around the sun, the Kepler problem, see e.g. Garcia, Numerical Methods for Physics, Sec.
More informationPhysics 250 Green s functions for ordinary differential equations
Physics 25 Green s functions for ordinary differential equations Peter Young November 25, 27 Homogeneous Equations We have already discussed second order linear homogeneous differential equations, which
More informationNonlinear Single-Particle Dynamics in High Energy Accelerators
Nonlinear Single-Particle Dynamics in High Energy Accelerators Part 2: Basic tools and concepts Nonlinear Single-Particle Dynamics in High Energy Accelerators This course consists of eight lectures: 1.
More informationOrdinary Differential Equations (ODEs)
Ordinary Differential Equations (ODEs) NRiC Chapter 16. ODEs involve derivatives wrt one independent variable, e.g. time t. ODEs can always be reduced to a set of firstorder equations (involving only first
More informationLecture 9: Eigenvalues and Eigenvectors in Classical Mechanics (See Section 3.12 in Boas)
Lecture 9: Eigenvalues and Eigenvectors in Classical Mechanics (See Section 3 in Boas) As suggested in Lecture 8 the formalism of eigenvalues/eigenvectors has many applications in physics, especially in
More informationFigure 21:The polar and Cartesian coordinate systems.
Figure 21:The polar and Cartesian coordinate systems. Coordinate systems in R There are three standard coordinate systems which are used to describe points in -dimensional space. These coordinate systems
More informationLecture for Week 6 (Secs ) Derivative Miscellany I
Lecture for Week 6 (Secs. 3.6 9) Derivative Miscellany I 1 Implicit differentiation We want to answer questions like this: 1. What is the derivative of tan 1 x? 2. What is dy dx if x 3 + y 3 + xy 2 + x
More informationOrdinary differential equations. Phys 420/580 Lecture 8
Ordinary differential equations Phys 420/580 Lecture 8 Most physical laws are expressed as differential equations These come in three flavours: initial-value problems boundary-value problems eigenvalue
More informationPhysics 6010, Fall Relevant Sections in Text: Introduction
Physics 6010, Fall 2016 Introduction. Configuration space. Equations of Motion. Velocity Phase Space. Relevant Sections in Text: 1.1 1.4 Introduction This course principally deals with the variational
More informationOrdinary Differential Equations II
Ordinary Differential Equations II CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Justin Solomon CS 205A: Mathematical Methods Ordinary Differential Equations II 1 / 29 Almost Done! No
More informationPhysically Based Modeling: Principles and Practice Differential Equation Basics
Physically Based Modeling: Principles and Practice Differential Equation Basics Andrew Witkin and David Baraff Robotics Institute Carnegie Mellon University Please note: This document is 1997 by Andrew
More informationTP 3:Runge-Kutta Methods-Solar System-The Method of Least Squares
TP :Runge-Kutta Methods-Solar System-The Method of Least Squares December 8, 2009 1 Runge-Kutta Method The problem is still trying to solve the first order differential equation dy = f(y, x). (1) dx In
More informationIntroduction to First Order Equations Sections
A B I L E N E C H R I S T I A N U N I V E R S I T Y Department of Mathematics Introduction to First Order Equations Sections 2.1-2.3 Dr. John Ehrke Department of Mathematics Fall 2012 Course Goals The
More informationPhysically Based Modeling Differential Equation Basics
Physically Based Modeling Differential Equation Basics Andrew Witkin and David Baraff Pixar Animation Studios Please note: This document is 2001 by Andrew Witkin and David Baraff. This chapter may be freely
More informationThe two body problem involves a pair of particles with masses m 1 and m 2 described by a Lagrangian of the form:
Physics 3550, Fall 2011 Two Body, Central-Force Problem Relevant Sections in Text: 8.1 8.7 Two Body, Central-Force Problem Introduction. I have already mentioned the two body central force problem several
More informationOrdinary Differential Equations (ODEs)
Ordinary Differential Equations (ODEs) 1 Computer Simulations Why is computation becoming so important in physics? One reason is that most of our analytical tools such as differential calculus are best
More informationDynamics and Time Integration. Computer Graphics CMU /15-662, Fall 2016
Dynamics and Time Integration Computer Graphics CMU 15-462/15-662, Fall 2016 Last Quiz: IK (and demo) Last few classes Keyframing and motion capture - Q: what can one NOT do with these techniques? The
More informationOrdinary Differential Equations II
Ordinary Differential Equations II CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Justin Solomon CS 205A: Mathematical Methods Ordinary Differential Equations II 1 / 33 Almost Done! Last
More informationMass on a Horizontal Spring
Course- B.Sc. Applied Physical Science (Computer Science) Year- IInd, Sem- IVth Subject Physics Paper- XIVth, Electromagnetic Theory Lecture No. 22, Simple Harmonic Motion Introduction Hello friends in
More informationClassical Equations of Motion
3 Classical Equations of Motion Several formulations are in use Newtonian Lagrangian Hamiltonian Advantages of non-newtonian formulations more general, no need for fictitious forces better suited for multiparticle
More information1. Introductory Examples
1. Introductory Examples We introduce the concept of the deterministic and stochastic simulation methods. Two problems are provided to explain the methods: the percolation problem, providing an example
More informationENGI Partial Differentiation Page y f x
ENGI 344 4 Partial Differentiation Page 4-0 4. Partial Differentiation For functions of one variable, be found unambiguously by differentiation: y f x, the rate of change of the dependent variable can
More informationSymplectic integration. Yichao Jing
Yichao Jing Hamiltonian & symplecticness Outline Numerical integrator and symplectic integration Application to accelerator beam dynamics Accuracy and integration order Hamiltonian dynamics In accelerator,
More informationPhysics 20 Homework 3 SIMS 2016
Physics 20 Homework 3 SIMS 2016 Due: Thursday, August 25 th Special thanks to Sebastian Fischetti for problems 1, 5, and 6. Edits in red made by Keith Fratus. 1. The ballistic pendulum is a device used
More informationAP Physics C Summer Homework. Questions labeled in [brackets] are required only for students who have completed AP Calculus AB
1. AP Physics C Summer Homework NAME: Questions labeled in [brackets] are required only for students who have completed AP Calculus AB 2. Fill in the radian conversion of each angle and the trigonometric
More informationOrdinary Differential Equations
Ordinary Differential Equations We call Ordinary Differential Equation (ODE) of nth order in the variable x, a relation of the kind: where L is an operator. If it is a linear operator, we call the equation
More informationPhysics 106a, Caltech 4 December, Lecture 18: Examples on Rigid Body Dynamics. Rotating rectangle. Heavy symmetric top
Physics 106a, Caltech 4 December, 2018 Lecture 18: Examples on Rigid Body Dynamics I go through a number of examples illustrating the methods of solving rigid body dynamics. In most cases, the problem
More informationTwo-Body Problem. Central Potential. 1D Motion
Two-Body Problem. Central Potential. D Motion The simplest non-trivial dynamical problem is the problem of two particles. The equations of motion read. m r = F 2, () We already know that the center of
More informationLecture 8: Ch Sept 2018
University of Alabama Department of Physics and Astronomy PH 301 / LeClair Fall 2018 Lecture 8: Ch. 4.5-7 12 Sept 2018 1 Time-dependent potential energy Sometimes we need to consider time-dependent forces,
More informationFigure 1: Doing work on a block by pushing it across the floor.
Work Let s imagine I have a block which I m pushing across the floor, shown in Figure 1. If I m moving the block at constant velocity, then I know that I have to apply a force to compensate the effects
More informationHAMILTON S PRINCIPLE
HAMILTON S PRINCIPLE In our previous derivation of Lagrange s equations we started from the Newtonian vector equations of motion and via D Alembert s Principle changed coordinates to generalised coordinates
More informationLecture 9 - Rotational Dynamics
Lecture 9 - Rotational Dynamics A Puzzle... Angular momentum is a 3D vector, and changing its direction produces a torque τ = dl. An important application in our daily lives is that bicycles don t fall
More informationSymmetries 2 - Rotations in Space
Symmetries 2 - Rotations in Space This symmetry is about the isotropy of space, i.e. space is the same in all orientations. Thus, if we continuously rotated an entire system in space, we expect the system
More informationPHYS2330 Intermediate Mechanics Fall Final Exam Tuesday, 21 Dec 2010
Name: PHYS2330 Intermediate Mechanics Fall 2010 Final Exam Tuesday, 21 Dec 2010 This exam has two parts. Part I has 20 multiple choice questions, worth two points each. Part II consists of six relatively
More informationMoment of inertia. Contents. 1 Introduction and simple cases. January 15, Introduction. 1.2 Examples
Moment of inertia January 15, 016 A systematic account is given of the concept and the properties of the moment of inertia. Contents 1 Introduction and simple cases 1 1.1 Introduction.............. 1 1.
More informationP3317 HW from Lecture 7+8 and Recitation 4
P3317 HW from Lecture 7+8 and Recitation 4 Due Friday Tuesday September 25 Problem 1. In class we argued that an ammonia atom in an electric field can be modeled by a two-level system, described by a Schrodinger
More informationLecture 4. Magic Numbers
Lecture 4 In last lecture we discussed how one can solve the Schroedinger equation to determine the allowed energies of a particle trapped in a spherically symmetric potential. We will apply these methods
More informationThe first order formalism and the transition to the
Problem 1. Hamiltonian The first order formalism and the transition to the This problem uses the notion of Lagrange multipliers and Legendre transforms to understand the action in the Hamiltonian formalism.
More informationMATH20411 PDEs and Vector Calculus B
MATH2411 PDEs and Vector Calculus B Dr Stefan Güttel Acknowledgement The lecture notes and other course materials are based on notes provided by Dr Catherine Powell. SECTION 1: Introctory Material MATH2411
More informationHigh performance computing and numerical modeling
High performance computing and numerical modeling Volker Springel Plan for my lectures Lecture 1: Collisional and collisionless N-body dynamics Lecture 2: Gravitational force calculation Lecture 3: Basic
More informationIf the symmetry axes of a uniform symmetric body coincide with the coordinate axes, the products of inertia (Ixy etc.
Prof. O. B. Wright, Autumn 007 Mechanics Lecture 9 More on rigid bodies, coupled vibrations Principal axes of the inertia tensor If the symmetry axes of a uniform symmetric body coincide with the coordinate
More informationChapter 9 Uniform Circular Motion
9.1 Introduction Chapter 9 Uniform Circular Motion Special cases often dominate our study of physics, and circular motion is certainly no exception. We see circular motion in many instances in the world;
More informationPhysics 351, Spring 2015, Homework #6. Due at start of class, Friday, February 27, 2015
Physics 351, Spring 2015, Homework #6. Due at start of class, Friday, February 27, 2015 Course info is at positron.hep.upenn.edu/p351 When you finish this homework, remember to visit the feedback page
More information1 Phase Spaces and the Liouville Equation
Phase Spaces and the Liouville Equation emphasize the change of language from deterministic to probablistic description. Under the dynamics: ½ m vi = F i ẋ i = v i with initial data given. What is the
More informationfor changing independent variables. Most simply for a function f(x) the Legendre transformation f(x) B(s) takes the form B(s) = xs f(x) with s = df
Physics 106a, Caltech 1 November, 2018 Lecture 10: Hamiltonian Mechanics I The Hamiltonian In the Hamiltonian formulation of dynamics each second order ODE given by the Euler- Lagrange equation in terms
More informationProblem 1: Lagrangians and Conserved Quantities. Consider the following action for a particle of mass m moving in one dimension
105A Practice Final Solutions March 13, 01 William Kelly Problem 1: Lagrangians and Conserved Quantities Consider the following action for a particle of mass m moving in one dimension S = dtl = mc dt 1
More informationChapter 1 Symplectic Integrator and Beam Dynamics Simulations
Chapter 1 and Beam Accelerator Physics Group, Journal Club November 9, 2010 and Beam NSLS-II Brookhaven National Laboratory 1.1 (70) Big Picture for Numerical Accelerator Physics and Beam For single particle
More informationAP Physics C Mechanics Objectives
AP Physics C Mechanics Objectives I. KINEMATICS A. Motion in One Dimension 1. The relationships among position, velocity and acceleration a. Given a graph of position vs. time, identify or sketch a graph
More informationDifferential Equations
Electricity and Magnetism I (P331) M. R. Shepherd October 14, 2008 Differential Equations The purpose of this note is to provide some supplementary background on differential equations. The problems discussed
More informationPHYS 1114, Lecture 33, April 10 Contents:
PHYS 1114, Lecture 33, April 10 Contents: 1 This class is o cially cancelled, and has been replaced by the common exam Tuesday, April 11, 5:30 PM. A review and Q&A session is scheduled instead during class
More informationWorksheet 1: Integrators
Simulation Methods in Physics I WS 2014/2015 Worksheet 1: Integrators Olaf Lenz Alexander Schlaich Stefan Kesselheim Florian Fahrenberger Peter Košovan October 22, 2014 Institute for Computational Physics,
More informationIntroduction to symplectic integrator methods for solving diverse dynamical equations
Introduction to symplectic integrator methods for solving diverse dynamical equations Siu A. Chin Department of Physics and Astronomy Texas A&M University College Station, TX, 77840, USA Third Lecture
More informationMathematics 3210 Spring Semester, 2005 Homework notes, part 8 April 15, 2005
Mathematics 3210 Spring Semester, 2005 Homework notes, part 8 April 15, 2005 The underlying assumption for all problems is that all points, lines, etc., are taken within the Poincaré plane (or Poincaré
More informationANALYTISK MEKANIK I HT 2016
Karlstads Universitet Fysik ANALYTISK MEKANIK I HT 2016 Kursens kod: FYGB08 Kursansvarig lärare: Jürgen Fuchs rum 21F 316 tel. 054-700 1817 el.mail: juerfuch@kau.se FYGB08 HT 2016 Exercises 1 2016-12-14
More informationTranslational and Rotational Dynamics!
Translational and Rotational Dynamics Robert Stengel Robotics and Intelligent Systems MAE 345, Princeton University, 217 Copyright 217 by Robert Stengel. All rights reserved. For educational use only.
More informationChapter 3 Higher Order Linear ODEs
Chapter 3 Higher Order Linear ODEs Advanced Engineering Mathematics Wei-Ta Chu National Chung Cheng University wtchu@cs.ccu.edu.tw 1 2 3.1 Homogeneous Linear ODEs 3 Homogeneous Linear ODEs An ODE is of
More informationAY202a Galaxies & Dynamics Lecture 7: Jeans Law, Virial Theorem Structure of E Galaxies
AY202a Galaxies & Dynamics Lecture 7: Jeans Law, Virial Theorem Structure of E Galaxies Jean s Law Star/Galaxy Formation is most simply defined as the process of going from hydrostatic equilibrium to gravitational
More informationHomework 2. Solutions T =
Homework. s Let {e x, e y, e z } be an orthonormal basis in E. Consider the following ordered triples: a) {e x, e x + e y, 5e z }, b) {e y, e x, 5e z }, c) {e y, e x, e z }, d) {e y, e x, 5e z }, e) {
More informationBasic Theory of Differential Equations
page 104 104 CHAPTER 1 First-Order Differential Equations 16. The following initial-value problem arises in the analysis of a cable suspended between two fixed points y = 1 a 1 + (y ) 2, y(0) = a, y (0)
More informationConservation of Momentum. Last modified: 08/05/2018
Conservation of Momentum Last modified: 08/05/2018 Links Momentum & Impulse Momentum Impulse Conservation of Momentum Example 1: 2 Blocks Initial Momentum is Not Enough Example 2: Blocks Sticking Together
More informationPhysics 115/242 Romberg Integration
Physics 5/242 Romberg Integration Peter Young In this handout we will see how, starting from the trapezium rule, we can obtain much more accurate values for the integral by repeatedly eliminating the leading
More informationChaotic motion. Phys 750 Lecture 9
Chaotic motion Phys 750 Lecture 9 Finite-difference equations Finite difference equation approximates a differential equation as an iterative map (x n+1,v n+1 )=M[(x n,v n )] Evolution from time t =0to
More informationNumerical Methods for ODEs. Lectures for PSU Summer Programs Xiantao Li
Numerical Methods for ODEs Lectures for PSU Summer Programs Xiantao Li Outline Introduction Some Challenges Numerical methods for ODEs Stiff ODEs Accuracy Constrained dynamics Stability Coarse-graining
More informationMATH Final Review
MATH 1592 - Final Review 1 Chapter 7 1.1 Main Topics 1. Integration techniques: Fitting integrands to basic rules on page 485. Integration by parts, Theorem 7.1 on page 488. Guidelines for trigonometric
More informationQuestion 1: Spherical Pendulum
Question 1: Spherical Pendulum Consider a two-dimensional pendulum of length l with mass M at its end. It is easiest to use spherical coordinates centered at the pivot since the magnitude of the position
More informationRevision History Date Version Description Author 03/06/ Initial Version Sergio Miguel Martin. Table of Contents
Icarus Physics Engine Manual 1 - Basic Engine Operation Version 1.0 Revision History Date Version Description Author 03/06/2010 1.0 Initial Version Sergio Miguel Martin Table of Contents 1. Introduction
More informationProblems in Magnetostatics
Problems in Magnetostatics 8th February 27 Some of the later problems are quite challenging. This is characteristic of problems in magnetism. There are trivial problems and there are tough problems. Very
More information1 Ordinary differential equations
Numerical Analysis Seminar Frühjahrssemester 08 Lecturers: Prof. M. Torrilhon, Prof. D. Kressner The Störmer-Verlet method F. Crivelli (flcrivel@student.ethz.ch May 8, 2008 Introduction During this talk
More informationδ Substituting into the differential equation gives: x i+1 x i δ f(t i,x i ) (3)
Solving Differential Equations Numerically Differential equations are ubiquitous in Physics since the laws of nature often take on a simple form when expressed in terms of infinitesimal changes of the
More informationOrdinary Differential Equations
Ordinary Differential Equations In this lecture, we will look at different options for coding simple differential equations. Start by considering bicycle riding as an example. Why does a bicycle move forward?
More informationCanonical transformations (Lecture 4)
Canonical transformations (Lecture 4) January 26, 2016 61/441 Lecture outline We will introduce and discuss canonical transformations that conserve the Hamiltonian structure of equations of motion. Poisson
More informationPhysics 106a, Caltech 13 November, Lecture 13: Action, Hamilton-Jacobi Theory. Action-Angle Variables
Physics 06a, Caltech 3 November, 08 Lecture 3: Action, Hamilton-Jacobi Theory Starred sections are advanced topics for interest and future reference. The unstarred material will not be tested on the final
More informationPredicting the future with Newton s Second Law
Predicting the future with Newton s Second Law To represent the motion of an object (ignoring rotations for now), we need three functions x(t), y(t), and z(t), which describe the spatial coordinates of
More informationReview of Vector Analysis in Cartesian Coordinates
Review of Vector Analysis in Cartesian Coordinates 1 Scalar: A quantity that has magnitude, but no direction. Examples are mass, temperature, pressure, time, distance, and real numbers. Scalars are usually
More informationEnergy in Planetary Orbits
Lecture 19: Energy in Orbits, Bohr Atom, Oscillatory Motion 1 Energy in Planetary Orbits Consequences of Kepler s First and Third Laws According to Kepler s First Law of Planetary Motion, all planets move
More informationLagrangian for Central Potentials
Physics 411 Lecture 2 Lagrangian for Central Potentials Lecture 2 Physics 411 Classical Mechanics II August 29th 2007 Here we will review the Lagrange formulation in preparation for the study of the central
More informationMATHEMATICAL MODELLING, MECHANICS AND MOD- ELLING MTHA4004Y
UNIVERSITY OF EAST ANGLIA School of Mathematics Main Series UG Examination 2017 18 MATHEMATICAL MODELLING, MECHANICS AND MOD- ELLING MTHA4004Y Time allowed: 2 Hours Attempt QUESTIONS 1 and 2, and ONE other
More informationThe first term involves the cross product of two parallel vectors and so it vanishes. We then get
Physics 3550 Angular Momentum. Relevant Sections in Text: 3.4, 3.5 Angular Momentum You have certainly encountered angular momentum in a previous class. The importance of angular momentum lies principally
More informationHamilton-Jacobi theory
Hamilton-Jacobi theory November 9, 04 We conclude with the crowning theorem of Hamiltonian dynamics: a proof that for any Hamiltonian dynamical system there exists a canonical transformation to a set of
More information27. Euler s Equations
27 Euler s Equations Michael Fowler Introduction We ve just seen that by specifying the rotational direction and the angular phase of a rotating body using Euler s angles, we can write the Lagrangian in
More informationSymmetry Principles and Conservation Laws
PHYS419 Lecture 8 Symmetry Principles and Conservation Laws 1 Symmetry Principles and Conservation Laws Newtonian physics is characterized by the existence of various conservation laws, that is, principles
More informationChecking the Radioactive Decay Euler Algorithm
Lecture 2: Checking Numerical Results Review of the first example: radioactive decay The radioactive decay equation dn/dt = N τ has a well known solution in terms of the initial number of nuclei present
More information