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