Physics 200 Lecture 4. Integration. Lecture 4. Physics 200 Laboratory

Similar documents
Physics 342 Lecture 23. Radial Separation. Lecture 23. Physics 342 Quantum Mechanics I

Physics 202 Laboratory 5. Linear Algebra 1. Laboratory 5. Physics 202 Laboratory

3. On the grid below, sketch and label graphs of the following functions: y = sin x, y = cos x, and y = sin(x π/2). π/2 π 3π/2 2π 5π/2

Physics 202 Laboratory 3. Root-Finding 1. Laboratory 3. Physics 202 Laboratory

Physics 106a, Caltech 13 November, Lecture 13: Action, Hamilton-Jacobi Theory. Action-Angle Variables

Physics 342 Lecture 17. Midterm I Recap. Lecture 17. Physics 342 Quantum Mechanics I

Coordinate systems and vectors in three spatial dimensions

Springs: Part I Modeling the Action The Mass/Spring System

Physics 342 Lecture 4. Probability Density. Lecture 4. Physics 342 Quantum Mechanics I

Lecture 6, September 1, 2017

Vectors and Coordinate Systems

Quantum Mechanics in Three Dimensions

Physics 351, Spring 2015, Homework #5. Due at start of class, Friday, February 20, 2015 Course info is at positron.hep.upenn.

Consider a particle in 1D at position x(t), subject to a force F (x), so that mẍ = F (x). Define the kinetic energy to be.

!T = 2# T = 2! " The velocity and acceleration of the object are found by taking the first and second derivative of the position:

Assignments VIII and IX, PHYS 301 (Classical Mechanics) Spring 2014 Due 3/21/14 at start of class

Sketchy Notes on Lagrangian and Hamiltonian Mechanics

The Particle in a Box

Updated 2013 (Mathematica Version) M1.1. Lab M1: The Simple Pendulum

Kater s Pendulum. Stuart Field and Eric Hazlett

First Year Physics: Prelims CP1 Classical Mechanics: DR. Ghassan Yassin

Chapter 4. Oscillatory Motion. 4.1 The Important Stuff Simple Harmonic Motion

Physics 342 Lecture 27. Spin. Lecture 27. Physics 342 Quantum Mechanics I

Mass on a Horizontal Spring

Constraints. Noninertial coordinate systems

Strauss PDEs 2e: Section Exercise 1 Page 1 of 6

28. Pendulum phase portrait Draw the phase portrait for the pendulum (supported by an inextensible rod)

Differential Equations

θ d2 +r 2 r dr d (d 2 +R 2 ) 1/2. (1)

Harmonic Oscillator I

Unit 7: Oscillations

Bound and Scattering Solutions for a Delta Potential

01 Harmonic Oscillations

MAT 211 Final Exam. Spring Jennings. Show your work!

Review of the Formalism of Quantum Mechanics

kg meter ii) Note the dimensions of ρ τ are kg 2 velocity 2 meter = 1 sec 2 We will interpret this velocity in upcoming slides.

1 Simple Harmonic Oscillator

Compute the Fourier transform on the first register to get x {0,1} n x 0.

Lecture 17 - Gyroscopes

Chapter 9 Notes. x cm =

Introduction Derivation General formula List of series Convergence Applications Test SERIES 4 INU0114/514 (MATHS 1)

Chapter 12. Recall that when a spring is stretched a distance x, it will pull back with a force given by: F = -kx

Figure 1: Doing work on a block by pushing it across the floor.

cauchy s integral theorem: examples

7 Pendulum. Part II: More complicated situations

Solution Set Two. 1 Problem #1: Projectile Motion Cartesian Coordinates Polar Coordinates... 3

Sample Quantum Chemistry Exam 2 Solutions

1 Infinite-Dimensional Vector Spaces

Physics 351, Spring 2017, Homework #3. Due at start of class, Friday, February 3, 2017

Exam Question 6/8 (HL/OL): Circular and Simple Harmonic Motion. February 1, Applied Mathematics: Lecture 7. Brendan Williamson.

Solutions 2: Simple Harmonic Oscillator and General Oscillations

1 Multiplicity of the ideal gas

First Year Physics: Prelims CP1. Classical Mechanics: Prof. Neville Harnew. Problem Set III : Projectiles, rocket motion and motion in E & B fields

the EL equation for the x coordinate is easily seen to be (exercise)

Lecture for Week 2 (Secs. 1.3 and ) Functions and Limits

MATH 1080 Test 2 -Version A-SOLUTIONS Fall a. (8 pts) Find the exact length of the curve on the given interval.

