introduce random variable in ode at specfic range

I am trying to solve a differential equation similar to:
x"=(c+z(t))x'+kx
my problem is how can I introduce z(t) as a random number for a normal distribution (0,0.1^2) at the range (-0.4,0.4)
This random numbers can be obtained using normrnd(mu,sigma)

1 Kommentar

Torsten
Torsten am 3 Apr. 2017
https://de.mathworks.com/help/finance/stochastic-differential-equation-sde-models.html
Best wishes
Torsten.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jan
Jan am 3 Apr. 2017
Bearbeitet: Jan am 3 Apr. 2017

1 Stimme

This will not work. Matlab's integrators handle smooth functions only, see http://www.mathworks.com/matlabcentral/answers/59582#answer_72047 . Otherwise the stepsize controller drives mad.
Imagine that a stepsize was selected to large to match the goven tolerances. Now the stepsize is reduced according the method implemented in the integrator. But in the re-evaluation of the step, the function to be integrated replies a completely different value due to the random part.
ODE45 needs several function evaluations to determine one step. Therefore it is required also, that the function is smooth. Otherwise the design of the integrator is completely wrong. This means that you get a final value perhaps, but it cannot be called "result", because it is random and based on random rounding and truncation errors based on randomly chosen step sizes.

2 Kommentare

nour yousfi
nour yousfi am 8 Apr. 2017
Bearbeitet: nour yousfi am 8 Apr. 2017
If your function is not smooth at one derivative more than you use in your equation, then any integration answer you get back might be wrong.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Numerical Integration and Differential Equations finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 3 Apr. 2017

Kommentiert:

am 8 Apr. 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by