I wrote code solving the frenet equations in 2D analytically (so only curvature and no torsion) and plotting the curve with local coordinates afterwards. For constant curvature kappa it functions just fine, and gives out circles. But every other curvature just gives back the arguments given instantaniously, like MMA doesn't even try solving the problem. Any thoughts on how to fix this?
I am really new to MMA but would have thought that simple curvatures should be solvable.
Thanks!
This is the code:
ClearAll[\[Kappa], \[Tau], t, n, r, s, plist, a, b, f, F, x, y, t1, \
t2, n1, n2, sol, rearr, kap]
a = -10;
b = 10;
(*t[s_]={t1[s],t2[s]};
n[s_]={n1[s],n2[s]};
r[s_]={r1[s],r2[s]};
*)
r[s_] = {x[s], y[s]}(*{{t1[s],t2[s]},{n1[s],n2[s]},{r1[s],r2[s]}}*);
t[s_] = {t1[s], t2[s]};
n[s_] = {n1[s], n2[s]};
kap[s_] := 1;
system = {
t1'[s] == kap[s] n1[s],
t2'[s] == kap[s] n2[s],
n1'[s] == -kap[s] t1[s],
n2'[s] == -kap[s] t2[s],
x'[s] == t1[s],
y'[s] == t2[s],
t1[a] == 1,
t2[a] == 0,
n1[a] == 0,
n2[a] == 1,
x[a] == 0,
y[a] == 0};
sol = DSolve[
system,
{t1, t2, n1, n2, x, y},
s]
t[s_] = t[s] /. {sol[[1, 2]], sol[[1, 5]]};
n[s_] = n[s] /. {sol[[1, 1]], sol[[1, 4]]};
r[s_] = r[s] /. {sol[[1, 3]], sol[[1, 6]]};
Manipulate[With[{scale = 0.5},
Show[ParametricPlot[r[s], {s, a, b}],
Graphics[{{Directive[Red],
Arrow[{r[s], scale t[s] + r[s]}]}, {Directive[Blue],
Arrow[{r[s], scale n[s] + r[s]}]}},
PlotRange -> Full]]], {{s, (a + b)/2}, a, b, .001}]
One can change the domain with a and b and the given curvature with kap[s_].
Also for some reason Dsolve seems to give out (t1,...,y) in different orders depending on kap[s_], this is why the plotting will fail for no-constant curvature.