Lagrangian for Central Potentials

Modeling and Experimentation: Compound Pendulum

Wave Mechanics Relevant sections in text: , 2.1

ECE 487 Lecture 6 : Time-Dependent Quantum Mechanics I Class Outline:

Quantum Mechanics in Three Dimensions

2t t dt.. So the distance is (t2 +6) 3/2

Substitutions and by Parts, Area Between Curves. Goals: The Method of Substitution Areas Integration by Parts

7.1 Indefinite Integrals Calculus

Physics 235 Chapter 7. Chapter 7 Hamilton's Principle - Lagrangian and Hamiltonian Dynamics

ONE AND MANY ELECTRON ATOMS Chapter 15

Lecture XXVI. Morris Swartz Dept. of Physics and Astronomy Johns Hopkins University November 5, 2003

Chem 3502/4502 Physical Chemistry II (Quantum Mechanics) 3 Credits Spring Semester 2006 Christopher J. Cramer. Lecture 9, February 8, 2006

Physics 411 Lecture 7. Tensors. Lecture 7. Physics 411 Classical Mechanics II

Path Integrals in Quantum Mechanics

Chemistry 532 Practice Final Exam Fall 2012 Solutions

ESM 3124 Intermediate Dynamics 2012, HW6 Solutions. (1 + f (x) 2 ) We can first write the constraint y = f(x) in the form of a constraint

Physics 351, Spring 2015, Homework #6. Due at start of class, Friday, February 27, 2015

1 Exponential Functions Limit Derivative Integral... 5

Physics 351 Wednesday, February 14, 2018

Lagrangian and Hamiltonian Mechanics (Symon Chapter Nine)

Problem 1: Lagrangians and Conserved Quantities. Consider the following action for a particle of mass m moving in one dimension

Lab 10: Harmonic Motion and the Pendulum

Lab M1: The Simple Pendulum

December Exam Summary

f (x) = k=0 f (0) = k=0 k=0 a k k(0) k 1 = a 1 a 1 = f (0). a k k(k 1)x k 2, k=2 a k k(k 1)(0) k 2 = 2a 2 a 2 = f (0) 2 a k k(k 1)(k 2)x k 3, k=3

d 1 µ 2 Θ = 0. (4.1) consider first the case of m = 0 where there is no azimuthal dependence on the angle φ.

AP Physics C Mechanics Objectives

Quick Introduction to Momentum Principle. Momentum. Momentum. Basic principle not at all obvious on Earth 24/02/11

Physible: Interactive Physics Collection MA198 Proposal Rough Draft

Maxwell s equations for electrostatics

Lab 1: Simple Pendulum 1. The Pendulum. Laboratory 1, Physics 15c Due Friday, February 16, in front of Sci Cen 301

Section 6.6 Gaussian Quadrature

Periodic Motion. Periodic motion is motion of an object that. regularly repeats

Lecture 6 - Introduction to Electricity

Math 124A October 11, 2011

Earth s Magnetic Field Adapted by MMWaite from Measurement of Earth's Magnetic Field [Horizontal Component] by Dr. Harold Skelton

Examination paper for TMA4195 Mathematical Modeling

for 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

3 Space curvilinear motion, motion in non-inertial frames

Chapter 15 Periodic Motion

OSCILLATIONS ABOUT EQUILIBRIUM

Torque/Rotational Energy Mock Exam. Instructions: (105 points) Answer the following questions. SHOW ALL OF YOUR WORK.

LECTURE 19: SEPARATION OF VARIABLES, HEAT CONDUCTION IN A ROD

Various lecture notes for

Transcription:

Physics 2 Lecture 4 Integration Lecture 4 Physics 2 Laboratory Monday, February 21st, 211 Integration is the flip-side of differentiation in fact, it is often possible to write a differential equation as an integral equation. Both formulations are useful analytically, and both are useful numerically as well. We ll start by defining some common physical problems that involve the ability to integrate, and then discuss the manner in which such integrals may be approximated numerically. 4.1 Physical Motivation There are two main areas of interest for us when it comes to integrating the first is a direct integral of a physical quantity, as an example: Given µ(x), the mass per unit length along some line, say, what is the total mass between x 1 and x 2? The answer is provided by noting that the infinitesimal mass enclosed in an interval of width dx, centered at x, is dm = µ(x) dx, and then the integral follows naturally: m = x2 x 1 µ(x) dx. (4.1) The second area of interest comes from an integral formulation of a differential equation. The simplest case of an ODE that can be turned into an integral equation is Newton s second law for time-varying force: dp dt = F (t), (4.2) an object moves under the influence of a force F (t), and we want to find its momentum. The solution, if you can call it that, is an integral equation, 1 of 14

