3
$\begingroup$

I am trying to work on stochastic differential equations and I have been trying to use Mathematica's built-in function to simulate the system of equations below. When i use the randomfunction to simulate it using the Milstein method. I keep getting an output implying the RandomFunction method is not a random process recognized by the system.

Please look at my codes and help.

This is the system of equations:

dx[t] = (-a*s(x[t] + y[t]) - s*z[t])dt + 0.1*x[t] dw1

dy[t] = (p*x[t] - l*y[t] + s*z[t])dt + 0.1*y[t] dw2

dz[t] = (-p*x[t] -l*y[t] -(s + m)*z[t]) + 0.1*z[t] dw3

where w1, w2 and w3 are standard Wiener processes.

a = 10; l = 24.625; m = 14.925; s = 0.415; p = 5;
proc1 = 
  ItoProcess[
    {\[DifferentialD]x[t] == (-a*s x[t] - a*s y[t] - s*z[t] )\[DifferentialD]t + 0.1*x[t] \[DifferentialD]w1[t], 
     \[DifferentialD]y[t] == (p* x[t] - l*y[t] + s*z[t]) \[DifferentialD]t + 0.1*y[t] \[DifferentialD]w2[t], \[DifferentialD]z[t] == (-p*x[t] + {{l*y[t], -(s  + m)*z[t]}}) \[DifferentialD]t + 0.1*z[t] \[DifferentialD]w3[t]}, 
    {x[t], y[t], z[t]}, {{x, y, z}, {0.115, -0.115, 0}}, t, 
    {w1, w2, w3} \[Distributed] WienerProcess[]]

paths = RandomFunction[proc1, {0, 100, 0.01}, 250, Method -> "Milstein"];
$\endgroup$
  • $\begingroup$ Welcome to Mathematica.SE, Abiy! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Chris K Feb 11 at 8:22
4
$\begingroup$

Two things:

1) You can't use {} to group terms as in your z equation. See, for example, here for more info.

2) You need to define each noise term separately. {w1, w2, w3} is a list of length three but WienerProcess[] is a scalar, so they don't have the same shape.

The following works:

proc1 = ItoProcess[{
  \[DifferentialD]x[t] == (-a*s x[t] - a*s y[t] - s*z[t]) \[DifferentialD]t
  + 0.1*x[t] \[DifferentialD]w1[t],
  \[DifferentialD]y[t] == (p*x[t] - l*y[t] + s*z[t]) \[DifferentialD]t
  + 0.1*y[t] \[DifferentialD]w2[t],
  \[DifferentialD]z[t] == (-p*x[t] + l*y[t] - (s + m)*z[t]) \[DifferentialD]t
  + 0.1*z[t] \[DifferentialD]w3[t]},
  {x[t], y[t], z[t]}, {{x, y, z}, {0.115, -0.115, 0}}, t,
  {w1 \[Distributed] WienerProcess[], w2 \[Distributed] WienerProcess[], w3 \[Distributed] WienerProcess[]}];
$\endgroup$
  • $\begingroup$ sure the above works well and i can see where my problem is. Thank you! $\endgroup$ – Abiy D Feb 11 at 13:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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