Does ode45 integrate first, then have functions of time t (antiderivatives), and then use the initial conditions, and then compute solutions for the time interval specified? That's what we usually do analytically (by hand) with simple odes, so I'm wondering if ode45 follows these same steps.
Also, how long should I run ode45 for, before the solutions become garbage and untrustworthy, due to accumulations of numerical / round-off errors? Is there a generally accepted max time, say, t_final = 30?
As said in comments,
ode45implements a numerical method of the Runge-Kutta family.There cannot be a simple number like that. Just by rescaling (replacing $t$ by $1000t$ in the equation) we can change whatever "the maximum time" was by the factor of 1000. The stability of solution greatly depends on the ODE itself (and its initial condition); for example the ODE $y'=y^2$ with $y(0)=y_0$ has exact solution $y(t) = y_0/(1-y_0t)$ which blows up at the time $t=y_0^{-1}$, at which point any numeric solution will cease to be meaningful.
It doesn't help you gain accuracy. The algorithm
ode45already controls the accuracy of the solution, using sophisticated (albeit necessarily heuristic) error estimates. (Roughly: if one computes the solution using a method of 4th order of accuracy, and then using a method of 5th order, then the difference of the results gives information about how far they are from the exact solution.) The algorithm adjusts the time steps as needed to maintain the accuracy.Numerical packages, such as Matlab, allow the user to adjust the required tolerance for absolute or relative errors. See Summary of ODE options; in particular,
odegetwill display the options that are present by default.