4.1. PHYSICAL MOTIVATION Lecture 4 obtained by integrating both sides of the above with respect to time: p(t) p() = t F ( t) d t (4.3) where we assume the motion begins at t = (else replace the limits of integration on the right, and the initial momentum on the left). These two types of problem are, of course, related, I could easily pose the mass along the line problem as the solution for m(x) given the ODE dm dx = µ(x), but I make the distinction to focus on problems where the integral itself is of interest (like mass), versus problems where the integral is a useful form of solution (as is the case for, for example, electrostatic potentials). 4.1.1 Direct Integral Problems We have already encountered a role for integrals (aside from computing the amount of mass or charge in a specific region of space) the quantum mechanical wave-function, ψ(x) must be normalized we require that: ψ(x) ψ(x) dx = 1, (4.4) and this condition is imposed as a constraint, separate from the differential equation governing ψ(x) (Schrödinger s equation). If we have a solution, like the one we worked out last time for the infinite square well, of the form: ( n π x ) ψ(x) = A sin, (4.5) a then we must set A by requiring that: a A 2 sin 2( n π x ) dx = 1. (4.6) a In this case, we can do the integral immediately, and we see that the above equation is: A 2 1 2 a = 1 A = 2 a, (4.7) but suppose we had a numerical approximation to ψ(x), defined on a grid: ψ j = ψ(x j ) with x j = j x we would need an approximation to the integral in order to set the overall constant for ψ j. 2 of 14

4.1. PHYSICAL MOTIVATION Lecture 4 We know that ψ(x) ψ(x) dx represents the probability of finding a particle near x, but what about other quantities of interest? Suppose, for example, we had a particular quantity f(x), a function of position, and we wanted to know the average value for this quantity given the particle s position probability. The average value for f(x) would be f = ψ(x) f(x) ψ(x) dx, (4.8) where the sandwhiching occurs for reasons you ll see later on. The point is, we could calculate a particle s average position if we knew the probability of finding it in the vicinity of x, that would be: x = ψ(x) x ψ(x) dx. (4.9) For our infinite square well example, the average value of position for a particle in a box is: x = a 2 a sin2( n π x ) x dx = 1 a 2 a (4.1) But (4.8) is an example of a more general statistical quantity. Given a probability density ρ(x), associated with the probability of getting outcome x, the average value of any function of x, call it f(x), is: f = ρ(x) f(x) dx, (4.11) and in quantum mechanics, we understand ρ(x) = ψ(x) ψ(x) is a special form. In statistics, the averages of various polynomials in x are called the moments of the distribution ρ(x), so there s the first moment, that s x, the second moment, x 2, and so on. Each moment is itself an integral and requires that we start with a probability density that has ρ(x) dx = 1, and that we are able to compute the appropriate integrals to get the averages. Again, these integrals may be difficult to carry out by hand (not much of an excuse for using a computer), or impossible (a better motivation), or the densities themselves may be numerical approximations. 3 of 14

4.1. PHYSICAL MOTIVATION Lecture 4 Classical Probability Density Last week, we studied the quantum mechanical particle in a box a particle of mass m confined to an interval x [, a]. In quantum mechanics, the answer to many experimental questions can be determined using the wavefunction and calculating moments (via the probability density interpretation of ψ ψ). But we can view classical problems in terms of probability densities as well. For example, if we think of a particle of mass m that bounces back and forth between two walls (one at zero, one at a), we can associate a probability density with the particle s position. Since the mass travels with constant speed, and turns around instantaneously at the walls, the probability of finding it within dx of any point x in the box is a constant, ρ(x) = A. We require that this density be normalized, so that ρ(x) dx = a A dx = 1 (4.12) and then A = 1/a. Now we can compute the average position of the particle, x = x ρ(x) dx = a and higher moments can also be computed. x 1 dx = a/2, (4.13) a 4.1.2 Integrals as Solutions to Problems Integrals show up as the end-point to many problems, and as a natural formulation of solutions to differential equations. In many areas of physics there is a notion of superposition, the idea that if you know the solution to a partial differential equation with a point source, you can find the solution for an arbitrary source by adding up the point-solutions of the source. As an example, take an infinite line of charge, carrying charge-per-unitlength λ(x) = Q a e x2 /a 2 for constants Q and a. We want to know the electrostatic potential a height z above the midpoint of the line (so at x = ), 4 of 14

