Numeric example (one-dimensional)

Path definition

path = {{0, 0}, {5, 60}, {7, 30}, {12, 45}, {20, 90}} ;

tmin = First[First[path]] ; tmax = First[Last[path]] + 5 ; path // TraditionalForm

( 0    0  )            5    60            7    30            12   45            20   90

Continuous acceleration path

System of equations

CubicEquationsDisplay[path] // ViewSolution

0a_10
0a_11
60a_10 + 5 a_11 + 25 a_12 + 125 a_13
60a_20
a_11 + 10 a_12 + 75 a_13a_21
2 a_12 + 30 a_132 a_22
30a_20 + 2 a_21 + 4 a_22 + 8 a_23
30a_30
a_21 + 4 a_22 + 12 a_23a_31
2 a_22 + 12 a_232 a_32
45a_30 + 5 a_31 + 25 a_32 + 125 a_33
45a_40
a_31 + 10 a_32 + 75 a_33a_41
2 a_32 + 30 a_332 a_42
90a_40 + 8 a_41 + 64 a_42 + 512 a_43
0a_41 + 16 a_42 + 192 a_43

Matrix representation

CubicCoefficientMatrices[path]

( -1     0      0      0      0      0      0      0      0      0      0      0       ...                                                                                                 43

Solution for coefficients

CubicCoefficientsDisplay[path // N] //Simplify //Sort// ViewSolution

RowBox[{a_10, , 0.}]
RowBox[{a_11, , 0.}]
RowBox[{a_12, , 8.37339}]
RowBox[{a_13, , RowBox[{-, 1.19468}]}]
RowBox[{a_20, , 60.}]
RowBox[{a_21, , RowBox[{-, 5.86695}]}]
RowBox[{a_22, , RowBox[{-, 9.54678}]}]
RowBox[{a_23, , 2.49013}]
RowBox[{a_30, , 30.}]
RowBox[{a_31, , RowBox[{-, 14.1725}]}]
RowBox[{a_32, , 5.39398}]
RowBox[{a_33, , RowBox[{-, 0.391894}]}]
RowBox[{a_40, , 45.}]
RowBox[{a_41, , 10.3752}]
RowBox[{a_42, , RowBox[{-, 0.484427}]}]
RowBox[{a_43, , RowBox[{-, 0.0136686}]}]

Plot result

fnc = CubicPolyTrajectory ; g1p = PlotPolyTrajectory[path, {tmin, tmax}, Blue, fnc, 0, 0, Plot ... otDDPolyTrajectory[path, {tmin, tmax}, Blue, fnc, 0, 0, PlotLabel->"Acceleration"] ;

[Graphics:../HTMLFiles/index_146.gif]

[Graphics:../HTMLFiles/index_147.gif]

[Graphics:../HTMLFiles/index_148.gif]

Path with velocity heuristic

fnc = CubicPolyTrajectoryWithVelocityHeuristic ; g2p = PlotPolyTrajectory[path, {tmin, tmax},  ... tDDPolyTrajectory[path, {tmin, tmax}, Green, fnc, 0, 0, PlotLabel->"Acceleration"] ;

[Graphics:../HTMLFiles/index_150.gif]

[Graphics:../HTMLFiles/index_151.gif]

[Graphics:../HTMLFiles/index_152.gif]

Compare results

Show[g1p, g2p] ; Show[g1v, g2v] ; Show[g1a, g2a] ;

[Graphics:../HTMLFiles/index_154.gif]

[Graphics:../HTMLFiles/index_155.gif]

[Graphics:../HTMLFiles/index_156.gif]


Created by Mathematica  (November 12, 2003)