• No se han encontrado resultados

Precio que estaría dispuesto a pagar por la libra de carne de conejo

The overall design objectives that guide the development of a general circuit analysis program are discussed below.

A general simulation code should be capable of performing the following analyses:

(1) steady-state non-linear DC, (2) steady-state small-signal AC and (3) transient non-linear.

Additional capabilities built into the code might include the following.

(1) The program should have a convenient and simple input language to describe the circuit topology and element types, values and behavioural information. This language should also describe the analysis options required, the format of the output data and the time or frequency range over which this output is to be printed or plotted. No special knowledge of the computational technique should be required by the user to enter this information.

(2) The program should contain built-in models of the most commonly-encountered circuit elements such as MOSFETs, diodes, etc.

Furthermore, the user must be able to define new models to the program.

(3) For complete generality, the program must be able to accomodate non-linear and time-varying elements such as transistors, switches, saturable magnetics, gas discharge devices, etc. The models describing these elements will be either graphic, numerical, piece-wise linear (stored in look-up tables) or analytic.

(4) In addition to the DC, AC and transient analyses listed above, there should be a wide range of output options available. These might include transfer functions, poles and zeros, magnitude and phase response, etc. This output data will be in either tabular or graphics form.

(5) The designer should be able to interact with the program such that on obtaining the results of a simulation, the circuit may be modified until the desired results are obtained. Alternatively, the user may wish to study the sensitivity (or tolerance) of each element by parameter modification - these "worst-case" studies remove the need for the breadboard stage in a design. Thus, it is essential that the program has a fast execution time in order to place the designer in the "design feedback loop".

(6) Error checks are necessary in order to assess the reliability of the output.

(7) Finally, the program should have an open-ended, highly-modularised structure to allow the user to modify or extend the capabilities.

2.3.2 APPROACH

This section describes the approach to the development of a general circuit analysis program. A schematic flow diagram of the main program is shown in Figure 2.2. GCAP is written in Turbo Pascal Version 5.5. The subprogram capability allows a modular approach to the problem, where each module can be

refined in the initial development or extended by the user as necessary. In particular, the user-defined function capability permits the inclusion of models of circuit components.

Topological data describing circuit connections are first converted to a form acceptable to the program. If the user is only required to input a component identification name, type and the two (or more) nodal connections, then the program must formulate the fundamental cutset matrix Q from this data alone. An algorithm identifies the maximum and minimum node numbers, and calculates the total numbers of nodes, tree branches and links. A file (COMPl) is compiled consisting of component descriptors (see Section 2.4.2) arranged in ascending order of nodal connection number. An algorithm consisting of ten subprograms is included to classify the fixed topology network branches into a proper tree and generate the f-circuit equations internally. This is achieved by the following method:

(1) Scan COMPl for an independent voltage source.

(2) Eliminate link voltage source if node numbers are duplicated.

(3) Store accepted component descriptors in array ‘BRANCHES’ in ascending order of nodal connection number.

(4) Eliminate duplicated node numbers.

(5) If all nodes are covered and connected then go to (7).

(6) Repeat steps (1) to (5) for capacitances, conductances and reciprocal inductances.

(7) Store remaining descriptors in array ‘LINKS’.

Although this is a complicated procedure, it is only required to be performed at the beginning of a simulation.

The element matrices must be formulated taking account, if necessary, of any non-linearities in the circuit. For this reason, a DC analysis is run to determine the DC operating point of the circuit and the values of these components are calculated under these conditions. By combining these matrices with the fundamental sub-matrix F, derivation of the state matrices is straightforward. Each of these matrices is merely an array of numbers. Throughout this derivation, advantage is taken of the adjustable dimensions of matrices permitted within a subprogram. Once explicit forms of the state matrices A to E in equations (2.1) and (2.2) have been obtained, the user has the option of terminating the simulation with the DC analysis or, more usually, running either an AC, transient or frequency analysis.

A DC analysis is performed automatically prior to a non-linear transient analysis if it is necessary to determine the DC operating point for the initial conditions, and prior to an AC small-signal analysis to determine the small-signal linearised equivalent models of any non-linear devices. A Newton-Raphson algorithm is included to find the DC operating point and is described in Appendix A. An initial guess at the element value under circuit conditions is taken to be half of the usual value. The Newton-Raphson formula is applied and a new value calculated. If a convergence is not achieved within ten steps, then the algorithm terminates and is repeated with a different initial estimate. This is the only analysis that requires changes to the circuit topology as all inductors are replaced by ImQ resistors and all time-varying sources, switches and capacitors are removed. This requires that the fundamental cutset matrix must be recalculated. A DC transfer curve is produced by applying a low-voltage excitation to the input node and monitoring the output at any selected point. An AC small-signal analysis operates on a

fixed set of state matrices describing the linearised circuit resulting from a DC analysis to calculate the response to a fixed magnitude, variable frequency sine wave.

Transient analysis is, in effect, a time domain simulation. Unlike AC analysis, where it is necessary to solve a fixed set of state equations, transient analysis requires that a new set of state equations be dynamically generated at each successive time-step, ie once the circuit has been simulated over one time increment, the state matrices are updated such that x(t), y(t) and u(t) are continuous; the final state in one configuration is the initial state in the subsequent configuration. This demonstrates an important advantage of the state-variable approach, namely its ability to analyse non-linear/time-varying circuits with no additional difficulty. As in the linear, time-invariant case, the state matrices are again derived from a fixed topology. However, in addition to updating these matrices due to the time increment, they are also updated as necessary due to the present state of individual components.

The state equations are solved numerically by means of a Runge-Kutta algorithm and the total, zero-input and zero-state response calculated. The time-step of calculation must be smaller than the smallest characteristic time-constant of the circuit. For this reason, if not specified, GCAP will automatically select the calculation increment by considering the eigenvalues of the dynamical matrix A. The step-value is then one-fifth of the smallest time constant explicit in the A matrix. The extremely stiff differential equations (widely spread time constants) pose a problem. The program continuously monitors the system and if all states remain constant for a time much greater than the calculation increment, then this parameter is increased to reduce

32

computer time. SPICE, on the other hand, formulates the more conventional second order differential equations and iteration is performed until an acceptable convergence is achieved for the transient solution. However, sometimes the program fails to converge and terminates, eg positive feedback circuits have proved to be a problem^. Furthermore, a displayed solution may be wildly incorrect.

Finally, a frequency analysis again operates on a fixed set of state equations. As indicated in Section 2.2.6, conversion to the frequency domain is not essential for solution, but is of immense interest. System poles, zeros and natural frequencies can be calculated together with stability checks and noise studies. Further, the frequency domain is a very useful area for studying feedback systems. GCAP has procedures to calculate closed-loop feedback system response as well as to tailor poles by state feedback.

In all cases, the simulation is performed over a user-specified time-range (for a transient analysis) or frequency-range (for AC and frequency analyses). Unless otherwise specified, the output of data is in tabular form. Alternatively, a graphics subprogram is included to plot these results, again over a user-specified range. Although the time increment and interval of calculation are previously set, the user has control over which data are to be printed or plotted at specified time or frequency points. This avoids the need for GCAP to repeat the entire simulation every time a different parameter is to be displayed.

2.4 GENERALISED CIRCUIT ANALYSIS PROGRAM

Documento similar