Add spiral and loop inductors

This commit is contained in:
Vadim Kuznetsov 2024-02-24 09:27:26 +03:00
parent 7081075018
commit cd309a99ea
5 changed files with 245 additions and 0 deletions

View File

@ -59,6 +59,8 @@ indq.cpp
capq.cpp
circline.cpp
taperedline.cpp
circularloop.cpp
spiralinductor.cpp
)
SET(COMPONENTS_HDRS
@ -227,6 +229,8 @@ volt_noise.h
vprobe.h
vpulse.h
vrect.h
circularloop.h
spiralinductor.h
)

View File

@ -0,0 +1,77 @@
/*
* circularloop.cpp - Circular loop inductor class implementation
*
* copyright (C) 2016 Andres Martinez-Mera <andresmartinezmera@gmail.com>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this package; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*
*/
#include "extsimkernels/spicecompat.h"
#include "circularloop.h"
circularloop::circularloop()
{
Description = QObject::tr("Printed loop inductor");
//Loop
Arcs.append(new qucs::Arc(-18, -25, 35, 35, -370, 16*230,QPen(Qt::darkBlue,3)));
Lines.append(new qucs::Line(-30, 0, -16, 0,QPen(Qt::darkBlue,4)));
Lines.append(new qucs::Line( 16, 0, 30, 0,QPen(Qt::darkBlue,4)));
Ports.append(new Port(-30, 0));
Ports.append(new Port( 30, 0));
x1 = -30; y1 =-30;
x2 = 30; y2 = 5;
tx = x1;
ty = y1+40;
Model = "CIRCULARLOOP";
Name = "CIRCULARLOOP";
Simulator = spicecompat::simQucsator;
Props.append(new Property("Subst", "Subst1", true,
QObject::tr("Substrate")));
Props.append(new Property("W", "25 um", false,
QObject::tr("Width of line")));
Props.append(new Property("a", "500 um", false,
QObject::tr("Radius")));
Props.append(new Property("Temp", "26.85", false,
QObject::tr("simulation temperature in degree Celsius")));
}
circularloop::~circularloop()
{
}
Component* circularloop::newOne()
{
return new circularloop();
}
Element* circularloop::info(QString& Name, char* &BitmapFile, bool getNewOne)
{
Name = QObject::tr("Circular loop");
BitmapFile = (char *) "circularloop";
if(getNewOne) return new circularloop();
return 0;
}

View File

@ -0,0 +1,38 @@
/*
* circularloop.cpp - Circular loop inductor class definition
*
* copyright (C) 2016 Andres Martinez-Mera <andresmartinezmera@gmail.com>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this package; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*
*/
#ifndef CIRCULARLOOP_H
#define CIRCULARLOOP_H
#include "component.h"
class circularloop : public Component {
public:
circularloop();
~circularloop();
Component* newOne();
static Element* info(QString&, char* &, bool getNewOne=false);
};
#endif

View File

@ -0,0 +1,88 @@
/*
* spiralinductor.cpp - Planar spiral inductor class implementation
*
* copyright (C) 2016 Andres Martinez-Mera <andresmartinezmera@gmail.com>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this package; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*
*/
#include "extsimkernels/spicecompat.h"
#include "spiralinductor.h"
spiralinductor::spiralinductor()
{
Description = QObject::tr("Planar spiral inductor");
//Spiral
Arcs.append(new qucs::Arc(-5, 0, 10, 10, -16*90, 16*180,QPen(Qt::darkBlue,3)));
Arcs.append(new qucs::Arc(-10, -10, 20, 20, 16*90, 16*180,QPen(Qt::darkBlue,3)));
Arcs.append(new qucs::Arc(-15, -10, 30, 30, -16*90, 16*180,QPen(Qt::darkBlue,3)));
Arcs.append(new qucs::Arc(-20, -20, 40, 40, 16*90, 16*180,QPen(Qt::darkBlue,3)));
Arcs.append(new qucs::Arc(-20, -20, 40, 40, 0, 16*90,QPen(Qt::darkBlue,3)));
Lines.append(new qucs::Line(-30, 0, 0, 0,QPen(Qt::black,4)));
Lines.append(new qucs::Line( 20, 0, 30, 0,QPen(Qt::darkBlue,2)));
Ports.append(new Port(-30, 0));
Ports.append(new Port( 30, 0));
x1 = -30; y1 =-25;
x2 = 30; y2 = 25;
tx = x1;
ty = y1+50;
Model = "SPIRALIND";
Name = "SPIRALIND";
Simulator = spicecompat::simQucsator;
Props.append(new Property("Subst", "Subst1", true,
QObject::tr("Substrate")));
Props.append(new Property("Geometry", "Circular", true,
QObject::tr("Spiral type")+
+ "[Circular, Square, Hexagonal, Octogonal]"));
Props.append(new Property("W", "25 um", false,
QObject::tr("Width of line")));
Props.append(new Property("Di", "200 um", false,
QObject::tr("Inner diameter")));
Props.append(new Property("S", "25 um", false,
QObject::tr("Spacing between turns")));
Props.append(new Property("N", "3", false,
QObject::tr("Number of turns")));
Props.append(new Property("Temp", "26.85", false,
QObject::tr("simulation temperature in degree Celsius")));
}
spiralinductor::~spiralinductor()
{
}
Component* spiralinductor::newOne()
{
return new spiralinductor();
}
Element* spiralinductor::info(QString& Name, char* &BitmapFile, bool getNewOne)
{
Name = QObject::tr("Spiral inductor");
BitmapFile = (char *) "spiralinductor";
if(getNewOne) return new spiralinductor();
return 0;
}

View File

@ -0,0 +1,38 @@
/*
* spiralinductor.h - Planar spiral inductor class definition
*
* copyright (C) 2016 Andres Martinez-Mera <andresmartinezmera@gmail.com>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this package; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*
*/
#ifndef SPIRALINDUCTOR_H
#define SPIRALINDUCTOR_H
#include "component.h"
class spiralinductor : public Component {
public:
spiralinductor();
~spiralinductor();
Component* newOne();
static Element* info(QString&, char* &, bool getNewOne=false);
};
#endif