Interesting Examples of Computational Physics
  • Welcome to the blog of Computational Physics at the IFM!
  • Dynamical Systems
    • The simple pendulum
    • The spherical pendulum
  • The wave equation
    • The simple discretization
    • Boundary conditions
    • Interfaces between mediums
    • Knots on ropes
    • 2D wave equation
  • Time dependent Schrödinger equation
    • The Crank-Nicolson method
    • Free wave packet
    • Quantum Tunneling
    • Harmonic Oscillator
    • Forced Harmonic Oscillator
    • 2D Harmonic Oscillator
    • Wave-particle duality
Powered by GitBook
On this page

Dynamical Systems

Dynamical systems are a very important part of Theoretical Mechanics. In our mechanics class, we use Lagrange's equations to find the equations of motion of a diversity of systems. Nevertheless, most of these equations are very hard or impossible to solve analytically. In this section, we are going to learn how to use the Runge-Kutta method to aproimate numerically the behaviour of a variety of dynamical systems.

Hamilton's equations

As we know, one can perform a Legendre transformation to the Lagrangian of a system in order to obtain the Hamiltonian. With it, we can obtain a new set of first order differential equations that describes the evolution of the system:

qi˙=∂H∂pi,  pi˙=−∂H∂qi\dot{q_i} = \frac{\partial H}{\partial p_i},~~\dot{p_i} = - \frac{\partial H}{\partial q_i}qi​˙​=∂pi​∂H​,  pi​˙​=−∂qi​∂H​

This is a system of equations that, with given initial conditions, can be solved using the Runge-Kutta method. To do this, we define a discrete time domain. Instead of having a set of continuos values in an interval, we define the following set of points:

{ti∣ti=t0+iΔt for i=1,2,...,Nt},  Δt=tfNt\{t_i| t_i = t_0+i\Delta t~\text{for}~ i =1,2,...,Nt\},~~\Delta t = \frac{tf}{Nt}{ti​∣ti​=t0​+iΔt for i=1,2,...,Nt},  Δt=Nttf​

The Runge-Kutta method states that, given the following initial value problem:

dx⃗(t)dt=F⃗(x⃗),  x⃗(0)=x⃗0\frac{d\vec{x}(t)}{dt} = \vec{F}(\vec{x}),~~\vec{x}(0) = \vec{x}_0dtdx(t)​=F(x),  x(0)=x0​

then, the function can be approximated by the following formula:

\begin{eqnarray} \vec{x}_i=\vec{x}(t_i) &=& \vec{x}(t_{i-1}) + \frac{\vec{k_1} + 2\vec{k_2} + 2\vec{k_3} + \vec{k_4}}{6}\\ \vec{k_1} &=& \vec{F}(\vec{x}(t_{i-1})) \Delta t \\ \vec{k_2} &=& \vec{F}(\vec{x}(t_{i-1})+\frac{1}{2}\vec{k_1}) \Delta t \\ \vec{k_3} &=& \vec{F}(\vec{x}(t_{i-1})+\frac{1}{2}\vec{k_2}) \Delta t \\ \vec{k_4} &=& \vec{F}(\vec{x}(t_{i-1})+\vec{k_3}) \Delta t \\ \end{eqnarray}

We are going to use this method to solve a lot of sets of differential equations in the following sections.

PreviousWelcome to the blog of Computational Physics at the IFM!NextThe simple pendulum

Last updated 1 year ago