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.
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
X name (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
Q name (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
P name = value
where value denotes the possible entries mentioned before. If the user specifies the time derivative
DP name = value
SCEPTRE calculates the integral:
P name = ò DP name 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.
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.
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.
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
|Non-Linux FOSS: Seashore||May 10, 2013|
|Trying to Tame the Tablet||May 08, 2013|
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- New Products
- RSS Feeds
- Tech Tip: Really Simple HTTP Server with Python
44 min 17 sec ago
- Automatically updating Guest Additions
1 hour 52 min ago
- I like your topic on android
2 hours 39 min ago
- Reply to comment | Linux Journal
3 hours 30 sec ago
- This is the easiest tutorial
9 hours 15 min ago
- Ahh, the Koolaid.
14 hours 53 min ago
- git-annex assistant
20 hours 53 min ago
- direct cable connection
21 hours 15 min ago
- Agreed on AirDroid. With my
21 hours 25 min ago
- I just learned this
21 hours 30 min ago
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.