defined dt and dE before loop