4.1. PHYSICAL MOTIVATION Lecture 4 the setup is shown in Figure 4.1. V =? r = x 2 + z 2 z dq = λ(x) dx dx x Figure 4.1: An infinite line of charge carries a known distribution λ(x) (charge per unit length) what is the electrostatic potential a height z above the point x = on the line? We know that each point along the line contributes to the potential as a point source that is, if a little box of width dx centered at x contains charge dq, then its contribution to the potential at the point of interest is: dv = dq 4 π ɛ x 2 + z 2. (4.14) We also know that the potential satisfies superposition, so that all we have to do is add up all of the contributions, they don t interact with one another. We can perform that addition by noting that dq = λ(x) dx, from the definition of λ(x), so that: λ(x) dx dv = 4 π ɛ x 2 + z V = λ(x) dx 2 4 π ɛ x 2 + z, (4.15) 2 and there it is, an integral that we have to compute. We can clean up the actual integral a bit by removing uninteresting constants, and noting that the integrand is even, V (z) = 2 Q 4 π ɛ z a e x2 /a 2 dx. (4.16) 1 + x 2 /z2 5 of 14

4.1. PHYSICAL MOTIVATION Lecture 4 To make the units clear, we ll nondimensionalize the integrand the constant a sets the scale for the Gaussian decay, so let x a q, then: V (z) = 2 Q 4 π ɛ z e q2 dq (4.17) 1 + a 2 q 2 /z2 the constants out front are just right for a potential, and the integral is ready for numerical approximation. In this particular case, the answer is a known function of z, we end up with: [ V (z) = Q 4 π ɛ a ] e y2 K (y 2 ) y z 2 a (4.18) where K is a modified Bessel function. Regardless of its name, in the general case, what we want is a numerical function that approximates the integral and returns that approximation for a given value of z. Another place where integrals show up as natural solutions is pendulum motion. For a pendulum, a bob of mass m is suspended by a string of length L, as in Figure 4.2. ŷ ˆx θ F T m mgŷ Figure 4.2: A mass m is attached to a string of length L it moves up and back. We know the forces in the x and y direction, so Newton s second law reads: m ẍ = F T sin θ m ÿ = F T cos θ m g. (4.19) In addition, we know that the pendulum bob is constrained to travel along a path given by: x(t) = L sin θ(t) y(t) = L cos θ(t). (4.2) 6 of 14

4.1. PHYSICAL MOTIVATION Lecture 4 Taking the second derivatives of x(t) and y(t) and inputting them into (4.19), we get the angular acceleration associated with θ(t): θ = g L sin θ. (4.21) If we( multiply this equation by θ, then the left-hand side can be written as d 1 θ ) dt 2 2, and the right-hand side is g d L dt cos θ, both total derivatives in time, then: θ 2 = 2 g cos θ + A (4.22) L and to get a nice form, we let A 2 g L cos θ M, then [ ] 2 g 1/2 θ = ± L (cos θ cos θ M). (4.23) Now, we know that θ = when we get to the turning points of the motion, giving us a nice physical interpretation for θ M it is the maximum angle that the bob can make during its swing. Suppose we want the period of oscillation, a quantity that should be obtainable by integrating (4.23). In order to avoid the choice of sign for θ, let s take a well-defined quarter of the period as the bob swings from θ M to, the minus sign is relevant, and our quarter period is: L 2 g The period is T = 4 t, so: L T = 4 2 g θ M θm dθ cos θ cos θm = t. (4.24) [cos θ cos θ M ] 1/2 dθ. (4.25) The integral here can be turned into a familiar form, from a certain point of view. Note that 1 2 (1 cos θ) = sin2 (θ/2), then we have: cos θ cos θ M = ( 1 2 sin 2 (θ/2) ) ( 1 2 sin 2 (θ M /2) ) = 2 ( sin 2 (θ M /2) sin 2 (θ/2) ). (4.26) Take a substitution of the form sin(θ/2) = A sin(φ), motivated by the above, and since sin(θ M /2) = A sin(φ M ) is just a constant, we set A sin(θ M /2) 7 of 14

