view examples/oregonator.cc @ 18599:04b4fb217b1a stable

doc: Improve documentation strings in parse-tree directory. * lex.ll (F__display_tokens__): Add seealso reference. * lex.ll (F__token_count__): Add seealso reference. * lex.ll (F__lexer_debug_flag__): Document function. * oct-parse.in.yy (Fautoload): Add additional calling form. Rephrase several sentences. * oct-parse.in.yy (Fmfilename): Make single sentence description stand apart from the rest of documentation. * oct-parse.in.yy (Fsource): Make single sentence description stand apart from the rest of documentation. Add seealso link to 'run'. * oct-parse.in.yy (Fbuiltin): Change type to "Built-in Function" from "Loadable Function". * oct-parse.in.yy (Feval): Rephrase several sentences. Add programming note suggesting the use of alternatives like try/catch or unwind_protect. * oct-parse.in.yy (F__parser_debug_flag__): Document function. * pt-mat.cc (Fstring_fill_char): Use semicolon in place of period for stronger idea linkage.
author Rik <rik@octave.org>
date Fri, 28 Feb 2014 14:04:41 -0800
parents 224e76250443
children
line wrap: on
line source

#include <octave/oct.h>

DEFUN_DLD (oregonator, args, ,
           "The `oregonator'.\n\
\n\
Reference:\n\
\n\
  Oscillations in chemical systems.  IV.  Limit cycle behavior in a\n\
  model of a real chemical reaction. Richard J. Field and Richard\n\
  M. Noyes, The Journal of Chemical Physics, Volume 60 Number 5,\n\
  March 1974.")
{
  ColumnVector dx (3);

  ColumnVector x (args(0).vector_value ());

  dx(0) = 77.27 * (x(1) - x(0)*x(1) + x(0) - 8.375e-06*pow (x(0), 2.0));
  dx(1) = (x(2) - x(0)*x(1) - x(1)) / 77.27;
  dx(2) = 0.161*(x(0) - x(2));

  return octave_value (dx);
}