annotate examples/oregonator.cc @ 7948:af10baa63915 ss-3-1-50

3.1.50 snapshot
author John W. Eaton <jwe@octave.org>
date Fri, 18 Jul 2008 17:42:48 -0400
parents 4270ded9ddc6
children 4295d634797d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7019
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
1 /*
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
2
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
3 Copyright (C) 1997, 1998, 2000, 2002, 2007 John W. Eaton
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
4
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
5 This file is part of Octave.
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
6
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
8 under the terms of the GNU General Public License as published by the
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
10 option) any later version.
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
11
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
15 for more details.
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
16
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
17 You should have received a copy of the GNU General Public License
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
18 along with Octave; see the file COPYING. If not, see
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
19 <http://www.gnu.org/licenses/>.
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
20
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
21 */
4270ded9ddc6 [project @ 2007-10-13 01:42:20 by jwe]
jwe
parents: 4205
diff changeset
22
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents:
diff changeset
23 #include <octave/oct.h>
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents:
diff changeset
24
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents:
diff changeset
25 DEFUN_DLD (oregonator, args, ,
3162
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 2689
diff changeset
26 "The `oregonator'.\n\
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 2689
diff changeset
27 \n\
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 2689
diff changeset
28 Reference:\n\
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 2689
diff changeset
29 \n\
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 2689
diff changeset
30 Oscillations in chemical systems. IV. Limit cycle behavior in a\n\
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 2689
diff changeset
31 model of a real chemical reaction. Richard J. Field and Richard\n\
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 2689
diff changeset
32 M. Noyes, The Journal of Chemical Physics, Volume 60 Number 5,\n\
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 2689
diff changeset
33 March 1974.")
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents:
diff changeset
34 {
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents:
diff changeset
35 ColumnVector dx (3);
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents:
diff changeset
36
3681
df54d394acc0 [project @ 2000-06-26 17:46:58 by jwe]
jwe
parents: 3659
diff changeset
37 ColumnVector x (args(0).vector_value ());
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents:
diff changeset
38
4205
6b7bd9e406be [project @ 2002-11-27 22:04:51 by jwe]
jwe
parents: 3681
diff changeset
39 dx(0) = 77.27 * (x(1) - x(0)*x(1) + x(0) - 8.375e-06*pow (x(0), 2.0));
2689
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents:
diff changeset
40 dx(1) = (x(2) - x(0)*x(1) - x(1)) / 77.27;
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents:
diff changeset
41 dx(2) = 0.161*(x(0) - x(2));
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents:
diff changeset
42
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents:
diff changeset
43 return octave_value (dx);
8c7955a8d49f [project @ 1997-02-18 09:06:10 by jwe]
jwe
parents:
diff changeset
44 }