{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Vector Fitting\n", "This is a brief introduction to Vector Fitting. The concept and its algorithm was proposed in 1999 by Bjørn Gustavsen and Adam Semlyen [[1](#link_ref1)]. See the Vector Fitting website for more information [[2](#link_ref2)]. \n", "The main application of Vector Fitting is to model the original sampled frequency responses of an active or passive device in a circuit simulator. Also see the [API documentation](../api/vectorFitting.html) and the [application examples](../examples/index.html#vector-fitting) for more information about the implementation in scikit-rf." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Mathematical Description\n", "The idea of Vector Fitting is to fit a set of rational model functions to a set of sampled frequency responses $\\mathbf{\\underline{H}}_\\mathrm{sampled}$, for example from a [S](https://en.wikipedia.org/wiki/Scattering_parameters), [Y](https://en.wikipedia.org/wiki/Admittance_parameters) or [Z](https://en.wikipedia.org/wiki/Impedance_parameters) matrix. The model function $\\mathbf{\\underline{H}}(\\mathrm{\\underline{s}})$ is defined in the Laplace domain with $\\mathrm{\\underline{s}} = \\sigma + \\mathrm{j} \\omega$:\n", "\\begin{equation}\n", "\\mathbf{\\underline{H}}(\\mathrm{\\underline{s}}) = \\mathbf{d} + \\mathrm{\\underline{s}} \\mathbf{e} + \\sum_{k=1}^K \\frac{\\underline{\\mathbf{c}}_{k}}{\\mathrm{\\underline{s}}-\\underline{p}_k}\n", "\\end{equation}\n", "\n", "For the desired fit, that model function shall match the given frequency responses at each of its frequency samples $\\omega_n$:\n", "\\begin{equation}\n", "\\mathbf{\\underline{H}}(\\mathrm{\\underline{s}} = \\mathrm{j} \\omega_n) \\overset{!}{=} \\mathbf{\\underline{H}}_\\mathrm{sampled}(\\omega_n)\n", "\\end{equation}\n", "\n", "Generally, $\\mathbf{\\underline{H}}(\\mathrm{\\underline{s}})$ is a vector holding the individual complex frequency responses $\\underline{H}_1(\\mathrm{\\underline{s}})$, $\\underline{H}_2(\\mathrm{\\underline{s}})$, ..., $\\underline{H}_M(\\mathrm{\\underline{s}})$ of the model. All elements in $\\mathbf{\\underline{H}}(\\mathrm{\\underline{s}})$ share a common set of complex poles $\\underline{p}_k$, but have individual sets of complex residues $\\mathbf{\\underline{c}}_k$, real constants $\\mathbf{d}$ and real proportional coefficients $\\mathbf{e}$, which are therefore vectors as well:\n", "\\begin{equation}\n", "\\mathbf{\\underline{p}} = \\begin{pmatrix} \\underline{p}_1 & \\underline{p}_2 & \\underline{p}_3 & \\cdots & \\underline{p}_K \\end{pmatrix}\n", "\\end{equation}\n", "\n", "\\begin{equation}\n", "\\mathbf{\\underline{c}} = \\begin{pmatrix} \n", "\\underline{c}_{1,1} & \\underline{c}_{2,1} & \\underline{c}_{3,1} & \\cdots & \\underline{c}_{K,1} \\\\\n", "\\underline{c}_{1,2} & \\underline{c}_{2,2} & \\underline{c}_{3,2} & \\cdots & \\underline{c}_{K,2} \\\\\n", "\\vdots\\\\\n", "\\underline{c}_{1,M} & \\underline{c}_{2,M} & \\underline{c}_{3,M} & \\cdots & \\underline{c}_{K,M} \\\\\n", "\\end{pmatrix}\n", "\\end{equation}\n", "\n", "\\begin{equation}\n", "\\mathbf{d} = \\begin{pmatrix} d_1 \\\\ d_2 \\\\ \\vdots \\\\ d_M \\end{pmatrix}\n", "\\end{equation}\n", "\n", "\\begin{equation}\n", "\\mathbf{e} = \\begin{pmatrix} e_1 \\\\ e_2 \\\\ \\vdots \\\\ e_M \\end{pmatrix}\n", "\\end{equation}\n", "\n", "The number of poles, $K$, required for a good fit of $\\mathbf{\\underline{H}}(\\mathrm{\\underline{s}})$ to $\\mathbf{\\underline{H}}_\\mathrm{sampled}$ depends on the shape of the responses.\n", "\n", "As an example, the goal could be to fit the rational model function to the S matrix of a 2-port ($M = 4$) sampled at $N$ frequencies $\\omega_n$:\n", "\n", "\\begin{equation}\n", "\\begin{pmatrix} \n", "\\underline{S}_{11}(\\omega_1) \\\\\n", "\\underline{S}_{12}(\\omega_1) \\\\\n", "\\underline{S}_{21}(\\omega_1) \\\\\n", "\\underline{S}_{22}(\\omega_1) \\\\\n", "\\vdots \\\\\n", "\\underline{S}_{11}(\\omega_\\mathrm{N}) \\\\\n", "\\underline{S}_{12}(\\omega_\\mathrm{N}) \\\\\n", "\\underline{S}_{21}(\\omega_\\mathrm{N}) \\\\\n", "\\underline{S}_{22}(\\omega_\\mathrm{N})\n", "\\end{pmatrix}\n", "\\overset{!}{=}\n", "\\begin{pmatrix}\n", "d_{11} + \\mathrm{j} \\omega_1 e_{11} + \\sum_{k=1}^K \\frac{\\underline{c}_{k,11}}{\\mathrm{j} \\omega_1 - \\underline{p}_k}\n", "\\\\\n", "d_{12} + \\mathrm{j} \\omega_1 e_{12} + \\sum_{k=1}^K \\frac{\\underline{c}_{k,12}}{\\mathrm{j} \\omega_1 - \\underline{p}_k}\n", "\\\\\n", "d_{21} + \\mathrm{j} \\omega_1 e_{21} + \\sum_{k=1}^K \\frac{\\underline{c}_{k,21}}{\\mathrm{j} \\omega_1 - \\underline{p}_k}\n", "\\\\\n", "d_{22} + \\mathrm{j} \\omega_1 e_{22} + \\sum_{k=1}^K \\frac{\\underline{c}_{k,22}}{\\mathrm{j} \\omega_1 - \\underline{p}_k}\n", "\\\\\n", "\\vdots\n", "\\\\\n", "d_{11} + \\mathrm{j} \\omega_\\mathrm{N} e_{11} + \\sum_{k=1}^K \\frac{\\underline{c}_{k,11}}{\\mathrm{j} \\omega_\\mathrm{N} - \\underline{p}_k}\n", "\\\\\n", "d_{12} + \\mathrm{j} \\omega_\\mathrm{N} e_{12} + \\sum_{k=1}^K \\frac{\\underline{c}_{k,12}}{\\mathrm{j} \\omega_\\mathrm{N} - \\underline{p}_k}\n", "\\\\\n", "d_{21} + \\mathrm{j} \\omega_\\mathrm{N} e_{21} + \\sum_{k=1}^K \\frac{\\underline{c}_{k,21}}{\\mathrm{j} \\omega_\\mathrm{N} - \\underline{p}_k}\n", "\\\\\n", "d_{22} + \\mathrm{j} \\omega_\\mathrm{N} e_{22} + \\sum_{k=1}^K \\frac{\\underline{c}_{k,22}}{\\mathrm{j} \\omega_\\mathrm{N} - \\underline{p}_k}\n", "\\end{pmatrix}\n", "\\end{equation}\n", "\n", "During the Vector Fitting process, the model parameters $\\mathbf{\\underline{p}}$, $\\mathbf{\\underline{c}}$, $\\mathbf{d}$ and $\\mathbf{e}$ will be optimized in an iterative manner until a good fit is achieved." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Equivalent Electrical Circuits\n", "The benefit of Vector Fitting the sampled frequency responses is the easy representation of the rational basis function with equivalent electrical circuits. A detailed derivation can be found in [[3](#link_ref3)] and [[4](#link_ref4)].\n", "\n", "### Constant and Proportional Term\n", "The constant and proportional terms $\\mathbf{d} + \\mathrm{\\underline{s}} \\mathbf{e}$ can be represented in an electrical circuit by equivalent impedances $\\underline{Z}_\\mathrm{RL}(\\mathrm{\\underline{s}})$ or equivalent admittances $\\underline{Y}_\\mathrm{RC}(\\mathrm{\\underline{s}})$ build out of a series RL or parallel RC circuits.\n", "\n", "
