필터 지우기
필터 지우기

ODE23/45 for 2-dimensional solution and alternatives?

조회 수: 1 (최근 30일)
Chien-Chia Huang
Chien-Chia Huang 2014년 1월 28일
댓글: Chien-Chia Huang 2014년 1월 29일
Hello there,
Per the help document for ODE23/45, there is no way to get a 2-element solution even if I input tspan which has only 2 points (my tspan is like 1+1/500:1/500:1+2/500). So my question is if
1. I can enforce ODE solvers to yield such solutions or
2. is there any alternative ODE routine that I can use to get my things working?
Thanks!
  댓글 수: 1
Chien-Chia Huang
Chien-Chia Huang 2014년 1월 29일
The problem can be resolved by using the information T.
Let's say we have [T,Y] = ode45(myode,tspan,y0) and tspan has only two elements, e.g. tspan = [a,b]. Then, to get a 2-dimensional solution for ODE23/45, we write
Y = Y(abs(T-a)<0.0001 | abs(T-b)<0.0001)
which would result in a 2-dimensional solution as desired.

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

답변 (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