Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Data Fields | Private Member Functions | Private Attributes
qucs::e_trsolver Class Reference

External interface class for transient simulation. More...

#include <e_trsolver.h>

Inheritance diagram for qucs::e_trsolver:
qucs::trsolver qucs::nasolver< nr_type_t > qucs::states< state_type_t > qucs::analysis qucs::object

Public Member Functions

 ACREATOR (e_trsolver)
 
 e_trsolver (char *)
 
 e_trsolver (e_trsolver &)
 
 ~e_trsolver ()
 
int init (nr_double_t, nr_double_t, int)
 
bool isExternal ()
 informs whether this is an external sim More...
 
int stepsolve_sync (nr_double_t synctime)
 
void acceptstep_sync (void)
 
int stepsolve_async (nr_double_t steptime)
 
void acceptstep_async (void)
 
void rejectstep_async (void)
 
void getsolution (double *)
 
int setECVSVoltage (char *ecvsname, nr_double_t V)
 Sets the voltage of an exterally controlled voltage source. More...
 
int getJacRows ()
 Returns the number of rows in the Jacobian matrix for the circuit. More...
 
int getJacCols ()
 Returns the number of columns in the Jacobian matrix for the circuit. More...
 
void getJacData (int r, int c, nr_double_t &data)
 Obtains the data from the Jacobian matrix for the circuit. More...
 
int getNodeV (char *label, nr_double_t &nodeV)
 Obtains the voltage of a node by name. More...
 
int getVProbeV (char *probename, nr_double_t &probeV)
 Obtains the voltage reported by a voltage probe. More...
 
int getIProbeI (char *probename, nr_double_t &probeI)
 Obtains the current reported by a current probe. More...
 
void debug (void)
 
void printx (void)
 
- Public Member Functions inherited from qucs::trsolver
 ACREATOR (trsolver)
 
 trsolver (char *)
 
 trsolver (trsolver &)
 
 ~trsolver ()
 
int solve (void)
 placehoder for solution function More...
 
int predictor (void)
 
int corrector (void)
 
void nextStates (void)
 
void fillStates (void)
 
void setMode (int)
 
void setDelta (void)
 
void adjustDelta (nr_double_t)
 
void adjustOrder (int reduce=0)
 
void initTR (void)
 
void deinitTR (void)
 
void restart (void)
 
void initDC (void)
 
void initSteps (void)
 
void saveAllResults (nr_double_t)
 
nr_double_t checkDelta (void)
 
void updateCoefficients (nr_double_t)
 
void initHistory (nr_double_t)
 
void updateHistory (nr_double_t)
 
void saveHistory (circuit *)
 
void predictBashford (void)
 
void predictEuler (void)
 
void predictGear (void)
 
void initCircuitTR (circuit *)
 
void fillSolution (tvector< nr_double_t > *)
 
int dcAnalysis (void)
 
- Public Member Functions inherited from qucs::nasolver< nr_type_t >
 nasolver ()
 
 nasolver (char *)
 
 nasolver (nasolver &)
 
 ~nasolver ()
 
int solve_once (void)
 
int solve_nonlinear (void)
 
int solve_nonlinear_continuation_gMin (void)
 
int solve_nonlinear_continuation_Source (void)
 
int solve_linear (void)
 
void solve_pre (void)
 
void solve_post (void)
 
void setDescription (const char *n)
 
const char * getDescription (void)
 
void saveResults (const char *, const char *, int, qucs::vector *f=NULL)
 
void setCalculation (calculate_func_t f)
 
void calculate (void)
 
const char * getHelperDescription (void)
 
int getN ()
 Returns the number of node voltages in the circuit. More...
 
int getM ()
 Returns the number of branch currents in the circuit. More...
 
- Public Member Functions inherited from qucs::analysis
 analysis ()
 Constructor (Unnamed) More...
 
 analysis (char *)
 
 analysis (analysis &)
 
 ~analysis ()
 Destructor. More...
 
virtual int initialize (void)
 placehoder for initialization function More...
 
virtual int cleanup (void)
 placehoder for cleanup function More...
 
dataset * getData (void)
 
void setData (dataset *d)
 
net * getNet (void)
 
