Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
trsolver.h
Go to the documentation of this file.
1 /*
2  * trsolver.h - transient solver class definitions
3  *
4  * Copyright (C) 2004, 2005, 2006, 2007, 2008 Stefan Jahn <stefan@lkcc.org>
5  *
6  * This is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This software is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this package; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * $Id$
22  *
23  */
24 
25 #ifndef __TRSOLVER_H__
26 #define __TRSOLVER_H__
27 
28 #include "nasolver.h"
29 #include "states.h"
30 
31 namespace qucs {
32 
33 class sweep;
34 class circuit;
35 class history;
36 
37 class trsolver : public nasolver<nr_double_t>, public states<nr_double_t>
38 {
39 public:
41  trsolver (char *);
42  trsolver (trsolver &);
43  ~trsolver ();
44  int solve (void);
45  int predictor (void);
46  int corrector (void);
47  void nextStates (void);
48  void fillStates (void);
49  void setMode (int);
50  void setDelta (void);
51  void adjustDelta (nr_double_t);
52  void adjustOrder (int reduce = 0);
53  void initTR (void);
54  void deinitTR (void);
55  static void calcTR (trsolver *);
56  void restart (void);
57  void initDC (void);
58  static void calcDC (trsolver *);
59  void initSteps (void);
60  void saveAllResults (nr_double_t);
61  nr_double_t checkDelta (void);
62  void updateCoefficients (nr_double_t);
63  void initHistory (nr_double_t);
64  void updateHistory (nr_double_t);
65  void saveHistory (circuit *);
66  void predictBashford (void);
67  void predictEuler (void);
68  void predictGear (void);
69  void initCircuitTR (circuit *);
70  void fillSolution (tvector<nr_double_t> *);
71  int dcAnalysis (void);
72 
73 protected:
75  nr_double_t predCoeff[8];
76  nr_double_t corrCoeff[8];
77  nr_double_t deltas[8];
78  nr_double_t delta;
79  nr_double_t deltaMax;
80  nr_double_t deltaMin;
81  nr_double_t deltaOld;
82  nr_double_t stepDelta;
83  int CMethod; // user specified corrector method
84  int PMethod; // user specified predictor method
85  int corrMaxOrder; // maximum corrector order
86  int predMaxOrder; // maximum predictor order
87  int corrType; // current corrector method
88  int predType; // current predictor method
89  int corrOrder; // current corrector order
90  int predOrder; // current predictor order
91  int rejected;
92  int converged;
94  nr_double_t current;
95  int statSteps;
100  bool relaxTSR;
101  bool initialDC;
102 
103 };
104 
105 } // namespace qucs
106 
107 #endif /* __TRSOLVER_H__ */
int statIterations
Definition: trsolver.h:97
int corrector(void)
Definition: trsolver.cpp:570
static void calcTR(trsolver *)
Definition: trsolver.cpp:734
void predictGear(void)
Definition: trsolver.cpp:549
trsolver(char *)
Definition: trsolver.cpp:77
nr_double_t delta
Definition: trsolver.h:78
void setDelta(void)
Definition: trsolver.cpp:615
int predMaxOrder
Definition: trsolver.h:86
int corrMaxOrder
Definition: trsolver.h:85
tvector< nr_double_t > * solution[8]
Definition: trsolver.h:93
void restart(void)
Definition: trsolver.cpp:745
int solve(void)
placehoder for solution function
Definition: trsolver.cpp:175
int statConvergence
Definition: trsolver.h:98
void initDC(void)
Definition: trsolver.cpp:756
void deinitTR(void)
Definition: trsolver.cpp:830
void adjustDelta(nr_double_t)
Definition: trsolver.cpp:624
int dcAnalysis(void)
Definition: trsolver.cpp:123
void predictBashford(void)
Definition: trsolver.cpp:507
void saveAllResults(nr_double_t)
Definition: trsolver.cpp:858
void initHistory(nr_double_t)
Definition: trsolver.cpp:401
void fillStates(void)
Definition: trsolver.cpp:596
void initSteps(void)
Definition: trsolver.cpp:116
nr_double_t deltas[8]
Definition: trsolver.h:77
void fillSolution(tvector< nr_double_t > *)
Definition: trsolver.cpp:500
nr_double_t deltaOld
Definition: trsolver.h:81
void setMode(int)
Definition: trsolver.cpp:607
void adjustOrder(int reduce=0)
Definition: trsolver.cpp:694
nr_double_t checkDelta(void)
Definition: trsolver.cpp:874
void nextStates(void)
Definition: trsolver.cpp:578
void updateCoefficients(nr_double_t)
Definition: trsolver.cpp:919
int predictor(void)
Definition: trsolver.cpp:476
nr_double_t deltaMax
Definition: trsolver.h:79
bool initialDC
Definition: trsolver.h:101
void saveHistory(circuit *)
Definition: trsolver.cpp:445
void predictEuler(void)
Definition: trsolver.cpp:531
nr_double_t corrCoeff[8]
Definition: trsolver.h:76
nr_double_t deltaMin
Definition: trsolver.h:80
nr_double_t current
Definition: trsolver.h:94
void initCircuitTR(circuit *)
Definition: trsolver.cpp:847
nr_double_t stepDelta
Definition: trsolver.h:82
void initTR(void)
Definition: trsolver.cpp:767
ACREATOR(trsolver)
sweep * swp
Definition: trsolver.h:74
int statRejected
Definition: trsolver.h:96
static void calcDC(trsolver *)
Definition: trsolver.cpp:723
nr_double_t predCoeff[8]
Definition: trsolver.h:75
history * tHistory
Definition: trsolver.h:99
void updateHistory(nr_double_t)
Definition: trsolver.cpp:428