introduce random variable in ode at specfic range

조회 수: 3 (최근 30일)
nour yousfi
nour yousfi 2017년 4월 3일
댓글: Walter Roberson 2017년 4월 8일
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
Torsten
Torsten 2017년 4월 3일
https://de.mathworks.com/help/finance/stochastic-differential-equation-sde-models.html
Best wishes
Torsten.

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2017년 4월 3일
편집: Jan 2017년 4월 3일
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
Walter Roberson
Walter Roberson 2017년 4월 8일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by