void setNet (net *netlist)
 
environment * getEnv (void)
 
void setEnv (environment *e)
 
ptrlist< analysis > * getAnalysis (void)
 
void setAnalysis (ptrlist< analysis > *a)
 
void addAnalysis (analysis *)
 
void delAnalysis (analysis *)
 
int getType (void)
 
void setType (int t)
 
sweep * createSweep (const char *)
 create a named sweep object More...
 
void saveVariable (const char *, nr_complex_t, qucs::vector *)
 Save variable into analysis dataset. More...
 
bool getProgress (void)
 get More...
 
void setProgress (bool p)
 Sets the progress. More...
 
- Public Member Functions inherited from qucs::object
 object ()
 
 object (const char *)
 
 object (const object &)
 
virtual ~object ()
 
objectgetNext (void)
 
void setNext (object *o)
 
objectgetPrev (void)
 
void setPrev (object *o)
 
void setName (const char *)
 
char * getName (void)
 
void addProperty (property *)
 
propertyaddProperty (const char *, const char *)
 
propertyaddProperty (const char *, nr_double_t)
 
propertyaddProperty (const char *, variable *)
 
void setProperty (const char *, char *)
 
void setProperty (const char *, nr_double_t)
 
void setScaledProperty (const char *, nr_double_t)
 
void setProperty (const char *, variable *)
 
vectorgetPropertyVector (const char *)
 
char * getPropertyString (const char *)
 
char * getPropertyReference (const char *)
 
nr_double_t getPropertyDouble (const char *)
 
nr_double_t getScaledProperty (const char *)
 
int getPropertyInteger (const char *)
 
bool hasProperty (const char *)
 
bool isPropertyGiven (const char *)
 
void copyProperties (property *)
 
void deleteProperties (void)
 
int countProperties (void)
 
char * propertyList (void)
 
 object ()
 
 object (const char *)
 
 object (const object &)
 
virtual ~object ()
 
objectgetNext (void)
 
void setNext (object *o)
 
objectgetPrev (void)
 
void setPrev (object *o)
 
void setName (const char *)
 
char * getName (void)
 
void addProperty (property *)
 
propertyaddProperty (const char *, const char *)
 
propertyaddProperty (const char *, nr_double_t)
 
propertyaddProperty (const char *, variable *)
 
void setProperty (const char *, char *)
 
void setProperty (const char *, nr_double_t)
 
void setScaledProperty (const char *, nr_double_t)
 
void setProperty (const char *, variable *)
 
vectorgetPropertyVector (const char *)
 
char * getPropertyString (const char *)
 
char * getPropertyReference (const char *)
 
nr_double_t getPropertyDouble (const char *)
 
nr_double_t getScaledProperty (const char *)
 
int getPropertyInteger (const char *)
 
bool hasProperty (const char *)
 
bool isPropertyGiven (const char *)
 
void copyProperties (property *)
 
void deleteProperties (void)
 
int countProperties (void)
 
char * propertyList (void)
 
- Public Member Functions inherited from qucs::states< state_type_t >
 states ()
 
 states (const states &)
 
 ~states ()
 
state_type_t getState (int, int n=0)
 
void setState (int, state_type_t, int n=0)
 
void initStates (void)
 
void clearStates (void)
 
int getStates (void)
 
void setStates (int n)
 
void nextState (void)
 
void prevState (void)
 
void fillState (int, state_type_t)
 
void saveState (int, state_type_t *)
 
void inputState (int, state_type_t *)
 

Data Fields

 ETR
 
 PROP_ACTION
 
 PROP_NO_SUBSTRATE
 
 PROP_LINEAR
 
void(* messagefcn )(int level, const char *format,...)
 Pointer to function used to print messages during a sim. More...
 
- Data Fields inherited from qucs::trsolver
 TR
 
 PROP_ACTION
 
 PROP_NO_SUBSTRATE
 
 PROP_LINEAR
 

Private Member Functions

void initETR (nr_double_t start, nr_double_t, int)
 
void truncateHistory (nr_double_t)
 
void updateExternalInterpTime (nr_double_t)
 
void storeHistoryAges (void)
 
void updateHistoryAges (nr_double_t)
 
