introduce random variable in ode at specfic range

1 vue (au cours des 30 derniers jours)
nour yousfi
nour yousfi le 3 Avr 2017
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 commentaire
Torsten
Torsten le 3 Avr 2017
https://de.mathworks.com/help/finance/stochastic-differential-equation-sde-models.html
Best wishes
Torsten.

Connectez-vous pour commenter.

Réponses (1)

Jan
Jan le 3 Avr 2017
Modifié(e) : Jan le 3 Avr 2017
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 commentaires
nour yousfi
nour yousfi le 8 Avr 2017
Modifié(e) : nour yousfi le 8 Avr 2017
Walter Roberson
Walter Roberson le 8 Avr 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.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by