23 #if defined (HAVE_CONFIG_H) 59 BEGIN_INTERRUPT_WITH_EXCEPTIONS;
67 tmp_deriv = (*user_fun) (*
tmp_x, time);
74 deriv[
i] = tmp_deriv.
elem (
i);
77 END_INTERRUPT_WITH_EXCEPTIONS;
86 BEGIN_INTERRUPT_WITH_EXCEPTIONS;
94 tmp_jac = (*user_jac) (*
tmp_x, time);
96 for (
F77_INT j = 0; j < neq; j++)
98 pd[nrowpd * j +
i] = tmp_jac (
i, j);
100 END_INTERRUPT_WITH_EXCEPTIONS;
126 if (integration_method () ==
"stiff")
136 lrw = 22 + n * (9 + n);
162 if (maxord > 0 && maxord <= max_maxord)
164 iwork(4) = octave::to_f77_int (maxord);
170 (*current_liboctave_error_handler)
171 (
"lsode: invalid value for maximum order");
206 (*current_liboctave_error_handler)
207 (
"lsode: inconsistent sizes for state and derivative vectors");
217 rel_tol = relative_tolerance ();
218 abs_tol = absolute_tolerance ();
222 if (abs_tol_len == 1)
224 else if (abs_tol_len == n)
229 (*current_liboctave_error_handler)
230 (
"lsode: inconsistent sizes for state and absolute tolerance vectors");
236 double iss = initial_step_size ();
243 double maxss = maximum_step_size ();
250 double minss = minimum_step_size ();
257 F77_INT sl = octave::to_f77_int (step_limit ());
264 LSODE_options::reset =
false;
304 (*current_liboctave_error_handler)
305 (
"unrecognized value of istate (= %d) returned from lsode",
istate);
317 std::ostringstream buf;
324 retval =
"prior to initial integration step";
328 retval =
"successful exit";
332 retval =
"prior to continuation call with modified parameters";
336 retval =
"excess work on this call (t = " + t_curr +
337 "; perhaps wrong integration method)";
341 retval =
"excess accuracy requested (tolerances too small)";
345 retval =
"invalid input detected (see printed message)";
349 retval =
"repeated error test failures (t = " + t_curr +
350 "; check all inputs)";
354 retval =
"repeated convergence failures (t = " + t_curr +
355 "; perhaps bad Jacobian supplied or wrong choice of integration method or tolerances)";
359 retval =
"error weight became zero during problem. (t = " + t_curr +
360 "; solution component i vanished, and atol or atol(i) == 0)";
364 retval =
"return requested in user-supplied function (t = " 369 retval =
"unknown error state";
384 if (n_out > 0 && n > 0)
414 if (n_out > 0 && n > 0)
427 double next_crit = tcrit.
elem (0);
429 while (i_out < n_out)
431 bool do_restart =
false;
433 next_out = tout.
elem (i_out);
435 next_crit = tcrit.
elem (i_crit);
437 bool save_output =
false;
440 if (next_crit == next_out)
449 else if (next_crit < next_out)
F77_RET_T F77_INT F77_DBLE F77_DBLE F77_DBLE F77_INT F77_DBLE const F77_DBLE F77_INT F77_INT F77_INT F77_DBLE F77_INT F77_INT F77_INT F77_INT &static ODEFunc::ODERHSFunc user_fun
ColumnVector(* ODERHSFunc)(const ColumnVector &, double)
Matrix(* ODEJacFunc)(const ColumnVector &, double)
ODEJacFunc jacobian_function(void) const
static ColumnVector * tmp_x
F77_RET_T F77_FUNC(dlsode, DLSODE)(lsode_fcn_ptr
static F77_INT lsode_j(const F77_INT &neq, const double &time, double *, const F77_INT &, const F77_INT &, double *pd, const F77_INT &nrowpd)
const T * fortran_vec(void) const
ColumnVector do_integrate(double t)
T & elem(octave_idx_type n)
std::string error_message(void) const
#define F77_XFCN(f, F, args)
F77_RET_T(F77_CONST_CHAR_ARG_DECL, F77_CONST_CHAR_ARG_DECL, F77_CONST_CHAR_ARG_DECL, const F77_INT &, const F77_INT &, const F77_INT &, F77_INT &, F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, F77_DBLE *, F77_DBLE *, const F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, F77_INT *, F77_INT &F77_CHAR_ARG_LEN_DECL F77_CHAR_ARG_LEN_DECL F77_CHAR_ARG_LEN_DECL)
octave_value resize(const dim_vector &dv, bool fill=false) const
octave_f77_int_type method_flag
octave_f77_int_type itask
octave_idx_type size(void) const
F77_INT(* lsode_fcn_ptr)(const F77_INT &, const double &, double *, double *, F77_INT &)
virtual void force_restart(void)
F77_INT(* lsode_jac_ptr)(const F77_INT &, const double &, double *, const F77_INT &, const F77_INT &, double *, const F77_INT &)
void set_stop_time(double tt)
void resize(const dim_vector &dv, const T &rfv)
Resizing (with fill).
Array< octave_f77_int_type > iwork
void clear_stop_time(void)
static ODEFunc::ODEJacFunc user_jac
octave_f77_int_type F77_INT
static F77_INT lsode_f(const F77_INT &neq, const double &time, double *, double *deriv, F77_INT &ierr)
octave_idx_type numel(void) const
Number of elements in the array.
Vector representing the dimensions (size) of an Array.
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE const F77_INT F77_INT & ierr
subroutine DLSODE(F, NEQ, Y, T, TOUT, ITOL, RTOL, ATOL, ITASK, ISTATE, IOPT, RWORK, LRW, IWORK, LIW, JAC, MF)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string