* optimization: use RK2 inside in smooth region, RK4 at the edge