calculate energy ofter readdata