37 DEFUN (colloc, args, ,
39 @deftypefn {Built-in Function} {[@var{r}, @var{amat}, @var{bmat}, @var{q}] =} colloc (@var{n}, \"left\", \"right\")\n\
40 Compute derivative and integral weight matrices for orthogonal collocation.\n\
42 Reference: @nospell{J. Villadsen}, @nospell{M. L. Michelsen},\n\
43 @cite{Solution of Differential Equation Models by Polynomial Approximation}.\n\
48 int nargin = args.
length ();
50 if (nargin < 1 || nargin > 3)
56 if (! args(0).is_scalar_type ())
58 error (
"colloc: N must be a scalar");
62 double tmp = args(0).double_value ();
69 error (
"colloc: N cannot be NaN");
76 error (
"colloc: N must be positive");
84 for (
int i = 1; i < nargin; i++)
86 if (args(i).is_defined ())
88 if (! args(i).is_string ())
90 error (
"colloc: expecting string argument \"left\" or \"right\"");
94 std::string s = args(i).string_value ();
96 if ((s.length () == 1 && (s[0] ==
'R' || s[0] ==
'r'))
101 else if ((s.length () == 1 && (s[0] ==
'L' || s[0] ==
'l'))
108 error (
"colloc: unrecognized argument");
114 error (
"colloc: unexpected empty argument");
119 ntot += left + right;
122 error (
"colloc: the total number of roots must be positive");
OCTINTERP_API void print_usage(void)
octave_idx_type length(void) const
F77_RET_T const octave_idx_type Complex * A
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
F77_RET_T const octave_idx_type Complex const octave_idx_type Complex * B
ColumnVector quad_weights(void)
octave_idx_type NINTbig(double x)