Robotic Systems · Lecture 2

Euler, semi-implicit Euler, and RK4

Simeon Nedelchev

Full notes, practice, and references

Explicit Euler

xk+1=xk+Δtf(xk)x_{k+1}=x_k+\Delta t f(x_k)

First-order global accuracy on smooth fixed-time problems.

Oscillator energy grows.

Semi-implicit Euler

vk+1=vk+Δta(qk)v_{k+1}=v_k+\Delta t a(q_k)
qk+1=qk+Δtvk+1q_{k+1}=q_k+\Delta t v_{k+1}

The update uses the new velocity.

Oscillator stability

ωΔt<2\omega\Delta t<2

This bound matters for symplectic Euler.

Formal order alone does not determine stability.

RK4

Four slope evaluations per step.

Fourth-order global accuracy for smooth problems.

Energy conservation remains approximate.

Refinement test

Halve the timestep and keep final time fixed.

Expected error ratios: about 2 for Euler, 16 for RK4.

Practice

Exact solution: (q,v)=(cos⁡t,−sin⁡t)(q,v)=(\cos t,-\sin t).

Compare trajectory error and energy drift.

Reading

Return to the notes