Symbolic Circuit Analysis with Analog Insydes

Introduction

Symbolic circuit analysis is known to yield extremely large expressions even for small circuits. To cope with expression complexity Analog Insydes provides special functionality for calculating simplified symbolic formulas which are small and easy to understand. Approximated symbolic expressions are computed by dropping numerically insignificant terms from circuit equations or transfer functions. Consider, for example, the common-emitter small-signal amplifier shown below. We will compute a simplified symbolic transfer function that contains only those terms which have dominant influence on the passband voltage gain.

Common-Emitter Amplifier

Netlist and Models

First, we write a netlist of the circuit, specifying both symbolic and numerical values for the circuit elements. The numerical values are needed later as reference values for deciding on which terms are important and which ones can be neglected.

\(ceamp\  = \ 
\ \ 
      Circuit[
\ \ \ \ 
        Netlist[
\ \ \ \ \ \ {V1, {1, \ 0}, \ Value -> {AC -> 1}}, 
          
\ \ \ \ \ \ {VCC, \ {6, \ 0}, \ Type\  -> \ VoltageSource, \ 
            Value\  -> \ {DC -> 12. }}, 

          \ \ \ \ \ \ {C1, {1, \ 2}, \ Symbolic\  -> \ C1, \ 
            Value\  -> \ 1. *10\^\(-7\)}, 

          \ \ \ \ \ \ {R1, {2, \ 6}, \ Symbolic\  -> \ R1, \ 
            Value\  -> \ 1. *10\^5}, 

          \ \ \ \ \ \ {R2, {2, \ 0}, \ Symbolic\  -> \ R2, \ 
            Value\  -> \ 4.7*10\^4}, 

          \ \ \ \ \ \ {RC, {6, \ 3}, \ Symbolic\  -> \ RC, \ 
            Value\  -> \ 2200. }, 

          \ \ \ \ \ \ {RE, {4, \ 0}, \ Symbolic\  -> \ RE, \ 
            Value\  -> \ 1000. }, 

          \ \ \ \ \ \ {C2, {3, \ 5}, \ Symbolic\  -> \ C2, \ 
            Value\  -> \ 1. *10\^\(-6\)}, 

          \ \ \ \ \ \ {RL, {5, \ 0}, \ Symbolic\  -> \ RL, \ 
            Value\  -> \ 4.7*10\^4}, 

          \ \ \ \ \ \ {
            Q1, {2\  -> \ "B", \ 3\  -> \ "C", \ 
              4\  -> \ "E"}, Model\  -> \ "NPN", \ 
            Selector\  -> \ "AC", RBE\  -> \ 1000. , 
            CBE\  -> \ 3. *10\^\(-11\), \ CBC -> 5. *10\^\(-12\), 
            BETA\  -> \ 200. , \ RO\  -> \ 1. *10\^4}
\ \ \ \ ], 

        
\ \ \ \ 
        Model[
\ \ \ \ \ \ Name\  -> \ "NPN", 
          Selector\  -> \ "AC", 
\ \ \ \ \ \ 
          Ports\  -> \ {"B", \ "C", \ "E"}, 
\ \ \ \ \ \ 
          Parameters\  -> 
            \ {Rbe, \ Cbe, \ Cbc, \ β, \ Ro, \ RBE, \ CBE, \ CBC, \ 
              BETA, RO}, 
\ \ \ \ \ \ 
          Definition\  -> \ 
\ \ \ \ \ \ \ \ 
            Netlist[

              \ \ \ \ \ \ \ \ \ \ {RBE, {"X", \ "E"}, \ 
                Symbolic\  -> \ Rbe, \ Value\  -> \ RBE}, 

              \ \ \ \ \ \ \ \ \ \ {CBE, {"B", "E"}, 
                Symbolic -> Cbe, Value -> CBE}, 

              \ \ \ \ \ \ \ \ \ \ {CBC, {"B", \ "C"}, \ 
                Symbolic\  -> \ Cbc, \ Value\  -> \ CBC}, 

              \ \ \ \ \ \ \ \ \ \ {
                CC, {"B", \ "X", \ "C", \ "E"}, \ 
                Symbolic\  -> \ β, \ Value\  -> \ BETA}, 

              \ \ \ \ \ \ \ \ \ \ {RO, {"C", \ "E"}, \ 
                Symbolic\  -> \ Ro, \ Value\  -> \ RO}

              \ \ \ \ \ \ \ \ ]
\ \ \ \ ]
\ \ ]; 
DisplayForm@ceamp\)

Symbolic Calculations

If we compute the exact symbolic transfer function we obtain an expression with more than 100 terms. This expression yields absolutely no insight into circuit behavior.

ceampmna = CircuitEquations[ceamp, ElementValues -> Symbolic];
DisplayForm @ ceampmna

