ASTR415: Problem Set #5

Similar documents
ME 391 Mechanical Engineering Analysis

Simulation-Solving Dynamic Models ABE 5646 Week 2, Spring 2010

Problem Set 7-7. dv V ln V = kt + C. 20. Assume that df/dt still equals = F RF. df dr = =

Solutions to Assignment 1

KEY. Math 334 Midterm I Fall 2008 sections 001 and 003 Instructor: Scott Glasgow

ln 2 1 ln y x c y C x

4.6 One Dimensional Kinematics and Integration

EXERCISES FOR SECTION 1.5

Math Wednesday March 3, , 4.3: First order systems of Differential Equations Why you should expect existence and uniqueness for the IVP

The fundamental mass balance equation is ( 1 ) where: I = inputs P = production O = outputs L = losses A = accumulation

8. Basic RL and RC Circuits

1. VELOCITY AND ACCELERATION

Elementary Differential Equations and Boundary Value Problems

MA 366 Review - Test # 1

Morning Time: 1 hour 30 minutes Additional materials (enclosed):

Theory of! Partial Differential Equations-I!

Week 1 Lecture 2 Problems 2, 5. What if something oscillates with no obvious spring? What is ω? (problem set problem)

Some Basic Information about M-S-D Systems

where the coordinate X (t) describes the system motion. X has its origin at the system static equilibrium position (SEP).

Theory of! Partial Differential Equations!

Chapter 2. First Order Scalar Equations

Outline of Topics. Analysis of ODE models with MATLAB. What will we learn from this lecture. Aim of analysis: Why such analysis matters?

Numerical Dispersion

System of Linear Differential Equations

THE 2-BODY PROBLEM. FIGURE 1. A pair of ellipses sharing a common focus. (c,b) c+a ROBERT J. VANDERBEI

Math 2214 Solution Test 1A Spring 2016

23.5. Half-Range Series. Introduction. Prerequisites. Learning Outcomes

Ordinary dierential equations

Math 36. Rumbos Spring Solutions to Assignment #6. 1. Suppose the growth of a population is governed by the differential equation.

Ordinary differential equations. Phys 750 Lecture 7

Second-Order Differential Equations

u(x) = e x 2 y + 2 ) Integrate and solve for x (1 + x)y + y = cos x Answer: Divide both sides by 1 + x and solve for y. y = x y + cos x

15. Vector Valued Functions

( ) 2. Review Exercise 2. cos θ 2 3 = = 2 tan. cos. 2 x = = x a. Since π π, = 2. sin = = 2+ = = cotx. 2 sin θ 2+

dt = C exp (3 ln t 4 ). t 4 W = C exp ( ln(4 t) 3) = C(4 t) 3.

Math 334 Test 1 KEY Spring 2010 Section: 001. Instructor: Scott Glasgow Dates: May 10 and 11.

Announcements: Warm-up Exercise:

LAB 6: SIMPLE HARMONIC MOTION

Second Order Linear Differential Equations

THE SINE INTEGRAL. x dt t

Review - Quiz # 1. 1 g(y) dy = f(x) dx. y x. = u, so that y = xu and dy. dx (Sometimes you may want to use the substitution x y

KINEMATICS IN ONE DIMENSION

23.2. Representing Periodic Functions by Fourier Series. Introduction. Prerequisites. Learning Outcomes

04. Kinetics of a second order reaction

MA 214 Calculus IV (Spring 2016) Section 2. Homework Assignment 1 Solutions

Exam 1 Solutions. 1 Question 1. February 10, Part (A) 1.2 Part (B) To find equilibrium solutions, set P (t) = C = dp

Physics 235 Chapter 2. Chapter 2 Newtonian Mechanics Single Particle

Chapter 15: Phenomena. Chapter 15 Chemical Kinetics. Reaction Rates. Reaction Rates R P. Reaction Rates. Rate Laws

LAB # 2 - Equilibrium (static)

AP Calculus BC Chapter 10 Part 1 AP Exam Problems

Motion along a Straight Line

Chapter 6. Systems of First Order Linear Differential Equations