void adjustDelta_sync (nr_double_t)
 
void restoreSolution (void)
 
void copySolution (tvector< nr_double_t > *[8], tvector< nr_double_t > *[8])
 
void fillLastSolution (tvector< nr_double_t > *)
 

Private Attributes

int MaxIterations
 
nr_double_t reltol
 
nr_double_t abstol
 
nr_double_t vntol
 
nr_double_t time
 
nr_double_t saveCurrent
 
nr_double_t lastsynctime
 
int running
 
int rejected
 
int convError
 
std::vector< nr_double_t > initialhistages
 
tvector< nr_double_t > * lastsolution [8]
 
nr_double_t lastasynctime
 
nr_double_t lastdeltas [8]
 
nr_double_t lastdelta
 

Additional Inherited Members

- Public Types inherited from qucs::nasolver< nr_type_t >
typedef void(* calculate_func_t )(nasolver< nr_type_t > *)
 
- Static Public Member Functions inherited from qucs::trsolver
static void calcTR (trsolver *)
 
static void calcDC (trsolver *)
 
- Protected Member Functions inherited from qucs::nasolver< nr_type_t >
void restartNR (void)
 
void savePreviousIteration (void)
 
void restorePreviousIteration (void)
 
int countNodes (void)
 
int getNodeNr (char *)
 
int findAssignedNode (circuit *, int)
 
int countVoltageSources (void)
 
void saveSolution (void)
 
circuitfindVoltageSource (int)
 
void applyNodeset (bool nokeep=true)
 
void createNoiseMatrix (void)
 
void runMNA (void)
 
void createMatrix (void)
 
void storeSolution (void)
 
void recallSolution (void)
 
int checkConvergence (void)
 
- Protected Attributes inherited from qucs::trsolver
sweepswp
 
nr_double_t predCoeff [8]
 
nr_double_t corrCoeff [8]
 
nr_double_t deltas [8]
 
nr_double_t delta
 
nr_double_t deltaMax
 
nr_double_t deltaMin
 
nr_double_t deltaOld
 
nr_double_t stepDelta
 
int CMethod
 
int PMethod
 
int corrMaxOrder
 
int predMaxOrder
 
int corrType
 
int predType
 
int corrOrder
 
int predOrder
 
int rejected
 
int converged
 
tvector< nr_double_t > * solution [8]
 
nr_double_t current
 
int statSteps
 
int statRejected
 
int statIterations
 
int statConvergence
 
historytHistory
 
bool relaxTSR
 
bool initialDC
 
- Protected Attributes inherited from qucs::nasolver< nr_type_t >
tvector< nr_type_t > * z
 
tvector< nr_type_t > * x
 
tvector< nr_type_t > * xprev
 
tvector< nr_type_t > * zprev
 
tmatrix< nr_type_t > * A
 
tmatrix< nr_type_t > * C
 
int iterations
 
int convHelper
 
int fixpoint
 
int eqnAlgo
 
int updateMatrix
 
nr_double_t gMin
 
nr_double_t srcFactor
 
const char * desc
 
nodelistnlist
 
- Protected Attributes inherited from qucs::analysis
int runs
 
int type
 
net * subnet
 
dataset * data
 
environment * env
 
ptrlist< analysis > * actions
 
bool progress
 

Detailed Description

External interface class for transient simulation.

This class provides access to the transient solving functionality of Qucs for external software.

Definition at line 1104 of file e_trsolver.cpp.

Constructor & Destructor Documentation

qucs::e_trsolver::e_trsolver ( char *  n)

Definition at line 107 of file e_trsolver.cpp.

qucs::e_trsolver::e_trsolver ( e_trsolver o)

Definition at line 151 of file e_trsolver.cpp.

qucs::e_trsolver::~e_trsolver ( )

Definition at line 124 of file e_trsolver.cpp.

Member Function Documentation

void qucs::e_trsolver::acceptstep_async ( void  )

Definition at line 780 of file e_trsolver.cpp.

void qucs::e_trsolver::acceptstep_sync ( void  )

Definition at line 507 of file e_trsolver.cpp.

qucs::e_trsolver::ACREATOR ( e_trsolver  )
void qucs::e_trsolver::adjustDelta_sync ( nr_double_t  t)
private

