MATLAB Answers

Tspan is not strictly increasing.

10 views (last 30 days)
Asir Tushar
Asir Tushar on 24 Nov 2019
Commented: Asir Tushar on 29 Nov 2019
I am trying to solve a second order ode using ODE45 but my tspan is not strictly increasing. How can I solve it ?

  0 Comments

Sign in to comment.

Accepted Answer

Stephan
Stephan on 27 Nov 2019
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 Comments

Asir Tushar
Asir Tushar on 27 Nov 2019
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.
Stephan
Stephan on 28 Nov 2019
tspan = sort(unique(T0));
should solve this.

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags