Bottle cap race

Imagine flicking a bottle cap (a chapa) across a table. Its movement isn't perfectly smooth. It's driven forward by your push, slowed down by friction, and knocked off course by tiny bumps and imperfections on the surface. This simulation captures that complex motion using a stochastic ordinary differential equation.

The model describes the chapa's state at any instant through its position (Xt) and velocity (Vt). It's defined by two simple-looking but profound equations:

dXt=VtdtdVt=(γVt+μ)dt+σdWt

1. Stratonovich Form and Analytical Solution

An SDE in Itô form, dYt=a(Yt)dt+b(Yt)dWt, can be converted to the Stratonovich form, dYt=a(Yt)dt+b(Yt)dWt, using the correction term:

a(Yt)=a(Yt)12b(Yt)by(Yt)

See stochastic ordinary differential equation#Stratonovich form.
In the SDE for velocity, Vt:

bVt=σVt=0

Therefore, the correction term is zero, and the drift terms are identical, a(Vt)=a(Vt).
This means the Itô and Stratonovich forms of this SDE are the same. The system in the Stratonovich sense is:

dXt=Vtdt,dVt=(γVt+μ)dt+σdWt.

We can solve this system by first finding the solution for Vt and then integrating to find Xt.

1. Solving for Velocity Vt:
The SDE for Vt is a linear equation known as the Ornstein-Uhlenbeck process with a non-zero mean. We can solve it using an integrating factor, similar to a linear ordinary differential equation (see this). Let the integrating factor be eγt.
Starting with dVt+γVtdt=μdt+σdWt, we multiply by eγt:

eγtdVt+γeγtVtdt=μeγtdt+σeγtdWt

The left side is the differential d(eγtVt) according to Itô's product rule. Integrating from 0 to t:

0td(eγsVs)=0tμeγsds+0tσeγsdWseγtVtV0=μγ(eγt1)+σ0teγsdWs

Isolating Vt gives the final solution:

Vt=V0eγt+μγ(1eγt)+σ0teγ(st)dWs

2. Solving for Position Xt:
The position is simply the integral of the velocity:

Xt=X0+0tVsds

Substituting the expression for Vs and integrating each term yields:

Xt=X0+V0γ(1eγt)+μγtμγ2(1eγt)+σγ0t(1eγ(st))dWs

This is the exact analytical solution for the position Xt.


2. Numerical Simulation Scheme

The Euler-Maruyama scheme is a simple and effective method for simulating this system. We discretize time into small steps of size Δt.

Let tn=nΔt. The discrete updates for position XnXtn and velocity VnVtn are as follows:

  1. Initialize: Start with the initial conditions X0 and V0 at time t0=0. Choose a small time step Δt.
  2. Iterate: For each step n=0,1,2,:
    • Generate a random number Zn from a standard normal distribution, N(0,1).
    • Update the velocity using the SDE's discretized form:Vn+1=Vn+(μγVn)Δt+σΔtZn
    • Update the position using the last step's velocity (this is the standard explicit Euler method):Xn+1=Xn+VnΔt
  3. Repeat: Continue the iteration until the desired final time is reached.

This scheme provides a sequence of points (Xn,Vn) that approximates a sample path of the solution.