# SCEPTRE: Simulation of Nonlinear Electrical Circuits

SCEPTRE is an automatic circuit analysis program capable of determining initial condition, transient, frequency and steady-state response of electrical networks and dynamic systems. It is considered a general-purpose tool for engineers and can be used to assist in the design and analysis of various circuits. The problem of interest is described in a free-format, easy-to-learn, engineer-oriented language. The basic set of network elements consists of linear and nonlinear resistors, capacitors, inductors, voltage and current sources, and mutual inductances.

In addition, SCEPTRE has a “Defined Parameter” mode allowing it to solve state equations, which might be written to describe non-electrical systems. This outstanding feature allows the user to couple electrical networks with differential equation systems giving a great deal of versatility, especially for interdisciplinary problems like mechatronics.

If the problem of interest cannot be described by the built-in functions, the user can describe his problem as an ultima ratio via a FORTRAN program. The program uses the state variable method. Other highlights are the model library, reruns with automatic varied network quantities, extended DC options (sensitivity, worst-case, Monte Carlo, optimization), and several integration routines for accurate and fast solution of even “stiff” problems.

To give the uninitiated some idea of the input data required to accommodate a simple but practical problem, consider the electrical schematic of the Darlington pair in Figure 1. The SCEPTRE version of the circuit appears in Figure 2 with the assumption that a transistor equivalent circuit named 2N706A has been stored in the model library at some previous time.

The problem is to determine the output voltages across R3 and R4 and the power requirements of this circuit under nominal conditions and after the current gain of the first-stage transistor has been degraded to various levels. Defined Parameters will be used to calculate the power consumption (PEC, PEIN). The rerun feature accommodates the additional runs required for the degraded alpha version (P1T1). The SCEPTRE input is shown in Listing 1.

This section describes the preparation of circuits and the basics of the circuit description language for better understanding of the examples.

**Circuit Preparation**

Assuming the user wants to analyse an electric circuit, the following steps should be considered:

Draw an equivalent circuit consisting of resistors, capacitors, inductors, mutual inductances, voltage sources, current sources or models containing these elements. All of these elements may be linear or nonlinear.

Assign to each node an arbitrary alphanumeric name.

Give each element in the circuit a unique name, where the first character classifies the component according to Table 1.

Choose a consistent set of parameter units. SCEPTRE assumes no set of units for the element values. It operates directly on the numbers supplied by the user. For numerical reasons, users should select a set of units so that the voltage and current responses expected in the solution are as close to unity as possible. A consistent set of units is one which satisfies the following equations simultaneously: U = I R, t = R C = L/R.

Choose an arbitrary current flow in each passive circuit element, indicate the direction of positive current flow in each current source and voltage source.

SCEPTRE statements are entered under major headings and subheadings. The most important headings used are the following:

MODEL DESCRIPTION CIRCUIT DESCRIPTION ELEMENTS DEFINED PARAMETERS OUTPUTS FUNCTIONS RERUN DESCRIPTION END

The actual problem is described under the major heading
**CIRCUIT DESCRIPTION**. For the temporary
definition or permanent storage of models, the corresponding input
data go under the heading **MODEL DESCRIPTION**. The
**RERUN DESCRIPTION** heading is always used
whenever the rerun feature is exercised. All changes to the master
network must appear under this heading.

The network topology of a circuit must be written under the
subheading **ELEMENTS** in the general form:

element,fromnode-tonode=value

in case of mutual inductances:

M...,Lname1-Lname2=value

*value* may be a number, defined parameter,
reference to a table, mathematical expression using any intrinsic
FORTRAN function, reference to a statement function or user-defined
FORTRAN function.

Controlled sources (**E**...,
**J**...) may depend on any circuit quantity
(linearly dependent sources). Mainly for the analysis of
semiconductor devices, current sources may depend on diode tables
or built-in diode equations (primary dependent current sources) or
even on other primary dependent current sources (secondary
dependent current sources). In this way, the simulation is carried
out in a cost-effective manner. SCEPTRE determines the correct
sequence for the circuit calculation to avoid computational delays
normally introduced by these nonlinearities. The controlled sources
will run in an AC analysis without modification.

For the Monte Carlo, worst-case and optimization calculations, resistors and sources may be provided by bounds.

Mathematical expressions are entered in two ways. The direct way has the general form

Xname(mathematical_definition)

and is preferred when handling an equation, which is used only by a single reference. Using the mathematical sequence for several purposes, the equation form

Qname(par1,par2, ... ) = ( ... )

is the more efficient way. It serves as a statement function and
must be entered under the subheading **FUNCTIONS**.