Physics 127b: Statistical Mechanics. Fokker-Planck Equation. Time Evolution

From Particles to Rigid Bodies

Math 10B: Mock Mid II. April 13, 2016

Navneet Saini, Mayank Goyal, Vishal Bansal (2013); Term Project AML310; Indian Institute of Technology Delhi

HOMEWORK # 2: MATH 211, SPRING Note: This is the last solution set where I will describe the MATLAB I used to make my pictures.

arxiv:quant-ph/ v1 5 Jul 2004

Introduction to Physical Oceanography Homework 5 - Solutions

Two Coupled Oscillators / Normal Modes

Class Meeting # 10: Introduction to the Wave Equation

IB Physics Kinematics Worksheet

3.6 Derivatives as Rates of Change

WEEK-3 Recitation PHYS 131. of the projectile s velocity remains constant throughout the motion, since the acceleration a x

APPM 2360 Homework Solutions, Due June 10

Sterilization D Values

CHAPTER 12 DIRECT CURRENT CIRCUITS

1 1 + x 2 dx. tan 1 (2) = ] ] x 3. Solution: Recall that the given integral is improper because. x 3. 1 x 3. dx = lim dx.

Section 3.5 Nonhomogeneous Equations; Method of Undetermined Coefficients

Vehicle Arrival Models : Headway

PHYSICS 220 Lecture 02 Motion, Forces, and Newton s Laws Textbook Sections

Math 2214 Solution Test 1B Fall 2017

Lecture 4 Kinetics of a particle Part 3: Impulse and Momentum

AP CALCULUS AB 2003 SCORING GUIDELINES (Form B)

6.2 Transforms of Derivatives and Integrals.

Final Spring 2007

10. State Space Methods

Chapter #1 EEE8013 EEE3001. Linear Controller Design and State Space Analysis

Wall. x(t) f(t) x(t = 0) = x 0, t=0. which describes the motion of the mass in absence of any external forcing.

Structural Dynamics and Earthquake Engineering

Integration of the equation of motion with respect to time rather than displacement leads to the equations of impulse and momentum.

!!"#"$%&#'()!"#&'(*%)+,&',-)./0)1-*23)

Chapter 5 Kinematics

PROBLEMS FOR MATH 162 If a problem is starred, all subproblems are due. If only subproblems are starred, only those are due. SLOPES OF TANGENT LINES

Answers to 1 Homework

Parametrics and Vectors (BC Only)

Math Final Exam Solutions

Math 2142 Exam 1 Review Problems. x 2 + f (0) 3! for the 3rd Taylor polynomial at x = 0. To calculate the various quantities:

Stochastic Model for Cancer Cell Growth through Single Forward Mutation

Lab 10: RC, RL, and RLC Circuits

t + t sin t t cos t sin t. t cos t sin t dt t 2 = exp 2 log t log(t cos t sin t) = Multiplying by this factor and then integrating, we conclude that

Note: For all questions, answer (E) NOTA means none of the above answers is correct.

Ch.1. Group Work Units. Continuum Mechanics Course (MMC) - ETSECCPB - UPC

Midterm Exam Review Questions Free Response Non Calculator

Class Notes 1: Introduction. MAE 82 Engineering Mathematics

k 1 k 2 x (1) x 2 = k 1 x 1 = k 2 k 1 +k 2 x (2) x k series x (3) k 2 x 2 = k 1 k 2 = k 1+k 2 = 1 k k 2 k series

Matlab and Python programming: how to get started

2.1: What is physics? Ch02: Motion along a straight line. 2.2: Motion. 2.3: Position, Displacement, Distance

MEI STRUCTURED MATHEMATICS 4758

Math 4600: Homework 11 Solutions

Transcription:

