Mercurial > hg > octave-lyh
annotate examples/oregonator.cc @ 2689:8c7955a8d49f
[project @ 1997-02-18 09:06:10 by jwe]
author | jwe |
---|---|
date | Tue, 18 Feb 1997 09:09:12 +0000 |
parents | |
children | 7c96e85c76db |
rev | line source |
---|---|
2689 | 1 #include <octave/oct.h> |
2 | |
3 #include <iostream.h> | |
4 | |
5 DEFUN_DLD (oregonator, args, , | |
6 "The `oregonator'.") | |
7 { | |
8 ColumnVector dx (3); | |
9 | |
10 ColumnVector x = args(0).vector_value (); | |
11 | |
12 dx(0) = 77.27 * (x(1) - x(0)*x(1) + x(0) - 8.375e-06*pow (x(0), 2)); | |
13 dx(1) = (x(2) - x(0)*x(1) - x(1)) / 77.27; | |
14 dx(2) = 0.161*(x(0) - x(2)); | |
15 | |
16 return octave_value (dx); | |
17 } |