Numerical stroboscopic averaging for ODEs and DAEs