ASTR45: Problem Se #5 Curran D. Muhlberger Universi of Marland (Daed: April 25, 27) Three ssems of coupled differenial equaions were sudied using inegraors based on Euler s mehod, a fourh-order Runge-Kua mehod, and he mehod. For even a basic ssem of wo smooh equaions, Euler s mehod performed ver poorl and was slow o converge, as he error scaled as O(h). The Runge-Kua mehod performed well for all hree ssems, converging quickl even for moderae ime seps and ehibiing an error ha scaled as O(h 4 ). The mehod, where applicable, also converged quickl o a soluion, alhough he error onl scaled as O(h 2 ). The leapfrog mehod proved o be he mos sable, conserving he energ of an orbi hroughou a long inegraion. Finall, a bisecion echnique was used when suding a Loka-Volerra Predaor-Pre model o deermine ha he minimum huning rae o achieve eincion was q =.24. I. A ONE-DIMENSIONAL SECOND-ORDER ODE Consider he second-order ordinar differenial equaion d 2 = () d2 wih he iniial condiions () =, ẋ =. The soluion is given b () = sin(). Noe ha his is a conservaive equaion, since he second derivaive of is independen of and ẋ. Therefore, he mehod is a valid inegraion scheme. This second-order equaion can be wrien as a ssem of he coupled firs-order equaions d d = d d = (2) wih iniial condiions () =, () =. Here, he eac soluion for is given b () = cos(). This ssem is in a form ha can be inegraed using Euler s mehod or a Runge-Kua mehod. Euler s mehod, he fourh-order Runge-Kua mehod (as described in []), and he mehod can all be used wih a consan sep size h. When solving his equaion numericall, h was chosen o be,.3,.,.3, and., and he equaion was inegraed from = o = 5, represening abou 2.5 periods of he sine wave. The resuls from Euler s mehod are shown in figure, he resuls from he fourh-order Runge-Kua mehod are shown in figure 2, and he resuls from he mehod are shown in figure 3. In all cases, he eac soluion () = sin() is ploed as a dashed curve. Euler s mehod converges o he soluion ver slowl and canno mainain a consan ampliude even wih small values of h. The Runge-Kua mehod does a much beer job a approimaing he soluion, being visuall indisinguishable from he eac soluion as earl as h =.. Furhermore, he ampliude of is soluions does no appear o grow over ime on his ime scale. Finall, he soluions also converge ver quickl, being visuall idenical o he eac soluion b h =. and mainaining a consan ampliude. However, for he ver large ime sep h =, he soluion drifs ou of phase wih he eac soluion fairl quickl. This behavior was no observed for he Runge-Kua soluion using he same ime sep. For each of hese mehods, we epec he error a an ime in he soluion o decrease as some power of he sep size h. To confirm his behavior, (5) sin(5) is ploed agains h on a logarihmic scale in figure 4. For all hree mehods, he slope is consan for h.. In paricular, he slope for Euler s mehod is.2, he slope for he fourh-order Runge-Kua mehod is 3.92, and he slope for he mehod is 2.. From his, we can conclude ha he error in he inegraion is h for Euler s mehod, h 4 for he Runge-Kua mehod, and h 2 for he mehod. These are he epeced dependencies for he error for each of he mehods. Euler s mehod is a firs-order mehod, meaning ha he error in each sep is O(h 2 ). Since he error a f is he accumulaion of he error from ( f )/h seps, his final error is O(h), as was observed above. Similarl, he Runge-Kua mehod used is fourh-order, wih an error in each erm of O(h 5 ). Summed over all seps, he oal error should be O(h 4 ). Finall, he error in each erm of he mehod is O(h 3 ) for a oal accumulaed error of O(h 2 ).

2 Euler Mehod (h =.) Euler Mehod (h =.3) 4 2 8 6-2 4-4 -6 2-8 - -2-2 -4-4 2 4 6 8 2 4 6-6 2 4 6 8 2 4 6 Euler Mehod (h =.) Euler Mehod (h =.3) 2.5.5 2.5.5.5 -.5 -.5 - -.5 - -2 2 4 6 8 2 4 6 -.5 2 4 6 8 2 4 6.5 Euler Mehod (h =.).5 -.5 - -.5 2 4 6 8 2 4 6 FIG. : Soluions of obeing equaion 2 using Euler s mehod for various ime seps h. The eac soluion is represened b he dashed curve.

