Calculating gradient and displacement vector
Preparing for the first test.