/usr/share/octave/site/m/sundialsTB/idas/IDACalcIC.m is in octave-sundials 2.5.0-3+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | function [status, varargout] = IDACalcIC(tout,icmeth)
%IDACalcIC computes consistent initial conditions
%
% Usage: STATUS = IDACalcIC ( TOUT, ICMETH )
% [STATUS, YY0, YP0] = IDACalcIC ( TOUT, ICMETH )
%
% IDACalcIC corrects the guess for initial conditions passed
% to IDAInit or IDAReInit so that the algebraic constraints
% are satisfied.
%
% The argument TOUT is the first value of t at which a soluton will be
% requested (from IDASolve). This is needed here to determine the
% direction of integration and rough scale in the independent variable.
%
% If ICMETH is 'FindAlgebraic', then IDACalcIC attempts to compute
% the algebraic components of y and differential components of y',
% given the differential components of y.
% This option requires that the vector id was set through IDASetOptions
% specifying the differential and algebraic components.
% If ICMETH is 'FindAll', then IDACalcIC attempts to compute all
% components of y, given y'. In this case, id is not required.
%
% On return, STATUS is one of the following:
% SUCCESS IDACalcIC was successful. The corrected
% initial value vectors are in y0 and yp0.
% IDA_MEM_NULL The argument ida_mem was NULL.
% IDA_ILL_INPUT One of the input arguments was illegal.
% See printed message.
% IDA_LINIT_FAIL The linear solver's init routine failed.
% IDA_BAD_EWT Some component of the error weight vector
% is zero (illegal), either for the input
% value of y0 or a corrected value.
% IDA_RES_FAIL The user's residual routine returned
% a non-recoverable error flag.
% IDA_FIRST_RES_FAIL The user's residual routine returned
% a recoverable error flag on the first call,
% but IDACalcIC was unable to recover.
% IDA_LSETUP_FAIL The linear solver's setup routine had a
% non-recoverable error.
% IDA_LSOLVE_FAIL The linear solver's solve routine had a
% non-recoverable error.
% IDA_NO_RECOVERY The user's residual routine, or the linear
% solver's setup or solve routine had a
% recoverable error, but IDACalcIC was
% unable to recover.
% IDA_CONSTR_FAIL IDACalcIC was unable to find a solution
% satisfying the inequality constraints.
% IDA_LINESEARCH_FAIL The Linesearch algorithm failed to find a
% solution with a step larger than steptol
% in weighted RMS norm.
% IDA_CONV_FAIL IDACalcIC failed to get convergence of the
% Newton iterations.
%
% If the output arguments YY0 and YP0 are present, they will
% contain the consistent initial conditions.
%
% See also: IDASetOptions, IDAInit, IDAReInit
% Radu Serban <radu@llnl.gov>
% Copyright (c) 2005, The Regents of the University of California.
% $Revision: 1.3 $Date: 2007/08/21 17:38:42 $
mode = 25;
if nargout == 1
status = idm(mode, tout, icmeth);
elseif nargout == 3
[status, yy, yp] = idm(mode, tout, icmeth);
varargout(1) = {yy};
varargout(2) = {yp};
else
disp('IDACalcIC:: wrong number of output arguments');
end
|