3 Runge-Kua Mehod (h =.) Runge-Kua Mehod (h =.3).5.5.5.5 -.5 -.5 - - -.5 2 4 6 8 2 4 6 -.5 2 4 6 8 2 4 6 Runge-Kua Mehod (h =.) Runge-Kua Mehod (h =.3).5.5.5.5 -.5 -.5 - - -.5 2 4 6 8 2 4 6 -.5 2 4 6 8 2 4 6.5 Runge-Kua Mehod (h =.).5 -.5 - -.5 2 4 6 8 2 4 6 FIG. 2: Soluions of obeing equaion 2 using he fourh-order Runge-Kua mehod for various ime seps h. The eac soluion is represened b he dashed curve.

4 Mehod (h =.) Mehod (h =.3).5.5.5.5 -.5 -.5 - - -.5 2 4 6 8 2 4 6 -.5 2 4 6 8 2 4 6 Mehod (h =.) Mehod (h =.3).5.5.5.5 -.5 -.5 - - -.5 2 4 6 8 2 4 6 -.5 2 4 6 8 2 4 6.5 Mehod (h =.).5 -.5 - -.5 2 4 6 8 2 4 6 FIG. 3: Soluions of equaion using he mehod for various ime seps h. The eac soluion is represened b he dashed curve.

5 Error in Soluion a = 5 Euler Runge-Kua. Error e-4 e-6 e-8 e-.. h FIG. 4: The error of all hree mehods a = 5 for each ime sep h. II. A TWO-DIMENSIONAL ORBIT Consider he wo-dimensional orbi of a mass in he graviaional poenial given b Φ = ( + 2 2 + 2 2 ) /2 (3) The resuling acceleraion is given b ẍ = Φ. Wriing he componens eplicil, d 2 d 2 d 2 d 2 = dφ d = 2( + 22 + 2 2 ) 3/2 = dφ d = 2( + 22 + 2 2 ) 3/2 (4) This ssem of wo coupled second-order conservaive differenial equaions can be recas ino a ssem of he four coupled firs-order equaions d d = a da d = 2( + 2 2 + 2 2 ) 3/2 d d = b db d = 2( + 2 2 + 2 2 ) 3/2 (5) This equaion was solved using boh he fourh-order Runge-Kua mehod and he Leepfrog mehod. The iniial condiions were aken o be () =, ẋ() =, () =, and ẏ() =., and he soluions were inegraed ou o =. Sep sizes of,.5,.25, and. were used. The soluions using he Runge-Kua mehod are shown in figure 5, and he soluions from he mehod are ploed in figure 6. Neiher mehod achieves good convergence unil h =.25.

6 Runge-Kua Mehod (h =.) Runge-Kua Mehod (h =.5).6.8.4.6.2.4.2 -.2 -.2 -.4 -.4 -.6 -.8 -.6 - -.8 -.6 -.4 -.2.2.4.6.8 - - -.8 -.6 -.4 -.2.2.4.6.8 Runge-Kua Mehod (h =.25) Runge-Kua Mehod (h =.).8.8.6.6.4.4.2.2 -.2 -.2 -.4 -.4 -.6 -.6 -.8 -.8 - - -.8 -.6 -.4 -.2.2.4.6.8 - - -.8 -.6 -.4 -.2.2.4.6.8 FIG. 5: Orbis from he Runge-Kua soluion of equaion 5 for various ime seps h. The energ per uni mass of he paricle is given b ε = ẋ2 + ẏ 2 2 + Φ(, ) (6) The velociies needed o calculae he energ are compued as a and b in he Runge-Kua soluion of equaion 5, bu mus be eraced from he mehod b resncing he offse velociies using half Euler seps. The energ of he orbi is ploed agains for boh solvers in figure 7. The energ for h = is meaningless for boh solvers, as neiher produced sable orbis for his ime sep. However, for all smaller values of h, he energ of he soluion is sead over long periods of ime while he energ of he Runge-Kua soluion seadil decreases wih ime. Thus, while he local variaions in he energ of he soluion ma be much larger han hose of he Runge-Kua soluion, he energ is more sable over long periods of ime, indicaing ha he mehod has auomaicall enforced energ conservaion for his ssem.

