GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
base-dae.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2002-2013 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 
23 #if !defined (octave_base_dae_h)
24 #define octave_base_dae_h 1
25 
26 #include "base-de.h"
27 
28 class
30 {
31 public:
32 
34  : base_diff_eqn (), xdot () { }
35 
36  base_diff_alg_eqn (const ColumnVector& xx, double tt)
37  : base_diff_eqn (xx, tt), xdot (xx.length (), 0.0) { }
38 
39  base_diff_alg_eqn (const ColumnVector& xx, const ColumnVector& xxdot,
40  double tt)
41  : base_diff_eqn (xx, tt), xdot (xxdot) { }
42 
44  : base_diff_eqn (a), xdot (a.xdot) { }
45 
46  virtual ~base_diff_alg_eqn (void) { }
47 
48  base_diff_alg_eqn& operator = (const base_diff_alg_eqn& a)
49  {
50  if (this != &a)
51  {
53  xdot = a.xdot;
54  }
55  return *this;
56  }
57 
58  void initialize (const ColumnVector& x0, double t0)
59  {
61  xdot = ColumnVector (x0.length (), 0.0);
62  }
63 
64  void initialize (const ColumnVector& x0, const ColumnVector& xdot0,
65  double t0)
66  {
68  xdot = xdot0;
69  }
70 
71  ColumnVector state_derivative (void) { return xdot; }
72 
73 protected:
74 
76 };
77 
78 #endif