GenericHystTellinenTable

model GenericHystTellinenTable "Generic flux tube with ferromagnetic hysteresis based on the Tellinen model and table data"
    parameter FluxTubes.Material.HysteresisTableData.BaseData mat = FluxTubes.Material.HysteresisTableData.BaseData() annotation (
        choicesAllMatching = true,
        Dialog(group = "Hysteresis"));
    parameter Real K = 1 "Slope of hysteresis in the saturation region (K*mu_0)"
        annotation (Dialog(group = "Hysteresis"));

    extends Interfaces.PartialGenericHysteresisTellinen(mu0 = mu_0 * K, sigma = mat.sigma);

protected
    constant SI.MagneticFluxDensity unitT = 1;
    parameter SI.MagneticFluxDensity eps = 0.001 * (unitT * mat.tabris[size(mat.tabris, 1),2]);
    Modelica.Blocks.Tables.CombiTable1D tabris(table = mat.tabris, smoothness = Modelica.Blocks.Types.Smoothness.ContinuousDerivative);
    Modelica.Blocks.Tables.CombiTable1D tabfal(table = mat.tabfal, smoothness = Modelica.Blocks.Types.Smoothness.ContinuousDerivative);
equation
    hystF = unitT * tabfal.y[1] + mu0 * Hstat + eps;
    hystR = unitT * tabris.y[1] + mu0 * Hstat - eps;
    tabfal.u[1] = Hstat;
    tabris.u[1] = Hstat;

    annotation (
        defaultComponentName = "core",
        Icon(graphics = {
            Text(
                extent = {
                    {40, 0}, 
                    {40, -30}},
                lineColor = {255, 128, 0},
                textString = "TT")}),
        Documentation(info = "<html>\n\n<p>\nFlux tube element for modeling magnetic materials with ferromagnetic and dynamic hysteresis (eddy currents). The ferromagnetic hysteresis behavior is defined by the <a href=\"modelica://Modelica.Magnetic.FluxTubes.UsersGuide.Hysteresis.StaticHysteresis.Tellinen\">Tellinen hysteresis model</a>. The rising and falling branch of the limiting ferromagnetic hysteresis loop are specified by table data. Therefore, almost any hysteresis shapes are possible. A library with predefined tables can be found at <a href=\"modelica://Modelica.Magnetic.FluxTubes.Material.HysteresisTableData\">FluxTubes.Material.HysteresisTableData</a>.\n</p>\n<p>\nAn overview of all available hysteresis and permanent magnet elements of the package <a href=\"modelica://Modelica.Magnetic.FluxTubes.Shapes.HysteresisAndMagnets\">HysteresisAndMagnets</a> can be found in <a href=\"modelica://Modelica.Magnetic.FluxTubes.UsersGuide.Hysteresis\">UsersGuide.Hysteresis</a>.\n</p>\n\n</html>"));
end GenericHystTellinenTable;