7 Mehod (h =.) Mehod (h =.5) 5-5.5 - -5-2 -.5-25 -3-4 -35-3 -25-2 -5 - -5 5 - - -.5.5 Mehod (h =.25) Mehod (h =.).5.5 -.5 -.5 - - -.5.5 - - -.5.5 FIG. 6: Orbis from he soluion of equaion 4 for various ime seps h. III. THE LOTKA-VOLTERRA PREDATOR-PREY MODEL The populaions of wo species in a predaor-pre relaionship, such as rabbis and foes, can be described b he firs-order Loka-Volerra equaions ẋ = (A d) B ẏ = ( C e) + D (7) where and are he populaion densiies of he pre and predaor respecivel. A is he pre s reproducion rae, B is he pre s consumpion rae b he predaor, C is he predaor s deah rae, D is he predaor s populaion growh rae due o consumpion of he pre, and d and e are he huning raes of he pre and predaor respecivel. Here we consider an ecossem conaining rabbis and foes wih parameers A =, B =., C =.5, D =.3, and d = e =. The iniial condiions are aken o be () = 3 and () = 3. The fourh-order Runge-Kua inegraor was used o inegrae he soluion ou o = for ime seps,.5,.25, and.. Phase diagrams for each ime sep are shown in figure 8. Supposing ha boh species are huned a an equal rae q (so d = e = q), here should be some value of q such ha boh populaions become einc b = (where eincion is defined b, < 9 ). To find his value of q, a

8 Energ Conservaion (h =.) Energ Conservaion (h =.5).4.2 Runge-Kua -.56 -.565 -.57 Runge-Kua -.575 -.2 -.58 Energ -.4 Energ -.585 -.59 -.6 -.595 -.6 -.8 -.65-2 4 6 8 -.6 2 4 6 8 Energ Conservaion (h =.25) Energ Conservaion (h =.) -.57 -.572 Runge-Kua -.572 -.5722 -.5724 Runge-Kua -.574 -.5726 Energ -.576 Energ -.5728 -.573 -.578 -.5732 -.5734 -.58 -.5736 -.582 2 4 6 8 -.5738 2 3 4 5 6 7 8 9 FIG. 7: Energ Conservaion. bisecion-sle mehod was used. The value was firs brackeed b observing ha for q =, (), () > 9, and for q = 5, (), () < 9. The ssem was hen solved choosing q a he midpoin of his inerval. If boh species were found o be einc a =, he upper bound was se equal o he midpoin. Oherwise he lower bound was se equal o he midpoin. This procedure was repeaed unil he size of he inerval fell below 4, obaining 4 digis of accurac. Using a ime sep of h =., i was found ha q =.2398 is he minimum huning rae necessar o drive boh species o eincion b =. [] Press, William H., Saul A. Teukolsk, William T. Veerling, Brian P. Flanner. Numerical Recipes in FORTRAN 77: The Ar of Scienific Compuing (Volume of Forran Numerical Recipes). Second Ediion. Cambridge Universi Press, 2.

9 Runge-Kua Mehod (h =.) Runge-Kua Mehod (h =.5) 22 3 2 8 25 Predaor Densi (Foes) 6 4 2 8 Predaor Densi (Foes) 2 5 6 5 4 2 2 3 4 5 6 7 8 9 2 2 3 4 5 6 7 8 9 2 Pre Densi (Rabbis) Pre Densi (Rabbis) Runge-Kua Mehod (h =.25) Runge-Kua Mehod (h =.) 3 3 25 25 Predaor Densi (Foes) 2 5 Predaor Densi (Foes) 2 5 5 5 2 3 4 5 6 7 8 9 2 2 3 4 5 6 7 8 9 2 Pre Densi (Rabbis) Pre Densi (Rabbis) FIG. 8: Phase diagrams for he Loka-Volerra Predaor-Pre model (equaion 7) inegraed using he Runge-Kua mehod wih various ime seps.