4.2. METHODS OF NUMERICAL INTEGRATION Lecture 4 so that φ M = 1 2 π, for simplicity. Now the difference of cosines in (4.26) can be written: cos θ cos θ M = 2 A 2 ( 1 sin 2 φ ) = 2 A 2 cos 2 φ. (4.27) To finish the change of variables, note that: 1 2 cos(θ/2) dθ = A cos(φ) dφ (4.28) so that the period integral in (4.25) is 1 L 2 π 2 A cos(φ) dφ T = 4 2 g cos(θ/2) 2 A cos φ (4.29) and use the trigonometric identity: cos 2 (θ/2) + sin 2 (θ/2) = 1 to replace the cos(θ/2) on the right with 1 A 2 sin 2 φ. Our final form is 1 L 2 π dφ T = 4 A sin(θ M /2). (4.3) g 1 A 2 sin 2 φ The integral here has a name, it is called an elliptic integral, and numerical values exist in tables. But those tables had to be made somehow... 4.2 Methods of Numerical Integration As with our discussion of numerical ODE solving, the starting point for numerical integration proceeds from a truncation of the formal definition of an integral. For a function f(x), defined on a uniformly spaced grid: f j f(x j ), for x j = j x (starting at j =, say), we know that the integral (when it exists) of f(x) from to x f is defined as: xf f(x) dx = lim x j= N f j x x N+1 = (N + 1) x = x f. (4.31) The first method we will consider just eliminates the limit, and replaces equality with, so that our approximation reads: xf f(x) dx N f j x. (4.32) j= 8 of 14

4.2. METHODS OF NUMERICAL INTEGRATION Lecture 4 This approach can be understood pictorially as an approximation to the area under a curve f(x) in one dimension. In Figure 4.3, we see the box area for the interval x j to x j+1 our integral approximation comes from adding up these box areas. As x goes to zero, the horizontal segment at the top of the box better approximates f(x j ) over the interval, so the box area approximation becomes closer to the integral value. f(x) f j box area = f j x x j x j+1 x Figure 4.3: Approximating the area under the curve using simple boxes. We can refine the area by cutting out the triangular segment associated with the box, as shown in Figure 4.4. Here, the approximation reads: xf f(x) dx = 1 2 = N j= 1 2 (f j + f j+1 ) x = 1 2 N f j x 1 2 f x + 1 2 j= N f j x + 1 2 j= N+1 k=1 f k x N f j x + 1 2 f N+1 x j= N f j x 1 2 f(x ) x + 1 2 f(x N) x. j= (4.33) where in the first line, we have rewritten the second sum using k j + 1, then re-labelled k as j in the second line. This interesting rewrite relates the two methods, which apparently only differ by the subtraction of half the 9 of 14

4.2. METHODS OF NUMERICAL INTEGRATION Lecture 4 f(x) f j f j+1 area = f j x 1 2 x (f j f j+1 ) x j x j+1 x Figure 4.4: Approximating the area under the curve with a refined box, the triangular portion at the top is cut out (using the area of a triangle, one half base times height). endpoint values. The method here, with the endpoint correction, is known as the trapezoidal rule. 1 of 14

4.2. METHODS OF NUMERICAL INTEGRATION Lecture 4 Lab In this lab, you will implement both the box integral, and trapezoidal methods. The first problem will ensure that these are working correctly, and then subsequent problems will address physical applications. Use g = 9.8 m/s 2. Problem 4.1 Write two integrators, Bint and Tint, implementing both of the methods discussed in the notes. Your integrators should take, as input, a function f, the lower and upper integration limits, x and xf, the number of points in your grid, Nsize, and output approximations to the integral I = x f x f(x) dx. Test your pair on the function: f(x) = 1 2 x2 (4.34) for x= 1 to xf= 3 using Nsize= 1. Write the result of the exact integral, and both approximations (five digits) below: 11 of 14

4.2. METHODS OF NUMERICAL INTEGRATION Lecture 4 Problem 4.2 Using your more accurate integrator, compute an approximation to the integral I = 1 sin(x) x dx (4.35) and write your answer (accurate to at least five digits with respect to the true answer) below include the number of steps you needed to get this accuracy, and describe how you determined the accuracy without knowing the exact value: 12 of 14

4.2. METHODS OF NUMERICAL INTEGRATION Lecture 4 Problem 4.3 Using the Gaussian density: ρ(x) = A e x2, find A, and the first two moments of the distribution for x= 1, xf= 1 and write them below Note that the Gaussian integral: e x2 dx = π, is a well-known result, which you are recovering here numerically. Problem 4.4 Q 4 π ɛ a Apply your integrator to (4.17) with a = 2 m, value for numerical infinity, and justify your choice: = 1 V first choose a Write the numerical value of the potential at z = 2 a below, and check your result using the built-in function BesselK. Sketch the curve of V (z) for z = 1 1 m. 13 of 14

4.2. METHODS OF NUMERICAL INTEGRATION Lecture 4 Problem 4.5 A pendulum of length L = 1 m that hangs 1 m above the ground starts a height.5 m above the ground what is the period of oscillation for this pendulum? What would the linearized period be (i.e. the one you use in introductory physics, assuming simple harmonic motion)? 14 of 14