My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hb_sim.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  hb_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 "hb_sim.h"
19 #include "main.h"
20 
21 
23 {
24  Description = QObject::tr("Harmonic balance simulation");
25 
26  QString s = Description;
27  int a = s.findRev(" ");
28  if (a != -1) s[a] = '\n'; // break line before the word "simulation"
29 
30  Texts.append(new Text(0, 0, s.left(a), QPen::darkBlue, QucsSettings.largeFontSize));
31  if (a != -1)
32  Texts.append(new Text(0, 0, s.mid(a+1), QPen::darkBlue, QucsSettings.largeFontSize));
33 
34  x1 = -10; y1 = -9;
35  x2 = x1+163; y2 = y1+59;
36 
37  tx = 0;
38  ty = y2+1;
39  Model = ".HB";
40  Name = "HB";
41 
42  Props.append(new Property("f", "1 GHz", false,
43  QObject::tr("frequency in Hertz")));
44  Props.append(new Property("n", "4", true,
45  QObject::tr("number of harmonics")));
46  Props.append(new Property("iabstol", "1 pA", false,
47  QObject::tr("absolute tolerance for currents")));
48  Props.append(new Property("vabstol", "1 uV", false,
49  QObject::tr("absolute tolerance for voltages")));
50  Props.append(new Property("reltol", "0.001", false,
51  QObject::tr("relative tolerance for convergence")));
52  Props.append(new Property("MaxIter", "150", false,
53  QObject::tr("maximum number of iterations until error")));
54 }
55 
57 {
58 }
59 
61 {
62  return new HB_Sim();
63 }
64 
65 Element* HB_Sim::info(QString& Name, char* &BitmapFile, bool getNewOne)
66 {
67  Name = QObject::tr("Harmonic balance");
68  BitmapFile = (char *) "hb";
69 
70  if(getNewOne) return new HB_Sim();
71  return 0;
72 }