Example A.12 finally shows a possible implementation of an MDL Model definition for the generation of an gnuplot compatible table of lateral and vertical coordinate values of the complimentary error function when parsed by the above generated tinyapp program.
Therefore the MDL input deck starts by dynamically loading the MDL function extension library TinyAlibFuncExtLib which provides the MDL function erfc. The newly defined ErfcPlot Model inherits its Interface and the plot method from the GnuplotModel and generates in its evaluate method a list of associated dependent and non-dependent variable values of the erfc function within the MdlDblmap Interface Parameter map.
set $VLIBRARYPATH = "$VPROJECT/lib/$VEXT";
LoadObjectLibrary "TinyAlibFuncExtLib";
Instance TinyAppTest = ErfcPlot;
NewModel ErfcPlot : GnuplotModel {
Local {
protected Parameter<double> step;
protected Parameter<double> x;
}
evaluate {
step = (:maxX - :minX)/:ptNr;
x = :minX;
while (x <= :maxX) {
:map[x] = erfc(x);
x += step;
}
call plot;
}
}
Example A.12: The MDL input deck