octave> help ode45
'ode45' is a function from the file /usr/share/octave/4.2.2/m/ode/ode45.m

 -- [T, Y] = ode45 (FUN, TRANGE, INIT)
 -- [T, Y] = ode45 (FUN, TRANGE, INIT, ODE_OPT)
 -- [T, Y, TE, YE, IE] = ode45 (...)
 -- SOLUTION = ode45 (...)
 -- ode45 (...)

...

octave> [t,u]=ode45(@(t,u)[u(3);u(4);0;-9.81],[0,10],[0;0;5;14])%[x0;y0;vx0;vy0])
t =

    0.00000
    0.06813
    0.17032
    0.32361
    0.55355
    0.89845
    1.41581
    2.19184
    3.19184
    4.19184
    5.19184
    6.19184
    7.19184
    8.19184
    9.19184
   10.00000

u =

     0.00000     0.00000     5.00000    14.00000
     0.34065     0.93104     5.00000    13.33165
     0.85162     2.24223     5.00000    12.32913
     1.61807     4.01691     5.00000    10.82535
     2.76775     6.24672     5.00000     8.56968
     4.49227     8.61894     5.00000     5.18617
     7.07905     9.98918     5.00000     0.11090
    10.95922     7.12131     5.00000    -7.50199
    15.95922    -5.28568     5.00000   -17.31199
    20.95922   -27.50268     5.00000   -27.12199
    25.95922   -59.52967     5.00000   -36.93199
    30.95922  -101.36666     5.00000   -46.74199
    35.95922  -153.01365     5.00000   -56.55199
    40.95922  -214.47065     5.00000   -66.36199
    45.95922  -285.73764     5.00000   -76.17199
    50.00000  -350.50000     5.00000   -84.10000

octave> x0=[0;0];v0=[5;14];a=[0;-9.81];  [t,u]=ode45(@(t,u)[u(3:4);a],[0,5],[x0;v0])
t =

   0.00000
   0.06813
   0.17032
   0.32361
   0.55355
   0.89845
   1.39845
   1.89845
   2.39845
   2.89845
   3.39845
   3.89845
   4.39845
   4.89845
   5.00000

u =

    0.00000    0.00000    5.00000   14.00000
    0.34065    0.93104    5.00000   13.33165
    0.85162    2.24223    5.00000   12.32913
    1.61807    4.01691    5.00000   10.82535
    2.76775    6.24672    5.00000    8.56968
    4.49227    8.61894    5.00000    5.18617
    6.99227    9.98578    5.00000    0.28117
    9.49227    8.90011    5.00000   -4.62383
   11.99227    5.36194    5.00000   -9.52883
   14.49227   -0.62872    5.00000  -14.43383
   16.99227   -9.07189    5.00000  -19.33883
   19.49227  -19.96756    5.00000  -24.24383
   21.99227  -33.31572    5.00000  -29.14883
   24.49227  -49.11639    5.00000  -34.05383
   25.00000  -52.62500    5.00000  -35.05000

octave> yt=[5;1]
yt =

   5
   1

octave> x0=[0;0];v0=[5;14];a=[0;-9.81]; [t,u]=ode45(@(t,u)[u(3:4);a],[0:.01,5],[x0;v0]); yh=interp1(u(:,1),u(:,2),[10;14])
yh =

   8.18154
   0.55089

octave> x0=[0;0];v0=[6;14];a=[0;-9.81]; [t,u]=ode45(@(t,u)[u(3:4);a],[0:.01,5],[x0;v0]); yx=interp1(u(:,1),u(:,2),[10;14])
yx =

   9.4034
   5.8228

octave> x0=[0;0];v0=[5;15];a=[0;-9.81]; [t,u]=ode45(@(t,u)[u(3:4);a],[0:.01,5],[x0;v0]); yy=interp1(u(:,1),u(:,2),[10;14])
yy =

   10.1815
    3.3509

octave> x0=[0,0];v0=[5.5,13];a=[0,-9.81];  [t,u]=ode45(@(t,u)[u(3),u(4),a],[0:.01:5],[x0,v0]); interp1(u(:,1),u(:,2),[10;14])
ans =

   7.4214
   1.3096

octave> x0=[0,0];v0=[5.5,12.8];a=[0,-9.81];  [t,u]=ode45(@(t,u)[u(3),u(4),a],[0:.01:5],[x0,v0]); interp1(u(:,1),u(:,2),[10;14])
ans =

   7.05778
   0.80054

octave> J=[(yx-yh)/1,(yy-yh)/1]
J =

   1.2219   2.0000
   5.2719   2.8000

octave> yt=[5;1]; dv=J\(yt-yh)
dv =

   1.3768
  -2.4319

octave> 
