The function of a circuit can be expressed as a polynomial using a Taylor series expansion [14] in terms of two input voltages Vin1, Vin2, about the point Vin1 = 0 and Vin2 = 0 as follows:
\(\begin{gathered} {{\text{V}}_{out}}{\text{=}}f({{\text{V}}_{in1}},{{\text{V}}_{in2}})=f(0,0)+{f_x}(0,0){{\text{V}}_{in1}}+{f_y}(0,0).{{\text{V}}_{in2}}+\frac{1}{{2!}}[{f_{xx}}(0,0).{{\text{V}}_{in1}}^{2} \hfill \\ +2{f_{xy}}(0,0).{{\text{V}}_{in1}}.{{\text{V}}_{in2}}+{f_{yy}}(0,0).{{\text{V}}_{in2}}^{2}]+.....{\text{ }}(1) \hfill \\ \end{gathered}\) where f(x,y) is a real function of x and y.
Ignoring the higher order terms in (1), we can expand Vout up to some nth power of Vin1, Vin2, which gives us the approximation in (2).
\({{\text{V}}_{out}}{\text{=}}{{\text{a}}_0}+\sum\limits_{{k=1}}^{n} {\sum\limits_{{i=0}}^{k} {{a_{ki}}{{\text{V}}_{in1}}^{{k - i}}{{\text{V}}_{in2}}^{i}} +} \varepsilon {\text{ }}\) (2)
Where a0, aki are real valued coefficients ∀ i = 0 to k and ∀ k = 1 to n. ε is the truncation error.
The coefficients aki’s are real functions of circuit parameters, e.g. resistances, capacitances etc. The coefficients aki’s in Eq. (2) cannot be exact to that of Eq. (1), as Eq. (2) comprises only a finite number of terms for what is essentially a truncated Taylor series. Eq. (2) is a linear regression model that describes the relationship between circuit output voltage Vout and two input voltages Vin1, Vin2. Judicious selection of the coefficients a0 and aki’s of a polynomial regression model in (2) using traditional linear least squares techniques minimizes truncation error ε. The accuracy of regression model depends on the degree of the polynomial expansion used in practice. The traditional methods in MATLAB to estimate a linear regression model are already discussed in [15]. In this work, MATLAB Polyfitn library [16] is used to solve the coefficients of a polynomial regression model using classical linear least square techniques. Several numerical methods are used to implement Polyfitn library. However, to obtain a more stable solution, reasonably efficient QR factorization with pivoting [17] is introduced to build Polyfitn library. Any analog circuit in general can be represented using this model. The technique applies equally well to linear and nonlinear circuits.