My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dc_sim.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  dc_sim.cpp - description
3  -------------------
4  begin : Sat Aug 23 2003
5  copyright : (C) 2003 by Michael Margraf
6  email : michael.margraf@alumni.tu-berlin.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "dc_sim.h"
19 #include "main.h"
20 
21 
23 {
24  Description = QObject::tr("dc simulation");
25 
26  QString s = Description;
27  int a = s.find(" ");
28  int b = s.findRev(" ");
29  if (a != -1 && b != -1) {
30  if (a > (int) s.length() - b) b = a;
31  }
32  if (a < 8 || s.length() - b < 8) b = -1;
33  if (b != -1) s[b] = '\n';
34 
35  Texts.append(new Text(0, 0, s.left(b), QPen::darkBlue, QucsSettings.largeFontSize));
36  if (b != -1)
37  Texts.append(new Text(0, 0, s.mid(b+1), QPen::darkBlue, QucsSettings.largeFontSize));
38 
39  x1 = -10; y1 = -9;
40  x2 = x1+128; y2 = y1+41;
41 
42  tx = 0;
43  ty = y2+1;
44  Model = ".DC";
45  Name = "DC";
46 
47  Props.append(new Property("Temp", "26.85", false,
48  QObject::tr("simulation temperature in degree Celsius")));
49  Props.append(new Property("reltol", "0.001", false,
50  QObject::tr("relative tolerance for convergence")));
51  Props.append(new Property("abstol", "1 pA", false,
52  QObject::tr("absolute tolerance for currents")));
53  Props.append(new Property("vntol", "1 uV", false,
54  QObject::tr("absolute tolerance for voltages")));
55  Props.append(new Property("saveOPs", "no", false,
56  QObject::tr("put operating points into dataset")+
57  " [yes, no]"));
58  Props.append(new Property("MaxIter", "150", false,
59  QObject::tr("maximum number of iterations until error")));
60  Props.append(new Property("saveAll", "no", false,
61  QObject::tr("save subcircuit nodes into dataset")+
62  " [yes, no]"));
63  Props.append(new Property("convHelper", "none", false,
64  QObject::tr("preferred convergence algorithm")+
65  " [none, gMinStepping, SteepestDescent, LineSearch, Attenuation, SourceStepping]"));
66  Props.append(new Property("Solver", "CroutLU", false,
67  QObject::tr("method for solving the circuit matrix")+
68  " [CroutLU, DoolittleLU, HouseholderQR, HouseholderLQ, GolubSVD]"));
69 }
70 
72 {
73 }
74 
76 {
77  return new DC_Sim();
78 }
79 
80 Element* DC_Sim::info(QString& Name, char* &BitmapFile, bool getNewOne)
81 {
82  Name = QObject::tr("dc simulation");
83  BitmapFile = (char *) "dc";
84 
85  if(getNewOne) return new DC_Sim();
86  return 0;
87 }