vout = Together[V$5  /.  First[Solve[ceampmna,  V$5]]]

Length[Denominator[vout]] + Length[Numerator[vout]]

Simplification Before Generation

To find a simple expression for the passband voltage gain we use Analog Insydes' symbolic approximation functionality to approximate the system of circuit equations with respect to a frequency point in the passband (here: f = 1  kHz) and the given numerical element values. We allow for a maximum approximation error of 10% in that point.

\(approxceamp = 
      ApproximateMatrixEquation[ceampmna, V$5, 
        \ {s\  -> \ 2. \ π\ I\ *\ 10\^3, \ 
          MaxError\  -> \ 0.1}]; 
DisplayForm\ @approxceamp\)

voutsimp  =  V$5 /. First[Solve[approxceamp,  V$5]]

Approximation yields a very simple expression for the voltage gain: -RC/RE. To check if this expression is valid we compare it graphically with the exact expression.

designpoint = GetDAEOptions[ceampmna, DesignPoint]

voutexactn[s_] = vout /. designpoint

voutsimpn[s_] = voutsimp  /. designpoint

\(\(BodePlot[

      	{voutexactn[2. \ π\ I\ f], voutsimpn[2. \ π\ I\ f]}, 

      	{f, \ 1. , \ 1.*^9}, 
	MagnitudeDisplay\  -> \ Linear, 
	
      PlotRange\  -> \ {{0, \ 2.5}, \ Automatic}
]; \)\)

The above Bode plot shows that the approximated expression matches the original transfer function well within 10% tolerance at 10  kHz. Indeed, -RC/RE is the well-known gain formula for this type of amplifier. With Analog Insydes you can extract this and other design formulas automatically.

Simplification After Generation

While equation-based approximation (SBG) can reduce the complexity of a symbolic expression greatly the result may still contain some insignificant terms. So it is generally a good idea to apply solution-based simplification (SAG) to such a transfer function as well in order to remove the remaining irrelevant contributions. The following example demonstrates the combination of SBG and SAG.

First, we use matrix approximation to compute a reduced-order transfer function of the amplifier which is valid for the passband and also for low frequencies. Therefore, we add a second reference point at 100  Hz to the list of design points.

\(approxceamp2 = 
      ApproximateMatrixEquation[ceampmna, 
        V$5, {{s\  -> \ 2. \ π\ I\ *\ 10\^3, \ 
            MaxError\  -> \ 0.1}, {
            s\  -> \ 2. \ π\ I\ *\ 10\^2, \ 
            MaxError\  -> \ 0.1}}]; \ 
DisplayForm@approxceamp2\)

voutsimp2  =  
      V$5 /. First[Solve[approxceamp2,  V$5]] // Together

Now, we can apply solution-based approximation to compute a simplified transfer function which is more compact than the SAG-only solution and valid over a larger frequency range than the first SBG result.

voutsimp3 = 
      ApproximateTransferFunction[voutsimp2, s, designpoint, 0.1] // Simplify

The above result is very useful because it allows for reading off approximate symbolic expressions for the poles. To calculate these explicitly we must solve the denominator of the transfer function for s:

Solve[Denominator[voutsimp3] == 0, s]

Finally, we plot this simplified transfer function together with the original function to visualize the effects of our low-and-mid-frequency approximation. The Bode plot shows that the approximation is valid from zero frequency to the upper end of the passband at about 1  MHz. High-frequency effects are not described because we did not specify a design point in the frequency region beyond the passband.

voutsimp3n[s_] = voutsimp3  /. designpoint

\(\(BodePlot[

      	{voutexactn[2. \ π\ I\ f], voutsimp3n[2. \ π\ I\ f]}, 

      	{f, \ 1. , \ 1.*^9}, 
	MagnitudeDisplay\  -> \ Linear, 
	
      PlotRange\  -> \ {{0, \ 2.5}, \ Automatic}
]; \)\)

Initialization Cells

Read Mathematica package Analog Insydes:

Off[General::spell,  General::spell1];

\($NotebookDirectory = 
      ToFileName@
        First["FileName" /. NotebookInformation[EvaluationNotebook[]]]; 

    PrependTo[$Path, $NotebookDirectory]; \)

<< AnalogInsydes`;

SetDirectory[$NotebookDirectory];

\(SetOptions[AnalogInsydes, UseExternals -> False]; 

    SetOptions[BodePlot, Background -> RGBColor[1, 1, 1]]; \)

Copyright © 1998-2000 by ITWM e.V.

Analog Insydes
ITWM - Institut für Techno- und Wirtschaftsmathematik e.V.
Gottlieb-Daimler-Str.
D-67663 Kaiserslautern, Germany

Analog Insydes is a trademark of ITWM.
Mathematica is a registered trademark of Wolfram Research, Inc.
All other product names are trademarks of their respective owners.