Any advice would be helpful. Thanks,
John
X0 = {1, 1, 1};
and
sol = NDSolve[{a'[s] == U[a[s]], a[0] == X0}, a[s], {s, 0, 1}]
will do it. If yoy wish to use the path length you have to transform
a[s]== a[Sqrt[x[s]^2+y[s]^2+z[s]^2]].
Regards
Jens
M0=NDSolve[{a'[s]==U[a[s]],a[0]==X},a,{s,0,6},Method->"ExplicitRungeKutta"]
Where X = {1,0,0} and U = {f(x,y,z),g(x,y,z),h(x,y,z)}
That does not work and I can't figure out why. The error I get is "Part::partw: Part 2 of a[s] does not exist." Same with "Part 3".
-John
solution =
NDSolve[{x'[s] == {2*x[s][[2]], x[s][[1]]/3, x[s][[3]]},
x[0] == {1, 1, 1}}, x[s], {s, 0, 1}]
gives
{{x[s]->InterpolatingFunction[{{0.,1.}},<>][s]}}
Then
ParametricPlot3D[Expand[x[s]/.solution[[1]]],{s,0,1}]
gives a 3D plot of the trajectory for 0<=s<=1.
--
Steve Luttrell
West Malvern, UK
"John Lee" <johnl...@hotmail.com> wrote in message
news:fgca49$9ho$1...@smc.vnet.net...
Part::partw: Part 2 of x[s] does not exist. >>
Part::partw: Part 3 of x[s] does not exist. >>
Clear[x, y, z, a, u, arc, s, t]
a[t_] = {x[t], y[t], z[t]};
u[{x_, y_, z_}] = {2 y, x/3, z};
ds[{x_, y_, z_}] = Sqrt[#.#] &@u[{x, y, z}];
eqns = Thread[
Flatten@{a'[t] - u[a[t]], a[0] - {1, 1, 1}, arc'[t] - ds[a[t]],
arc[0]} == 0];
{x, y, z, arc} = {x, y, z, arc} /.
Last@NDSolve[eqns, {x, y, z, arc}, {t, 0, 6}];
The "arc" function is s in terms of t. To get x, y, and z in terms of s,
we invert the "arc" function:
Clear[si]
si = si /. First@
NDSolve[{si[arc[0]] == 0, si'[u] == 1/arc'[si@u]},
si, {u, arc@0, arc@6}];
Plot[si@arc[t], {t, 0, 6}]
Plot[arc@si[t], {t, arc@0, arc@6}]
Finally, here's a plot of x, y, and z in terms of arc length:
Plot[a[si[s]], {s, arc@0, arc@6}]
or
ParametricPlot3D[a[s], {s, arc@0, arc@6}]
Bobby
On Fri, 02 Nov 2007 03:28:04 -0500, John Lee <johnl...@hotmail.com>
wrote:
--
I have $Version = "6.0 for Microsoft Windows (32-bit) (April 20, 2007)".
--
Steve Luttrell
West Malvern, UK
"Jerry" <JLK...@yahoo.com> wrote in message
news:fghb2n$i9j$1...@smc.vnet.net...