S. Denisov MNTF, Uni Augsburg
1 / 7
An example: integration of nonlinear oscillator Equation of motion
¨
x=−γx˙−x−x3+asin(ωt) Two variables: coordinate x and velocity υ= ˙x.
Initial conditions: This is the state of the system at the initial instant of timet = 0,x(0) = 0 and υ(0) = 0.
Task: to propagate the system over the time t = 10T, where T = 2π/ω.
Overall error: E(N) =p
(x(sN)−x(N))2+ (υ(sN)−υ(N))2, s = 4.
Algorithms: Euler’s scheme and the 4th-order Runge-Kutta method(will discuss them latter on).
Number of stepsN is the number of integration steps per period T. It sets the time-step h=T/N.
2 / 7
An example: integration of nonlinear oscillator
Performances of the two algorithms
3 / 7
Euler method
4 / 7
RK4 method (N= 500)
5 / 7
6 / 7
7 / 7