I tried to reconstruct a 3D curve with given curvature and torsion. I saw some threads talking about using runge kutta. However, as far as I see that they required curvature and torsion were continuous. Unfortunately, my curvature and torsion are discrete. They are not functions of arc-length, but indexed by arc-length. Anyone can help to see how to solve the problem with discrete curvature and torsion. Thank you.
Hi here is an example. Assume we have a trajectory indexed with arc-length of $\delta s$ and total samples of 500. I have
$$y_{s} = \begin{bmatrix} r_{s}\\ T_{s}\\ N_{s}\\ B_{s} \end{bmatrix}$$
where $s = 1, 2, ..., 500$.
Now we can create a function used by runge-kutta as
$$y_{s}^{'} = \begin{bmatrix} 0 & 1 & 0 & 0\\ 0 & 0 & \kappa_{s} & 0\\ 0 & -\kappa_{s} & 0 & \tau_{s}\\ 0 & 0 & -\tau_{s} & 0 \end{bmatrix}y_{s}$$
Note that here $\kappa_{s}$ and $\tau_{s}$ are not function of $s$. Instead, they are indexed by $s$. Therefore, if $s = 1.5$, we are not able to compute $\kappa_{s}$ and $\tau_{s}$.
In terms of using runge-kutta, for
$$k_{1} = \delta s f(y_{s}, x_{s})$$
it is fine since $x_{s}/\delta s$ always is an integer. However for
$$k_{2} = \delta sf(y_{s}+\frac{k_{1}}{2}, x_{s}+\frac{\delta s}{2})$$
$\frac{x_{s}+\frac{\delta s}{2}}{\delta s}$ cannot be an integer, therefore we cannot find corresponding $\kappa$ and $\tau$ in this case.
Not sure if I explained my problem clearly.Thank you.
Interpolate
withNDSolve
might solve the problem. But I can't say more without the data. Can you edit your post and add some example? $\endgroup$ – ybeltukov Sep 10 '14 at 9:40