Qucs-GUI
0.0.18
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
qucs
components
tr_sim.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
tr_sim.cpp
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
#include <QtGui>
18
#include "
tr_sim.h
"
19
#include "
main.h
"
20
21
22
TR_Sim::TR_Sim
()
23
{
24
Description
= QObject::tr(
"transient simulation"
);
25
26
QString s =
Description
;
27
int
a = s.find(
" "
);
28
if
(a != -1) s[a] =
'\n'
;
29
30
Texts
.append(
new
Text
(0, 0, s.left(a), Qt::darkBlue,
QucsSettings
.
largeFontSize
));
31
if
(a != -1)
32
Texts
.append(
new
Text
(0, 0, s.mid(a+1), Qt::darkBlue,
QucsSettings
.
largeFontSize
));
33
34
x1
= -10;
y1
= -9;
35
x2
=
x1
+104;
y2
=
y1
+59;
36
37
tx
= 0;
38
ty
=
y2
+1;
39
Model
=
".TR"
;
40
Name
=
"TR"
;
41
42
// The index of the first 4 properties must not changed. Used in recreate().
43
Props
.append(
new
Property
(
"Type"
,
"lin"
,
true
,
44
QObject::tr(
"sweep type"
)+
" [lin, log, list, const]"
));
45
Props
.append(
new
Property
(
"Start"
,
"0"
,
true
,
46
QObject::tr(
"start time in seconds"
)));
47
Props
.append(
new
Property
(
"Stop"
,
"1 ms"
,
true
,
48
QObject::tr(
"stop time in seconds"
)));
49
Props
.append(
new
Property
(
"Points"
,
"11"
,
false
,
50
QObject::tr(
"number of simulation time steps"
)));
51
Props
.append(
new
Property
(
"IntegrationMethod"
,
"Trapezoidal"
,
false
,
52
QObject::tr(
"integration method"
)+
53
" [Euler, Trapezoidal, Gear, AdamsMoulton]"
));
54
Props
.append(
new
Property
(
"Order"
,
"2"
,
false
,
55
QObject::tr(
"order of integration method"
)+
" (1-6)"
));
56
Props
.append(
new
Property
(
"InitialStep"
,
"1 ns"
,
false
,
57
QObject::tr(
"initial step size in seconds"
)));
58
Props
.append(
new
Property
(
"MinStep"
,
"1e-16"
,
false
,
59
QObject::tr(
"minimum step size in seconds"
)));
60
Props
.append(
new
Property
(
"MaxIter"
,
"150"
,
false
,
61
QObject::tr(
"maximum number of iterations until error"
)));
62
Props
.append(
new
Property
(
"reltol"
,
"0.001"
,
false
,
63
QObject::tr(
"relative tolerance for convergence"
)));
64
Props
.append(
new
Property
(
"abstol"
,
"1 pA"
,
false
,
65
QObject::tr(
"absolute tolerance for currents"
)));
66
Props
.append(
new
Property
(
"vntol"
,
"1 uV"
,
false
,
67
QObject::tr(
"absolute tolerance for voltages"
)));
68
Props
.append(
new
Property
(
"Temp"
,
"26.85"
,
false
,
69
QObject::tr(
"simulation temperature in degree Celsius"
)));
70
Props
.append(
new
Property
(
"LTEreltol"
,
"1e-3"
,
false
,
71
QObject::tr(
"relative tolerance of local truncation error"
)));
72
Props
.append(
new
Property
(
"LTEabstol"
,
"1e-6"
,
false
,
73
QObject::tr(
"absolute tolerance of local truncation error"
)));
74
Props
.append(
new
Property
(
"LTEfactor"
,
"1"
,
false
,
75
QObject::tr(
"overestimation of local truncation error"
)));
76
Props
.append(
new
Property
(
"Solver"
,
"CroutLU"
,
false
,
77
QObject::tr(
"method for solving the circuit matrix"
)+
78
" [CroutLU, DoolittleLU, HouseholderQR, HouseholderLQ, GolubSVD]"
));
79
Props
.append(
new
Property
(
"relaxTSR"
,
"no"
,
false
,
80
QObject::tr(
"relax time step raster"
)+
" [no, yes]"
));
81
Props
.append(
new
Property
(
"initialDC"
,
"yes"
,
false
,
82
QObject::tr(
"perform an initial DC analysis"
)+
" [yes, no]"
));
83
Props
.append(
new
Property
(
"MaxStep"
,
"0"
,
false
,
84
QObject::tr(
"maximum step size in seconds"
)));
85
}
86
87
TR_Sim::~TR_Sim
()
88
{
89
}
90
91
Component
*
TR_Sim::newOne
()
92
{
93
return
new
TR_Sim
();
94
}
95
96
Element
*
TR_Sim::info
(QString& Name,
char
* &BitmapFile,
bool
getNewOne)
97
{
98
Name = QObject::tr(
"Transient simulation"
);
99
BitmapFile = (
char
*)
"tran"
;
100
101
if
(getNewOne)
return
new
TR_Sim
();
102
return
0;
103
}
104
105
void
TR_Sim::recreate
(
Schematic
*)
106
{
107
Property
*pp =
Props
.first();
108
if
((pp->
Value
==
"list"
) || (pp->
Value
==
"const"
)) {
109
// Call them "Symbol" to omit them in the netlist.
110
pp =
Props
.next();
111
pp->
Name
=
"Symbol"
;
112
pp->
display
=
false
;
113
pp =
Props
.next();
114
pp->
Name
=
"Symbol"
;
115
pp->
display
=
false
;
116
Props
.next()->Name =
"Values"
;
117
}
118
else
{
119
Props
.next()->Name =
"Start"
;
120
Props
.next()->Name =
"Stop"
;
121
Props
.next()->Name =
"Points"
;
122
}
123
}
Element::y1
int y1
Definition:
element.h:153
QucsSettings
tQucsSettings QucsSettings
Definition:
main.cpp:52
Component::tx
int tx
Definition:
component.h:78
Element::y2
int y2
Definition:
element.h:153
Element::x1
int x1
Definition:
element.h:153
TR_Sim::TR_Sim
TR_Sim()
Definition:
tr_sim.cpp:22
Property::display
bool display
Definition:
element.h:99
main.h
Definitions and declarations for the main application.
Component::ty
int ty
Definition:
component.h:78
Property::Value
QString Value
Definition:
element.h:97
Component::Props
Q3PtrList< Property > Props
Definition:
component.h:72
TR_Sim::recreate
void recreate(Schematic *)
Definition:
tr_sim.cpp:105
tr_sim.h
Property
Definition:
element.h:94
Text
Definition:
element.h:82
Component
Definition:
component.h:33
Element
Superclass of all schematic drawing elements.
Definition:
element.h:142
Property::Name
QString Name
Definition:
element.h:97
Component::Name
QString Name
Definition:
component.h:80
Component::Texts
Q3PtrList< Text > Texts
Definition:
component.h:71
Component::Model
QString Model
Definition:
component.h:80
Component::Description
QString Description
Definition:
component.h:81
tQucsSettings::largeFontSize
float largeFontSize
Definition:
main.h:47
Schematic
Definition:
schematic.h:69
TR_Sim::~TR_Sim
~TR_Sim()
Definition:
tr_sim.cpp:87
Element::x2
int x2
Definition:
element.h:153
TR_Sim::info
static Element * info(QString &, char *&, bool getNewOne=false)
Definition:
tr_sim.cpp:96
TR_Sim::newOne
Component * newOne()
Definition:
tr_sim.cpp:91
Generated on Mon Sep 1 2014 20:05:20 for Qucs-GUI by
1.8.6