3984
|
1 /* |
|
2 |
|
3 Copyright (C) 2002 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 2, or (at your option) any |
|
10 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, write to the Free |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_ODES_h) |
|
24 #define octave_ODES_h 1 |
|
25 |
|
26 #include "ODESFunc.h" |
|
27 #include "base-de.h" |
|
28 |
|
29 class |
|
30 ODES : public base_diff_eqn, public ODESFunc |
|
31 { |
|
32 public: |
|
33 |
|
34 ODES (void) |
|
35 : base_diff_eqn (), ODESFunc (), theta () { } |
|
36 |
4587
|
37 ODES (const ColumnVector& s, double tm, ODESFunc& f) |
|
38 : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.length (), 0.0), theta () { } |
3984
|
39 |
4587
|
40 ODES (const ColumnVector& s, const ColumnVector& xtheta, double tm, |
3984
|
41 ODESFunc& f) |
4587
|
42 : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.length (), 0.0), |
3984
|
43 theta (xtheta) { } |
|
44 |
|
45 ODES (const ODES& a) |
|
46 : base_diff_eqn (a), ODESFunc (a), theta (a.theta) { } |
|
47 |
|
48 ODES& operator = (const ODES& a) |
|
49 { |
|
50 if (this != &a) |
|
51 { |
|
52 base_diff_eqn::operator = (a); |
|
53 ODESFunc::operator = (a); |
|
54 |
|
55 xdot = a.xdot; |
|
56 theta = a.theta; |
|
57 } |
|
58 return *this; |
|
59 } |
|
60 |
|
61 ~ODES (void) { } |
|
62 |
|
63 ColumnVector parameter_vector (void) { return theta; } |
|
64 |
|
65 void initialize (const ColumnVector& x, double t); |
|
66 |
|
67 void initialize (const ColumnVector& x, double t, |
|
68 const ColumnVector& theta); |
|
69 |
|
70 protected: |
|
71 |
|
72 // State vector time derivatives. |
|
73 ColumnVector xdot; |
|
74 |
|
75 // Parameter vector. |
|
76 ColumnVector theta; |
|
77 }; |
|
78 |
|
79 #endif |
|
80 |
|
81 /* |
|
82 ;;; Local Variables: *** |
|
83 ;;; mode: C++ *** |
|
84 ;;; End: *** |
|
85 */ |