next up previous contents
Next: 4.4 General Nonlinear Optimization Up: 4.3 Least-Squares Problems Previous: 4.3.5 SIESTA Interface


4.3.6 Model Library

For fitting simple analytical functions to a given dataset an optimizer with an integrated model library interface is available. The analytical model which combines the dataset and the parameters can be coded in Model Definition Language (MDL) (see Section 2.2.2).

In Figure 4.3 a short example of a MDL file is shown. In this example some of the SPICE Level 1 parameters were fitted to the measured data of a MOS Transistor. The equations [31] for the linear region of the device are for VGS > VT and VDS < VGS - VT

\begin{displaymath}
I_{D} = A \cdot \left ( V_{GS} - V_{T} - \frac{V_{DS}}{2} \right )
\cdot V_{DS} \cdot \left ( 1 + l \cdot V_{DS} \right )
\end{displaymath} (4.45)

and for the saturation region ( VGS > VT and VDS > VGS - VT)

\begin{displaymath}
I_{D} = \frac{A}{2} \cdot \left ( V_{GS} - V_{T} \right )
...
...- V_{VT} \right )
\cdot \left ( 1 + l \cdot V_{DS} \right )
.
\end{displaymath} (4.46)

The values A, VT, and l in (4.45) and (4.46) are parameters of the Level 1 model. In the data file the values for vgs, vds and id are provided.

All variables available from the interface of the Model Library, can be used in the evaluation method by the map :ue (e.g., :ue["vgs"] for the value of the gate voltage vgs). These are the variables from the data file and the variables controlled by the optimizer.

Figure 4.3: Example of an MDL file.
Instance fit_function = Level1Fit;

NewModel Level1Fit : FunctionModel
{
  Local { 
    Parameter <double> l = 0.1;
  }

  evaluate {
    // overload the variable with the value from the current 
    // evaluation
    l   = :ue["l"];

    if (:ue["vgs"] > :ue["vt"]) {
      if (:ue["vds"] < (:ue["vgs"] - :ue["vt"])) {
        // linear region
        :result = :ue["a"]  * 
                 (:ue["vgs"] - :ue["vt"] - :ue["vds"] / 2.) *
                  :ue["vds"] * (1. + l * :ue["vds"]);
      } else {
        // saturation region
        :result = :ue["a"] / 2. * ( :ue["vgs"] - :ue["vt"] ) *
                  (:ue["vgs"] - :ue["vt"]) * 
                  (1. + l * :ue["vds"]);
      }
    } else {
      :result = :ue["id"];
    }    
  }
}

In the Local section some local parameters are declared and defined. Here only the parameter l is declared. In the first part of the evaluate method this local variable is overwritten with the variables from the data file or the variables controlled by the optimizer. From now on l can be used instead of :ue["l"]. This substitution can be useful for larger models making them more readable.

In the next part (4.45) and (4.46) are coded with the necessary if branches to distinguish between the linear and the saturation region.

For UGS < UT no equation for calculating the current ID is defined in the Level 1 model. But it is not possible to reduce the data set a priori, because the decision which of the equations (4.45) and (4.46) has to be used depends on the optimization value VT varied by the optimizer. To suppress influence of data points for which no equation for ID is defined the measured id value is returned and the residuum for these points is zero.


next up previous contents
Next: 4.4 General Nonlinear Optimization Up: 4.3 Least-Squares Problems Previous: 4.3.5 SIESTA Interface

R. Plasun