trying to add a seperate thing to work out the power spectrum for jacobi elliptic functions not yet finished as the deriv function doesn't quite work properly yet