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 |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
382
|
24 #if !defined (octave_DAE_h) |
|
25 #define octave_DAE_h 1 |
|
26 |
465
|
27 #include "dColVector.h" |
3
|
28 #include "ODE.h" |
|
29 #include "DAEFunc.h" |
|
30 |
384
|
31 extern "C++" { |
|
32 |
3
|
33 #ifndef Vector |
|
34 #define Vector ColumnVector |
|
35 #endif |
|
36 |
|
37 class DAE : public ODE, public DAEFunc |
|
38 { |
|
39 public: |
|
40 |
|
41 DAE (void); |
|
42 |
|
43 DAE (int); |
|
44 |
302
|
45 DAE (const Vector& x, double time, DAEFunc& f); |
3
|
46 |
302
|
47 DAE (const Vector& x, const Vector& xdot, double time, DAEFunc& f); |
3
|
48 |
|
49 ~DAE (void); |
|
50 |
|
51 Vector deriv (void); |
|
52 |
302
|
53 virtual void initialize (const Vector& x, double t); |
303
|
54 virtual void initialize (const Vector& x, const Vector& xdot, double t); |
3
|
55 |
|
56 Vector integrate (double t); |
|
57 |
305
|
58 Matrix integrate (const Vector& tout, Matrix& xdot_out); |
|
59 Matrix integrate (const Vector& tout, Matrix& xdot_out, |
3
|
60 const Vector& tcrit); |
|
61 |
|
62 protected: |
|
63 |
|
64 /* |
|
65 * Some of this is probably too closely related to DASSL, but hey, |
|
66 * this is just a first attempt... |
|
67 */ |
|
68 |
|
69 Vector xdot; |
|
70 |
|
71 private: |
|
72 |
257
|
73 int integration_error; |
3
|
74 int restart; |
|
75 int liw; |
|
76 int lrw; |
|
77 int idid; |
|
78 int *info; |
|
79 int *iwork; |
|
80 double *rwork; |
|
81 |
|
82 friend int ddassl_j (double *time, double *state, double *deriv, |
|
83 double *pd, double *cj, double *rpar, int *ipar); |
|
84 |
|
85 friend int ddassl_f (double *time, double *state, double *deriv, |
|
86 double *delta, int *ires, double *rpar, int *ipar); |
|
87 |
|
88 }; |
|
89 |
382
|
90 } // extern "C++" |
|
91 |
3
|
92 #endif |
382
|
93 |
|
94 /* |
|
95 ;;; Local Variables: *** |
|
96 ;;; mode: C++ *** |
|
97 ;;; page-delimiter: "^/\\*" *** |
|
98 ;;; End: *** |
|
99 */ |