3
|
1 // DAE.h -*- C++ -*- |
|
2 /* |
|
3 |
1011
|
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
3
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
3
|
21 |
|
22 */ |
|
23 |
382
|
24 #if !defined (octave_DAE_h) |
|
25 #define octave_DAE_h 1 |
|
26 |
1296
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
465
|
31 #include "dColVector.h" |
3
|
32 #include "ODE.h" |
|
33 #include "DAEFunc.h" |
|
34 |
|
35 class DAE : public ODE, public DAEFunc |
|
36 { |
|
37 public: |
|
38 |
|
39 DAE (void); |
|
40 |
|
41 DAE (int); |
|
42 |
1536
|
43 DAE (const ColumnVector& x, double time, DAEFunc& f); |
3
|
44 |
1536
|
45 DAE (const ColumnVector& x, const ColumnVector& xdot, |
|
46 double time, DAEFunc& f); |
3
|
47 |
|
48 ~DAE (void); |
|
49 |
1536
|
50 ColumnVector deriv (void); |
3
|
51 |
1536
|
52 virtual void initialize (const ColumnVector& x, double t); |
|
53 virtual void initialize (const ColumnVector& x, |
|
54 const ColumnVector& xdot, double t); |
3
|
55 |
1536
|
56 ColumnVector integrate (double t); |
3
|
57 |
1536
|
58 Matrix integrate (const ColumnVector& tout, Matrix& xdot_out); |
|
59 Matrix integrate (const ColumnVector& tout, Matrix& xdot_out, |
|
60 const ColumnVector& tcrit); |
3
|
61 |
|
62 protected: |
|
63 |
1359
|
64 // Some of this is probably too closely related to DASSL, but hey, |
|
65 // this is just a first attempt... |
3
|
66 |
1536
|
67 ColumnVector xdot; |
3
|
68 |
|
69 private: |
|
70 |
257
|
71 int integration_error; |
3
|
72 int restart; |
|
73 int liw; |
|
74 int lrw; |
|
75 int idid; |
|
76 int *info; |
|
77 int *iwork; |
|
78 double *rwork; |
|
79 |
|
80 friend int ddassl_j (double *time, double *state, double *deriv, |
|
81 double *pd, double *cj, double *rpar, int *ipar); |
|
82 |
|
83 friend int ddassl_f (double *time, double *state, double *deriv, |
|
84 double *delta, int *ires, double *rpar, int *ipar); |
|
85 |
|
86 }; |
|
87 |
|
88 #endif |
382
|
89 |
|
90 /* |
|
91 ;;; Local Variables: *** |
|
92 ;;; mode: C++ *** |
|
93 ;;; page-delimiter: "^/\\*" *** |
|
94 ;;; End: *** |
|
95 */ |