Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/components/hb_sim.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                           hb_sim.cpp  -  description
00003                              -------------------
00004     begin                : Sat Aug 23 2003
00005     copyright            : (C) 2003 by Michael Margraf
00006     email                : michael.margraf@alumni.tu-berlin.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 #include "hb_sim.h"
00018 #include "main.h"
00019 
00020 
00021 HB_Sim::HB_Sim()
00022 {
00023   Description = QObject::tr("Harmonic balance simulation");
00024 
00025   QString  s = Description;
00026   int a = s.findRev(" ");
00027   if (a != -1) s[a] = '\n';    // break line before the word "simulation"
00028 
00029   Texts.append(new Text(0, 0, s.left(a), Qt::darkBlue, QucsSettings.largeFontSize));
00030   if (a != -1)
00031     Texts.append(new Text(0, 0, s.mid(a+1), Qt::darkBlue, QucsSettings.largeFontSize));
00032 
00033   x1 = -10; y1 = -9;
00034   x2 = x1+163; y2 = y1+59;
00035 
00036   tx = 0;
00037   ty = y2+1;
00038   Model = ".HB";
00039   Name  = "HB";
00040 
00041   Props.append(new Property("f", "1 GHz", false,
00042     QObject::tr("frequency in Hertz")));
00043   Props.append(new Property("n", "4", true,
00044     QObject::tr("number of harmonics")));
00045   Props.append(new Property("iabstol", "1 pA", false,
00046     QObject::tr("absolute tolerance for currents")));
00047   Props.append(new Property("vabstol", "1 uV", false,
00048     QObject::tr("absolute tolerance for voltages")));
00049   Props.append(new Property("reltol", "0.001", false,
00050     QObject::tr("relative tolerance for convergence")));
00051   Props.append(new Property("MaxIter", "150", false,
00052     QObject::tr("maximum number of iterations until error")));
00053 }
00054 
00055 HB_Sim::~HB_Sim()
00056 {
00057 }
00058 
00059 Component* HB_Sim::newOne()
00060 {
00061   return new HB_Sim();
00062 }
00063 
00064 Element* HB_Sim::info(QString& Name, char* &BitmapFile, bool getNewOne)
00065 {
00066   Name = QObject::tr("Harmonic balance");
00067   BitmapFile = (char *) "hb";
00068 
00069   if(getNewOne)  return new HB_Sim();
00070   return 0;
00071 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines