I am trying to model a particle moving in a non-linear trajectory. I am working with real-time motion equipment, so I have already accounted for simple linear translation in 3D space using S-curve velocity with the equipment restraints. My project is to make a model that takes inputs for the acceleration, rate, and desired position (Cartesian coordinates), and outputs the current Cartesian position in 1 millisecond intervals.
With an input of a desired acceleration of 25cm/s^2, desired rate of 12cm/s, and desired position of (0, 0, -40), an example output of my model using linear translation would be as follows:
...
(0.500, 0, 0, -1.078453)
(0.501, 0, 0, -1.084931)
(0.502, 0, 0, -1.097958)
...
The underlying physics to produce this relies on normalizing all of the inputs, working with magnitudes, and then multiplying the resulting position magnitude by the trajectory's unit vector. This is easy for linear translations because the unit vector is constant.
I want to model more complex translational trajectories, such as a parabolic trajectory. I started by beginning the trajectory at (0, 0, -40) with a desired ending position of (0, 0, 40) while passing through (40, 0, 0) according to the function $$x =-0.025z^2 +40.$$ Since my current linear translation model handles purely magnitudes, I thought that I would only have to adjust the path's total length and update the trajectory's unit vector every millisecond.
I got the arc length of the function from -40 <= z <= 40, and that ended up being approximately 118.315 cm. Then, my thought for the unit vector was to get the tangent unit vector for the function every millisecond. I calculated this as $$r = \langle z \cdot -0.05 , 0, 1\rangle,\quad u = r/|r|$$ where $z$ is the current value of the $z$-component of the position.
I tried adjusting my model for these calculations, and the model does not output the correct results. I suspect it has something to do with the unit vector, because the output shows that the value of x begins to decrease when the x component in the unit tangent vector is less than the z component, not when the x component is negative.
I think I am heavily misguiding myself. Where did I go wrong in my approach?