is it possible to change step size of "ode45" ?

조회 수: 97 (최근 30일)
ADNAN KIRAL
ADNAN KIRAL 2018년 11월 22일
댓글: Jan 2018년 11월 22일
hi
I was wondering can I change step size of "ode45"? If I am not wrong, the default step size taken by Matlab is 1. I want to make 1/2. how can I change without changing many things in Matlab code. If I assign an "option", is that enough? any other options?
thanks
  댓글 수: 1
Jan
Jan 2018년 11월 22일
No, the default step size of ODE45 is not 1. There is not even a default step size. See Torsten's answer: The step size is controlled such, that the provided tolerances are kept.
With using a vector as tspan, you can define the steps in the output, but this is not the internally used step size.

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

채택된 답변

Torsten
Torsten 2018년 11월 22일
편집: Torsten 2018년 11월 22일
The stepsize of ode45 is not constant, but chosen such that the error tolerances you prescribe are met. Thus mean step size can only be controlled indirectly by strengthening (-> smaller stepsize) or weakening (-> larger stepsize) the error tolerances RelTol and AbsTol.
Or do you mean changing the time instants when MATLAB supplies the solution ?

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by