next up previous contents
Next: H. General Nonlinear Constrained Up: G. Levenberg-Marquardt Optimizer with Previous: G2. Input Deck

G3. Model Library File

In the Model Library file a new class of a model is declared. During the initialization of the Model Definition Language an object of this class is created. The method evaluated declared in this class is called for every data point of the data file.

In Figure G.2 a short example of a Model Library file is shown. In this example a quadratic function is fitted to a dataset.

Figure G.2: A example of an MDL file.
Instance fit_function = QuadFit;

NewModel QuadFit : FunctionModel
{
  evaluate {
    :result = :ue["a0"] + :ue["a1"] * :ue["x"] +
              :ue["a2"] * :ue["x"] * :ue["x"];
  }
}

The free parameters of the optimization are a0, a1, and a2. The data file provides the values for x and the measured value which is compared with the calculated value of :result. The integrated Model Library interface is described in Section 4.3.6.




R. Plasun