've tried to debug the code but I'm not sure if there is a problem reading the array or a problem with the acceleration method mathematics.
Validating the code that reads the array is easy: print the contents of array x. If it matches the input text, move on.
What you want to do is write a
unit test[
^] for your acceleration function.
Write a separate public static void Main() that calls the function with some known inputs (that you've verified through hand calculation). If the output equals your expected value, you function is (likely) good (at least for that one input).
If it does not match, check your math.
I take the following ...
Acceleration at 10 seconds is 43.76
... where the first three lines are ...
60
2927
10170
... to mean you expect the following to be true:
double expected = 43.76;
double a = acceleration(0, 20, 10170, 60);
assert Math.abs(expected - a) < 0.00000001;
Hint for using assert:
http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.10[
^]