sorry for spamming the boards with all these questions lol- i promise this is my last post regarding n body problems. how do i measure error? i cant really find much on this subject. i want to use adaptive stepsize in my n body simulator im guessing for the n-body problem i base my error on energy and angular momentum: h(n+1) ∫work dt=KEn+1- KEn h*n h(n+1) ∫torque*dt=AMn+1-AMn+1 h*n of course the integrals would be evaluated using simpsons rule, which is equivalent to RK4 in order. this gives me 4 equations (actually 4*p where p is the number of particles). now the way i see it i can do this 2 ways: the work divided by kinetic energy gained should equal 1, and if the fraction isnt close enough to one i repeat the step. or work minus kinetic energy should equal zero, so i could find the difference and if it isnt close enough to 0 i repeat the step. i think both of them have their advantages and drawbacks, for example if i went the subtraction route, then if the difference is really small it doesnt really matter if im dealing with big numbers. on the other hand, if i use division i might end up with divide by zero problems.