Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How to make a random function $\eta(t)$ to insert in a differential equation for NDSolve?

Edit: example: to solve equations like $\frac{dx}{dt}=\eta(t)$

share|improve this question
1  
The numerical methods used by NDSolve won't work correctly if you introduce noise. –  Szabolcs May 14 '13 at 19:23
2  
But do take a look here: reference.wolfram.com/mathematica/guide/… –  Szabolcs May 14 '13 at 19:24
2  
@richard Please still consider adding a minimal example so that someone can perhaps provide an answer using the new stochastic process functions in version 9 (or you can answer your own question as well). That way, it will also be of use to future visitors who have the same problem (I had forgotten as well and was reminded of the new functionality by Szabolcs's link) –  rm -rf May 14 '13 at 19:38
1  
As you've seen, you should have mentioned you're dealing with SDEs at the outset. NDSolve[] indeed does not have SDE-solving capability, but the new functions in 9 will be useful. –  J. M. May 15 '13 at 4:15
1  
Well, it certainly wasn't intended to be used for SDEs. It was, for instance, only relatively recently that NDSolve[] started supporting DAEs and DDEs; maybe a future version might add SDE support, but not now. Thus, you might need to roll your own solution. If you can't or won't use version 9, you may have to implement the Itō process on your own. –  J. M. May 15 '13 at 4:30

1 Answer 1

I think what he means is the following (I could be wrong though). In Mathematica white noise is represented by WienerProcess "also known as Brownian motion, a continuous-time random walk, or integrated white Gaussian noise." ~ Documentation. So adopting (actually simplifying) this example we get the following:

\[ScriptCapitalP] = 
 ItoProcess[\[DifferentialD]x[t] == σ \[DifferentialD]w[t], 
  x[t], {x, x0}, t, w \[Distributed] WienerProcess[]]
 ItoProcess[{{0}, {{σ}}, x[t]}, {{x}, {x0}}, {t, 0}]

Simulate the process for different values of the variance parameter:

Table[ListLinePlot[
  RandomFunction[\[ScriptCapitalP] /. {x0 -> 5}, {0, 4, 0.01}, 10], 
  PlotLabel -> 
   Row[{"σ", "\[Equal]", N@σ}]], {σ, {1/4, 1/2, 
   1, 2}}]

enter image description here

You can find many characteristics now - see details on the page a linked above, but here is a taste - find the probability density function of the value of the process:

PDF[\[ScriptCapitalP][t], x]
 E^(-((x - x0)^2/(2 t σ^2)))/(Sqrt[2 π] Sqrt[t σ^2])
share|improve this answer
1  
Nice, I think this is exactly what the OP was after. Perhaps you could also give this question a shot... –  rm -rf May 14 '13 at 20:54
    
I don't have version 9 –  richard May 14 '13 at 21:03
    
@rm-rf thanks, i will take a look when I get time. That looks like an interesting equation. –  Vitaliy Kaurov May 14 '13 at 21:30
    
@richard maybe you could try a free trial version for now - just to see how it works. –  Vitaliy Kaurov May 14 '13 at 21:30
    
+1 for solving the OP's problem partially, though white noise is not necessarily Gaussian. –  Silvia May 15 '13 at 12:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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