improving flexibility of trapz2d and simps2d for any value of nx and nt