3D plot of the spatial path of velocity/space stochastic differential equations

I define the following 6 dimensional stochastic (Ito) process- in velocity v/position x. I can plot x1 as a function of t- see script below which has been corrected by Daniel. My goal is however to plot the path [x1[t],x2[t],x3[t]] in 3D. Any help?

• There are syntax errors in your code, e.g. [DifferentialD] should be replaced by d and [Distributed] should be replaced by \[Distributed]. Nov 12 '21 at 7:34
• corrected below Nov 12 '21 at 18:04

You can change the Ito process to output the three x values, {x1[t],x2[t],x3[t]} instead of just x1[t]:

proc = ItoProcess[{\[DifferentialD]x1[t] ==
v1[t] \[DifferentialD]t, \[DifferentialD]x2[t] ==
v2[t] \[DifferentialD]t, \[DifferentialD]x3[t] ==
v3[t] \[DifferentialD]t, \[DifferentialD]v1[t] == -0.1*
v1[t] \[DifferentialD]t + \[DifferentialD]n1[
t], \[DifferentialD]v2[t] == -0.1*
v2[t] \[DifferentialD]t + \[DifferentialD]n2[
t], \[DifferentialD]v3[t] == -0.1*
v3[t] \[DifferentialD]t + \[DifferentialD]n3[t]},
{x1[t], x2[t],x3[t]},
{{x1, x2, x3, v1, v2, v3}, {0, 0, 0, 0, 0, 0}},
t, {n1 \[Distributed] WienerProcess[],
n2 \[Distributed] WienerProcess[],
n3 \[Distributed] WienerProcess[]}]

After solving this version of the Ito process, extract and plot the paths:

Graphics3D[Line[sol["ValueList"]]]

If you want to style each path, you can extract them individually from the solution, e.g, with sol["Values",p] for the {x1,x2,x3} values for path p. • Thank Tad. That is starting to help. Is there a way to have each sample path in different color? I need these (or variations around the same problem) for an article I am preparing for The Astrophysical Journal. Nov 12 '21 at 19:33
• @NicolasBian For different colors Table[sol["Values", i], {i, 1, 50}] // ListPointPlot3D[#, AspectRatio -> 1] & Nov 12 '21 at 22:36

I corrected Differential and Distributed:

proc = ItoProcess[{\[DifferentialD]x1[t] ==
v1[t] \[DifferentialD]t, \[DifferentialD]x2[t] ==
v2[t] \[DifferentialD]t, \[DifferentialD]x3[t] ==
v3[t] \[DifferentialD]t, \[DifferentialD]v1[t] == -0.1*
v1[t] \[DifferentialD]t + \[DifferentialD]n1[
t], \[DifferentialD]v2[t] == -0.1*
v2[t] \[DifferentialD]t + \[DifferentialD]n2[
t], \[DifferentialD]v3[t] == -0.1*
v3[t] \[DifferentialD]t + \[DifferentialD]n3[t]},
x1[t], {{x1, x2, x3, v1, v2, v3}, {0, 0, 0, 0, 0, 0}},
t, {n1 \[Distributed] WienerProcess[],
n2 \[Distributed] WienerProcess[],
n3 \[Distributed] WienerProcess[]}]
sol = RandomFunction[proc, {0., 100, 0.1}, 50,
Method -> "StochasticRungeKutta"]; ListLinePlot[sol]  