I am trying to solve a second order ode using ODE45 but my tspan is not strictly increasing. How can I solve it ?

 채택된 답변

Stephan
Stephan 2019년 11월 27일

0 개 추천

Since ode45 uses an automated stepwide control just define the start and the end of your tspan this way:
tspan = [0 10];
This is all you have to do to solve this problem.

댓글 수: 3

Asir Tushar
Asir Tushar 2019년 11월 27일
actually I get the tspan from another function. I need that specified values to be tspan.
T0=[0
0
0
0
0
0
0
0
0
0
4.7581
12.1201
8.6331
2.2103
2.2103
2.2103
2.2103
2.2103
2.2103
2.2103
2.2103]
I need to solve this. thare are another 21 of them like these. where the values are not strictly increasing. I am not giving the main code because it is too big with lots of parameters.
tspan = sort(unique(T0));
should solve this.
Asir Tushar
Asir Tushar 2019년 11월 29일
Thank you.

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

추가 답변 (0개)

카테고리

태그

질문:

2019년 11월 24일

댓글:

2019년 11월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by