Index of /www/kankel/ph567/examples/Octave/ODE

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[IMG]233px-Messier_53_HST.jpg2022-03-28 11:25 30K 
[DIR]DoublePendulum/2022-04-04 21:32 -  
[IMG]TwoStep.png2022-03-23 13:57 117K 
[DIR]fft_greens_function/2011-03-30 12:59 -  
[   ]hierarchy.fig2020-02-14 13:18 4.1K 
[   ]hierarchy.fig.bak2020-02-14 13:18 4.0K 
[   ]hierarchy.pdf2014-02-24 09:36 20K 
[DIR]lorenz/2011-02-17 21:30 -  
[DIR]plots/2009-03-09 16:26 -  
[DIR]programs/2018-03-10 02:46 -  
[DIR]shuffling/2020-02-14 13:18 -  

Physics 567

Ordinary Differential Equations

Introduction

Outline:

  1. Fixed Step Size
    1. Euler's method
    2. Runge-Kutta methods
  2. Quadrature
  3. Step doubling
  4. Variable step size
  5. Advanced solvers (LSODE)
  6. Sensitivity to initial conditions; Chaos
  7. Solution of stiff ODEs (and numerical differentiation)
  8. Shooting \& root finding
  9. Green's function methods in the Fourier domain

Along the way, as an example, I will be developing my own toolkit for solving ODEs. This is not intended to replace the high quality ODE solvers available in Octave or Matlab. Instead, my purpose is to demonstrate principles of modular code design and good documentation. I will also demonstrate the use of recursion.

We will begin with techniques using a fixed step size. Before looking at the examples in this section, read the lecture notes.

Question: In physics, an ansatz (German 'answer') is an inspired guess that is verified afterward. What motivation can you find for the ansatz proposed on page 4?

Fixed Step Size

Euler's Method

Source code:

Plots:

RK2

Source code:

Plots:

Quadrature

The lecture notes contain a brief discussion of applying ODE solvers to quadrature problems. The bottom line is that ODE solvers are well-optimized, so you might as well.

Step Doubling

First, visit the lecture notes.

Source code:

Plots:

Variable Step Size

Having demonstrated that the step double works, we now build a fully functional adjustable spanner adjustable step size solver.

Chrome Vanadium Adjustable Wrench

Source code:

Plots:

Hi. My name is Isaac, and I have a problem.

The N-body problem is notoriously difficult. Let's try it! But first, read the lecture notes.

Source code:

Plots:

My solver works surprisingly well, but it's not a professional grade tool. It is inefficient for many reasons (can you name a few?). LSODE is more efficient and more robust, but even LSODE quickly reaches its limits. For this problem, the best tools are symplectic integrators. Ask Neil!

It might be wortwhile now to review the hierarchy of modules developed thus far.

Chaos

Chaos is mainly about sensitivity to initial conditions. That is, very slightly different initial conditions can give rise to qualitatively different solutions. See the lecture notes.

Source code:

Plots:

Shuffling cards: an analogy to chaos

Conceptually, we can view a chaotic system as 'shuffling' in phase space. Here we will explore this analogy with a simple iterative map. The shuffling idea can help us to place a lower bound on the phase space dimensionality required to accommodate chaotic behavior.

Quantum Chaos

What happens when you add a quantum-scale perturbation to a classical, Hamiltonian, macroscopic chaotic system?

While we are on the topic quantum chaos, we may optionally investigate dynamical billiards. The quantum version of this system can be solved using the PWDM technique. Unfortunately, this has nothing to do with ODEs.

Stiff Equations

If the equations of motion turn out to be stiff, your ODE solver might be DOA! To solve this problem, you'll need a time machine.

Here again is my hierarchy of modules. You now know when & why to use the stiff solvers.