필터 지우기
필터 지우기

Argument 'range' for ode45

조회 수: 2 (최근 30일)
Douglas Alves
Douglas Alves 2014년 6월 9일
댓글: Douglas Alves 2014년 6월 10일
I have just found out that ode45(@fun,tspin,x) can have instead of tspin = [value1 value2]. tspin could be a linspace(a,b,c) where a,b and c are numbers. What's the difference between these kinds of tspins? I thought it should be only 2 values because integration from value1 to value2. How should I set up tspin in case it's a 3D integration? 6 values should be put in tspin? If so, may this problem have a dimension much bigger than a 3D ?

채택된 답변

Mischa Kim
Mischa Kim 2014년 6월 10일
편집: Mischa Kim 2014년 6월 10일
Douglas, to your first question you would choose linspace if you want the ode solver to return solutions at specific times. If you do not really care about the solution at specific times, simply go with tspin = [value1 value2], where value1 and value2 correspond to a and b.
As far as your second question is concerned I assume you are hinting at partial differential equations, which you would solve with the PDE toolbox.
  댓글 수: 3
Mischa Kim
Mischa Kim 2014년 6월 10일
Correct. Both approaches give you the same answer, also in terms of accuracy. The only difference is that with the second approach you tell MATLAB at which time points you want an output of the solution. If you do not specify time points MATLAB will do it for you, again, without loss of accuracy.
Accuracy is determined by the solver settings.
Douglas Alves
Douglas Alves 2014년 6월 10일
Thank you very much Mischa.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by