1
$\begingroup$

I need to plot the solution of an SDE which takes its values on the plane $\{z = 1\} \subseteq \mathbb R^3$. Here is the code of a minimal working example (the solution to the SDE is just the driving Brownian motion):

timeHoriz = 0.1;

trivialSDE = 
  ItoProcess[{{0, 0, 0}, {{1, 0, 0}, {0, 1, 0}, {0, 0, 0}}, {b1[t], 
     b2[t], b3[t], t}}, {{b1, b2, b3}, {0, 0, 0}}, {t, 0}];

bmPaths = 
  Table[RandomFunction[trivialSDE, {0., timeHoriz, 0.0001}, 
    WorkingPrecision -> 60, Method -> "KloedenPlatenSchurz"], {i, 
    1}];

bmFun[t_] := 
  Table[bmPaths[[i]]["PathFunction"][t][[{1, 2, 3}]], {i, 1}];

boxDim = 2;

tanbmPlot = 
 ParametricPlot3D[{bmFun[t][[1]][[1]], bmFun[t][[1]][[2]], 
   bmFun[t][[1]][[3]] + a}, {t, 0, timeHoriz}, 
  PlotStyle -> {Thickness[0.001]}, Axes -> False, 
  PlotRange -> {{-boxDim, boxDim}, {-boxDim, boxDim}, {-boxDim, 
     boxDim}}]

Here a is a parameter that I would like to set to 1. The problem is that if I set it to any nonzero value, the quality of the plot worsens considerably (as if it's interpolating on very few points). Set it to zero, and you get a high quality plot. The same thing happens if you code the behaviour into the SDE itself by modifying the initial condition:

trivialSDE = 
  ItoProcess[{{0, 0, 0}, {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, {b1[t], 
     b2[t], b3[t], t}}, {{b1, b2, b3}, {0, 0, 1}}, {t, 0}];

Other workarounds fail too and I have absolutely no idea what's going on. How do I get a good quality plot of the solution regardless of the plane I want it to be valued in? Thank you very much for any help.

Edit: here are a couple of screenshots of what I'm seeing. The first is obtained by setting a = 0 and the second by setting a = 1 (or any other nonzero value). a = 0 a = 1

$\endgroup$
  • $\begingroup$ numPaths isn't defined, example doesn't run! $\endgroup$ – Ulrich Neumann Jun 11 '19 at 10:39
  • $\begingroup$ @UlrichNeumann Sorry about that, it was set to 1 earlier in my code. I'll edit now. $\endgroup$ – Emilio Ferrucci Jun 11 '19 at 10:40
  • $\begingroup$ Thanks! ...example still doesn't run $\endgroup$ – Ulrich Neumann Jun 11 '19 at 10:52
  • $\begingroup$ @UlrichNeumann Strange, it does for me.. have you set the parameter a to 0 or 1? $\endgroup$ – Emilio Ferrucci Jun 11 '19 at 11:05
  • $\begingroup$ upps... Now it works. I tried to improve the quality using the option MaxRecursion->4 but no imrovement $\endgroup$ – Ulrich Neumann Jun 11 '19 at 12:12
1
$\begingroup$

Here I show, without understanding the background of the problem, the 3D plot:

ParametricPlot3D[{bmFun[t][[1]][[1]], bmFun[t][[1]][[2]],bmFun[t][[1]][[3]] + a}, {t, 0, timeHoriz}, {a, 0, 1.5},PlotStyle -> {Thickness[0.001]}, Axes -> False, ColorFunction -> Function[{x, y, z, u, a}, Hue[a]],PlotRange -> {{{-boxDim, boxDim}, {-boxDim, boxDim}, {-boxDim,boxDim}}, All}[[-1]], MaxRecursion -> 4]

enter image description here

Equal colors show slices a=constant.

Especially the slices a==0 and a==1 are shown in the nect plot.

Show[
Table[
ParametricPlot3D[{bmFun[t][[1]][[1]], bmFun[t][[1]][[2]],bmFun[t][[1]][[3]] + a}, {t, 0, timeHoriz},ColorFunction -> Function[{x, y, z, u, a}, Hue[a ]]]
, {a, 0, 1 ,1}] , Axes -> False,PlotRange -> {{{-boxDim, boxDim}, {-boxDim, boxDim}, {-boxDim,boxDim}}, All}[[-1]], MaxRecursion -> 4]

enter image description here

$\endgroup$
  • $\begingroup$ Yes it's the same! $\endgroup$ – Ulrich Neumann Jun 11 '19 at 14:03
  • $\begingroup$ I can't tell if there is a change at a = 0.. Have you not noticed a difference when plotting separately? Maybe it's a glitch on my version then. $\endgroup$ – Emilio Ferrucci Jun 11 '19 at 15:12
  • $\begingroup$ The plot shows no significant difference for variing a I think! $\endgroup$ – Ulrich Neumann Jun 11 '19 at 18:41
  • $\begingroup$ I added a couple of screenshots of the plots I'm getting. $\endgroup$ – Emilio Ferrucci Jun 11 '19 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.