title: Symbolic circuit analysis
text: # Symbolic circuit analysis
  
  Symbolic circuit analysis is a formal technique of circuit analysis to calculate the behaviour or characteristic of an electric/electronic circuit with the independent variables (time or frequency), the dependent variables (voltages and currents), and (some or all of) the circuit elements represented by symbols.
  
  When analysing electric/electronic circuits, we may ask two types of questions: What is the value of certain circuit variable (voltage, current, resistance, gain, etc.) or what is the relationship between some circuit variables or between a circuit variable and circuit components and frequency (or time). Such relationship may take the form of a graph, where numerical values of a circuit variable are plotted versus frequency or component value (the most common example would be a plot of the magnitude of a transfer function vs. frequency).
  
  Symbolic circuit analysis is concerned with obtaining those relationships in symbolic form, i.e., in the form of analytical expression, where the complex frequency (or time) and some or all of the circuit components are represented by symbols.
  
  ## Frequency domain expressions
  
  In the frequency domain the most common task of symbolic circuit analysis is to obtain the relationship between input and output variables in the form of a rational function in the complex frequency ${\mathit {s}}\,$ and symbolic variables $\mathbf {x}$:
  
  $T(s,\mathbf {x} )={\frac {N(s,\mathbf {x} )}{D(s,\mathbf {x} )}}$
  
  The above relationship is often called the network function. For physical systems, $N(s,\mathbf {x} )$ and $D(s,\mathbf {x} )$ are polynomials in ${\mathit {s}}\,$ with real coefficients:
  
  $T(s,\mathbf {x} )={\frac {\displaystyle \sum _{i=0}^{n}a_{i}(\mathbf {x} )s^{i}}{\displaystyle \sum _{i=0}^{m}b_{i}(\mathbf {x} )s^{i}}}=K{\frac {\displaystyle \prod _{i=1}^{n}(s-z_{i}(\mathbf {x} ))}{\displaystyle \prod _{i=1}^{m}(s-p_{i}(\mathbf {x} ))}}$
  
  where $z_{i}(\mathbf {x} )$ are the zeroes and $p_{i}(\mathbf {x} )$ are the poles of the network function; $m\geqslant n$.
  
  While there are several methods for generating coefficients $a_{i}(\mathbf {x} )$ and $b_{i}(\mathbf {x} )$, no technique exists to obtain exact symbolic expressions for poles and zeroes for polynomials of order higher than 5.
  
  ## Types of symbolic network functions
  
  Depending on which parameters are kept as symbols, we may have several different types of symbolic network functions. This is best illustrated on an example. Consider, for instance, the biquad filter circuit with ideal op amps, shown below. We want to obtain a formula for its voltage transmittance (also called the voltage gain) in the frequency domain, ${T_{v}(s)=V_{out}(s)/V_{in}(s)}\,$.
  
  ### Network function with s as the only variable
  
  If the complex frequency ${\mathit {s}}\,$ is the only variable, the formula will look like this (for simplicity we use the numerical values: $R_{i}=i,C_{i}=0.01i\,$):
  
  $T(s)={\frac {3.48s}{13.2s^{2}+1.32s+0.33}}$
  
  ### Semi-symbolic network function
  
  If the complex frequency ${\mathit {s}}\,$ and some circuit variables are kept as symbols (semi-symbolic analysis), the formula may take a form:
  
  ${\begin{aligned}T(s,\mathbf {x} )&={\frac {1.74C_{2}s}{6.6C_{1}C_{2}s^{2}+0.66C_{2}s+0.33}}\\\mathbf {x} &=[C_{1}~C_{2}]\end{aligned}}$
  
  ### Fully symbolic network function
  
  If the complex frequency ${\mathit {s}}\,$ and all circuit variables are symbolic (fully symbolic analysis), the voltage transmittance is given by (here $G_{i}=1/R_{i}\,$):
  
  ${\begin{aligned}T(s,\mathbf {x} )&={\frac {G_{4}G_{6}G_{8}C_{2}s}{G_{6}G_{11}C_{1}C_{2}s^{2}+G_{1}G_{6}G_{11}C_{2}s+G_{2}G_{3}G_{5}G_{11}}}\\\mathbf {x} &=[C_{1}~C_{2}~G_{1}~G_{2}~G_{3}~G_{4}~G_{5}~G_{6}~G_{8}~G_{11}]\end{aligned}}$
  
  All expressions above are extremely useful in obtaining insight into operation of the circuit and understanding how each component contributes to the overall circuit performance. As the circuit size increases, however, the number of terms in such expressions grows exponentially. So, even for relatively simple circuits, the formulae become too long to be of any practical value. One way to deal with this problem is to omit numerically insignificant terms from the symbolic expression, keeping the inevitable error below the predetermined limit.
  
  ### Sequence of Expressions form
  
  Another possibility to shorten the symbolic expression to manageable length is to represent the network function by a sequence of expressions (SoE). Of course, the interpretability of the formula is lost, but this approach is very useful for repetitive numerical calculations. A software package STAINS (Symbolic Two-port Analysis via Internal Node Suppression) has been developed to generate such sequences. There are several types of SoE that can be obtained from STAINS. For example, the compact SoE for $T_{v}(s)\,$ of our biquad is
  
  The above sequence contains fractions. If this is not desirable (when divisions by zero appear, for instance), we may generate a fractionless SoE:
  
  Yet another way to shorten the expression is to factorise polynomials $N(s,\mathbf {x} )$ and $D(s,\mathbf {x} )$. For our example this is very simple and leads to:
  
  For larger circuits, however, factorisation becomes a difficult combinatorial problem and the final result may be impractical for both interpretation and numerical calculations.
  
  