Your question is not so much on how to use software but on the effects of software on your solution. This is slightly off-topic here, you might have better success at scicomp.stackexchange.com. -- To be better understood, you should say that
xs(t)
is piecewise constant with the value
xs(t)=x(te)
taken at the apex points
dotx(te)=0
. -- It would be helpful to have access to the graphs mentioned in the questions. (And yes, a jump in the second derivative gives a kink in the first derivative.) —
LutzL 32 secs ago