Complexity Explorer Santa Fe Institute

Ordinary Differential Equations

Lead instructor: Elizabeth Bradley

Your progress is not being saved! Enroll now or log in to track your progress or submit homework.

10.1 Unit 3 Homework » Homework Part 3

Quiz scores are NOT recorded.

  • You may come back to quizzes and take them as many times as you like
  • When you are finished, clicking the "Score" button at the bottom of the test will show you the correct responses.

Instructions

(The following questions are refered to in the solutions video as Part A, Part B, Part C, Part D, and Part E of Question 3.)

As you observed in the previous two problems, forward and backward Euler both make errors. Combining the two of them, however, can be surprisingly effective. Implement a solver that averages a forward and backward Euler step:

\vec{x}(t+\Delta t)=\vec{x}(t)+\frac{\Delta t}{2}\bigg[f(\vec{x}(t))+f(\vec{x}{__F}{__E}(t+\Delta t))\bigg]

Here \vec{x}{__F}{__E}(t+\Delta t) is the result of applying one step of the forward Euler algorithm starting from \vec{x} with time-step \Delta t. This method averages the slope at that point with the slope at the originial point and uses that averaged slope to move forward. This is sometimes called the trapezoidal method in the literature.

Question 1

(a) Using the solver made from the above instructions section, generate a trajectory of the simple harmoic oscillator ODEs with , , and . Start from the initial condition withe a time-step of . What is [x(t=0.5), v(t=0.5)]^T?

Question 2

(b) Generate a 500-point trajectory of the same ODE system from with a time-step of \Delta t = 0.01. Which of the following describes this trajectory?

Question 3

(c) Remember that the simple harmonic oscillator has no damping (friction). Keeping this in mind, does the trajectory that you generated in part (b) of this problem seem more accurate than the trajectory computer by either of your forward or backward Euler code from Problems 1 and 2?

Question 4

(d) Now generate a 5000-point trajectory of the same ODE system from with a timestep of . How is this plot qualitatively different than the plot you generated that was only a 500-point trajectory?

 

Question 5

(e) What could be the cause of this difference?