2017-05-10 5 views
0

ODE45には最後の解を残しておきたいと思います。むしろtspan = [t0 tf]からすべての解を返す。私は返されたベクトルをtfの解にしたいだけです。ドキュメントからMATLAB ODE45:最後の解を保存するだけです。

Error using horzcat Requested 442368x1828 (6.0GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information.

Error in ode45 (line 428) yout = [yout, zeros(neq,chunk,dataType)];

答えて

2

tspan — Interval of integration vector Interval of integration, specified as a vector. At minimum, tspan must be a two element vector [t0 tf] specifying the initial and final times. To obtain solutions at specific times between t0 and tf, use a longer vector of the form [t0,t1,t2,...,tf]. The elements in tspan must be all increasing or all decreasing.

The solver imposes the initial conditions, y0, at tspan(1), then integrates from tspan(1) to tspan(end):

If tspan has two elements, [t0 tf], then the solver returns the solution evaluated at each internal integration step within the interval. If tspan contains more than two elements [t0,t1,t2,...,tf], then the solver returns the solution evaluated at the given points. This does not affect the internal steps that the solver uses to traverse from tspan(1) to tspan(end). Thus, the solver does not necessarily step precisely to each point specified in tspan. However, the solutions produced at the specified points are of the same order of accuracy as the solutions computed at each internal step. Specifying several intermediate points has little effect on the efficiency of computation, but for large systems it can affect memory management. The solution obtained by the solver might be different depending on whether you specify tspan as a two-element vector or as a vector with intermediate points. If tspan contains several intermediate points, then they give an indication of the scale for the problem, which can affect the size of the initial step taken by the solver.

だから三点を指定

私はこれをしたいと思った理由は、次のエラーを回避することです。 [t0 (t0+tf)/2 tf]

関連する問題