I've obtained a numerical solution of a differential equation in a form of a vector (i.e. M(170,1)) by using ode45, and tspan=0:500 (time range). How can I now integrate M(t)dt, when I am not sure how time sequences are distributed? I know, that I could put tspan=0:0.01:500, but I would like to save some time now.
Asked
Active
Viewed 31 times
0
-
Would this be better asked on math.stackexchange.com? – Ed B Jun 11 '15 at 16:00
1 Answers
0
Add the integral to the differential system. If dM/dt=F(t,M)
then the integral satisfies the differential equation dI/dt=M
, that is d[M,I]/dt=[F(t,M), M]
.
This also gives for I
a numerical integration of the same error order as for M
.

Lutz Lehmann
- 25,219
- 2
- 22
- 51