Definition at line 555 of file e_trsolver.cpp.

void qucs::e_trsolver::copySolution ( tvector< nr_double_t > *  src[8],
tvector< nr_double_t > *  dest[8] 
)
private

Definition at line 826 of file e_trsolver.cpp.

void qucs::e_trsolver::debug ( void  )

Definition at line 161 of file e_trsolver.cpp.

void qucs::e_trsolver::fillLastSolution ( tvector< nr_double_t > *  s)
private

Definition at line 285 of file e_trsolver.cpp.

int qucs::e_trsolver::getIProbeI ( char *  probename,
nr_double_t &  probeI 
)

Obtains the current reported by a current probe.

Parameters
probenamePointer to character array containing the name of the probe
probeIReference to nr_double_t in which the current will be returned
Returns
Integer flag reporting success or failure

This method searches for the current probe with the given name in probename. If the probe exists, the value of the probe current is copied to probeI. Returns 0 if the probe with the given name was found and -1 otherwise.

Definition at line 949 of file e_trsolver.cpp.

int qucs::e_trsolver::getJacCols ( )

Returns the number of columns in the Jacobian matrix for the circuit.

Definition at line 1066 of file e_trsolver.cpp.

void qucs::e_trsolver::getJacData ( int  r,
int  c,
nr_double_t &  data 
)

Obtains the data from the Jacobian matrix for the circuit.

Parameters
rPointer to character array containing the name of the voltage
cReference to nr_double_t in which the node voltage will be returned
Returns
The Jacobian matrix data at the specified location.

Definition at line 1071 of file e_trsolver.cpp.

int qucs::e_trsolver::getJacRows ( )

Returns the number of rows in the Jacobian matrix for the circuit.

Definition at line 1061 of file e_trsolver.cpp.

int qucs::e_trsolver::getNodeV ( char *  label,
nr_double_t &  nodeV 
)

Obtains the voltage of a node by name.

Parameters
labelPointer to character array containing the name of the voltage
nodeVReference to nr_double_t in which the node voltage will be returned
Returns
Integer flag reporting success or failure

This method searches for the node with the given name in label. If the node exists, the value of the voltage at that node is copied to nodeV. Returns 0 if the node was found, and -1 otherwise.

Definition at line 887 of file e_trsolver.cpp.

void qucs::e_trsolver::getsolution ( double *  lastsol)

Definition at line 873 of file e_trsolver.cpp.

int qucs::e_trsolver::getVProbeV ( char *  probename,
nr_double_t &  probeV 
)

Obtains the voltage reported by a voltage probe.

Parameters
probenamePointer to character array containing the name of the probe
probeVReference to nr_double_t in which the node voltage will be returned
Returns
Integer flag reporting success or failure

This method searches for the voltage probe with the given name in probename. If the probe exists, the value of the probe voltage is copied to probeV. Returns 0 if the probe with the given name was found and -1 otherwise.

Definition at line 903 of file e_trsolver.cpp.

int qucs::e_trsolver::init ( nr_double_t  start,
nr_double_t  firstdelta,
int  mode 
)

Definition at line 180 of file e_trsolver.cpp.

void qucs::e_trsolver::initETR ( nr_double_t  start,
nr_double_t  firstdelta,
int  mode 
)
private

Definition at line 292 of file e_trsolver.cpp.

bool qucs::e_trsolver::isExternal ( void  )
inlinevirtual

informs whether this is an external sim

External simulations will be ignored by qucsator. This function is used to determine whether the analysis is external or not.

Reimplemented from qucs::analysis.

Definition at line 66 of file e_trsolver.h.

void qucs::e_trsolver::printx ( void  )

Definition at line 370 of file e_trsolver.cpp.

void qucs::e_trsolver::rejectstep_async ( void  )

Definition at line 798 of file e_trsolver.cpp.

void qucs::e_trsolver::restoreSolution ( void  )
private
int qucs::e_trsolver::setECVSVoltage ( char *  ecvsname,
nr_double_t  V 
)

Sets the voltage of an exterally controlled voltage source.

Parameters
ecvsnameThe name of the voltage source to be set.
VNew value of the voltage.
Returns
Integer flag reporting success or failure.