The same subheading holds the table entries. Data are entered as point pairs with the independent variable in increasing algebraic order. To produce step functions, it is permissible to supply two consecutive independent-variable values that are equal but have different dependent-variable values.

Reference to an element voltage and element current is
accomplished by prefixing the element name with the single
character **V** and **I**,
respectively. These references may be used as output variables
under the subheading **OUTPUTS**, expressions,
equations, tables and defined parameters. One of the most powerful
features in SCEPTRE is the user-defined parameters under the
subheading **DEFINED PARAMETERS**. The general form
is

Pname=value

where value denotes the possible entries mentioned before. If the user specifies the time derivative

DPname=value

SCEPTRE calculates the integral:

Pname= ò DPname dt

This allows the solution of simultaneous differential equations,
which need not be coupled to any network quantity. By canonical
substitution, transfer functions to any order can be evaluated.
Thus, the subheading **ELEMENTS** is not mandatory.
For the AC analysis, the defined parameters may be complex-valued.

A variety of run controls can be entered under the subheading
**RUN CONTROLS** and used to control the simulation
to a fine degree.

**Simulation**

The simulation is carried out in two phases. In the first phase, SCEPTRE analyses the input data and, if the input statements are free of errors, generates the appropriate FORTRAN subroutines which solve the network equations. In the second phase, these subroutines are compiled and linked with modules from the SCEPTRE library and eventually with user-defined routines. Finally, the binary to be executed contains only those modules needed by the actual problem. Moreover, the working buffers are dimensioned accordingly.

During execution, the actual simulation time (or frequency in the AC analysis) with the requested output quantities is monitored (no graphics), but may be suppressed to considerably speed up the simulation. The results are written into a direct access file.

A postprocessor called NGP is available, which reads the direct access file and enables the user to select the requested quantities. NGP then calls GNUPLOT for the final graphical representation.

Despite its apparent complexity, to get full use of SCEPTRE, only a text editor is needed along with two system commands to start the simulation and the postprocessing.

**Program Organization**

It was the intention of the author to keep the organization of SCEPTRE as simple as possible without losing its power. The shell scripts for SCEPTRE and NGP, which control the flow of all actions, are kept simple, allowing the user to modify them according to his requirements. NGP comes with the source code. Thus, it is possible to adapt NGP to graphic software other than GNUPLOT. Moreover, the monitoring interface routine, which is called after each time or frequency step, is also available as source and may be modified for on-line graphics.

**Requirements and Availability**

The version of SCEPTRE now available runs under any Linux kernel. It needs a FORTRAN compiler and GNUPLOT. The X11 Window System is not required. The binaries of SCEPTRE, including libraries, NGP (source), auxiliary routines (source), English and German documentation and a set of examples are available at ftp://novilux.fh-friedberg.de/pub/sceptre_linux. The archive also contains a suitable GNUPLOT version and a FORTRAN compiler.

## Trending Topics

Bitcoin on Amazon! Sort of... | Sep 28, 2016 |

Free Today: September Issue of Linux Journal (Retail value: $5.99) | Sep 27, 2016 |

nginx | Sep 27, 2016 |

Epiq Solutions' Sidekiq M.2 | Sep 26, 2016 |

Nativ Disc | Sep 23, 2016 |

Android Browser Security--What You Haven't Been Told | Sep 22, 2016 |

- Free Today: September Issue of Linux Journal (Retail value: $5.99)
- nginx
- Bitcoin on Amazon! Sort of...
- Android Browser Security--What You Haven't Been Told
- Epiq Solutions' Sidekiq M.2
- Identity: Our Last Stand
- Nativ Disc
- The Many Paths to a Solution
- Securing the Programmer
- Tech Tip: Really Simple HTTP Server with Python

## Geek Guides

Pick up any e-commerce web or mobile app today, and you’ll be holding a mashup of interconnected applications and services from a variety of different providers. For instance, when you connect to Amazon’s e-commerce app, cookies, tags and pixels that are monitored by solutions like Exact Target, BazaarVoice, Bing, Shopzilla, Liveramp and Google Tag Manager track every action you take. You’re presented with special offers and coupons based on your viewing and buying patterns. If you find something you want for your birthday, a third party manages your wish list, which you can share through multiple social- media outlets or email to a friend. When you select something to buy, you find yourself presented with similar items as kind suggestions. And when you finally check out, you’re offered the ability to pay with promo codes, gifts cards, PayPal or a variety of credit cards.

Get the Guide
## Comments

## Whoa, 10 year old post!

Whoa, I just saw the date on this post and was quite surprised. No wonder it look somewhat familiar to me, as I was in school right around that time, probably in one of my physics classes.

-Jack