This method searches for the ecvs component with the given name in ecvsname. If the ecvs exists, the value of the voltage to be set at the next time step is set to the supplied value in V.

You can set the voltage of ecvs components in subcircuits created by using a name up of the subcircuit heirarchy it is in, e.g. the name

SUBtop.SUBlower.ECVS1

to set the voltage of an ecvs named ECVS1 which is located in subcircuit SUBlower, which is itself in subcircuit SUBtop in the top level circuit.

Returns 0 if the ecvs was found, and -1 otherwise.

Definition at line 990 of file e_trsolver.cpp.

int qucs::e_trsolver::stepsolve_async ( nr_double_t  steptime)

Definition at line 637 of file e_trsolver.cpp.

int qucs::e_trsolver::stepsolve_sync ( nr_double_t  synctime)

Definition at line 407 of file e_trsolver.cpp.

void qucs::e_trsolver::storeHistoryAges ( void  )
private

Definition at line 272 of file e_trsolver.cpp.

void qucs::e_trsolver::truncateHistory ( nr_double_t  t)
private

Definition at line 1051 of file e_trsolver.cpp.

void qucs::e_trsolver::updateExternalInterpTime ( nr_double_t  t)
private

Definition at line 1031 of file e_trsolver.cpp.

void qucs::e_trsolver::updateHistoryAges ( nr_double_t  newage)
private

Definition at line 840 of file e_trsolver.cpp.

Field Documentation

nr_double_t qucs::e_trsolver::abstol
private

Definition at line 175 of file e_trsolver.h.

int qucs::e_trsolver::convError
private

Definition at line 182 of file e_trsolver.h.

qucs::e_trsolver::ETR

Definition at line 1105 of file e_trsolver.cpp.

std::vector<nr_double_t> qucs::e_trsolver::initialhistages
private

Definition at line 197 of file e_trsolver.h.

nr_double_t qucs::e_trsolver::lastasynctime
private

Definition at line 199 of file e_trsolver.h.

nr_double_t qucs::e_trsolver::lastdelta
private

Definition at line 201 of file e_trsolver.h.

nr_double_t qucs::e_trsolver::lastdeltas[8]
private

Definition at line 200 of file e_trsolver.h.

tvector<nr_double_t>* qucs::e_trsolver::lastsolution[8]
private

Definition at line 198 of file e_trsolver.h.

nr_double_t qucs::e_trsolver::lastsynctime
private

Definition at line 179 of file e_trsolver.h.

int qucs::e_trsolver::MaxIterations
private

Definition at line 173 of file e_trsolver.h.

void(* qucs::e_trsolver::messagefcn)(int level, const char *format,...)

Pointer to function used to print messages during a sim.

Parameters
levelInter flag indicating the log level
formatFormatting string in the same format as printf
...Additional arguments to the printing function

By default this points to the standard Qucs logprint function (found in logging.c) on creation of an e_trsolver instance. The log level flag indicates whether the message is a status update or an error message. format contains the formatting string in the same style as printf (when using logprint). The additional arguments are used by logprint in the supplied formatting string.

Definition at line 169 of file e_trsolver.h.

qucs::e_trsolver::PROP_ACTION

Definition at line 1105 of file e_trsolver.cpp.

qucs::e_trsolver::PROP_LINEAR

Definition at line 1105 of file e_trsolver.cpp.

qucs::e_trsolver::PROP_NO_SUBSTRATE

Definition at line 1105 of file e_trsolver.cpp.

int qucs::e_trsolver::rejected
private

Definition at line 181 of file e_trsolver.h.

nr_double_t qucs::e_trsolver::reltol
private

Definition at line 174 of file e_trsolver.h.

int qucs::e_trsolver::running
private

Definition at line 180 of file e_trsolver.h.

nr_double_t qucs::e_trsolver::saveCurrent
private

Definition at line 178 of file e_trsolver.h.

nr_double_t qucs::e_trsolver::time
private

Definition at line 177 of file e_trsolver.h.

nr_double_t qucs::e_trsolver::vntol
private

Definition at line 176 of file e_trsolver.h.


The documentation for this class was generated from the following files: