/*
 * submarine_cable_06_thermal_effects.java
 */

import com.comsol.model.*;
import com.comsol.model.util.*;

/** Model exported on May 6 2026, 10:24 by COMSOL 6.4.0.414. */
public class submarine_cable_06_thermal_effects {

  public static Model run() {
    Model model = ModelUtil.create("Model");

    model.component().create("comp1", true);

    model.component("comp1").geom().create("geom1", 2);

    model.component("comp1").mesh().create("mesh1");

    model.component("comp1").geom("geom1").insertFile("submarine_cable_e_geom_sequence.mph", "geom1");
    model.component("comp1").geom("geom1").run("fin");

    model.param().label("Geometric Parameters 1");
    model.param().create("par2");
    model.param("par2").label("Geometric Parameters 2");

//    To import content from file, use:
//    model.param("par2").loadFile("FILENAME");
    model.param("par2").set("Acon", "500[mm^2]", "Cross sectional area of main conductors (per phase)");
    model.param("par2").set("Ncon", "Acon/(pi*(Dcon/2)^2)", "Conductor packing density (phase)");
    model.param("par2").set("Apbs", "pi*(Dins+Tpbs)*Tpbs", "Cross sectional area of lead sheath (per phase)");
    model.param("par2").set("Lsec1", "1/3", "Relative length cross bonding section 1");
    model.param("par2").set("Lsec2", "1-Lsec1-Lsec3", "Relative length cross bonding section 2");
    model.param("par2").set("Lsec3", "1/3", "Relative length cross bonding section 3");
    model.param("par2").set("Lcab", "10[km]", "Total length of submarine cable");
    model.param("par2").set("Scab", "1e5", "Geometric scale factor (2Daxi model)");

    model.component("comp1").selection().create("uni1", "Union");
    model.component("comp1").selection("uni1").label("Phases");
    model.component("comp1").selection("uni1")
         .set("input", new String[]{"geom1_c1_dom", "geom1_c2_dom", "geom1_c3_dom"});
    model.component("comp1").selection().create("uni2", "Union");
    model.component("comp1").selection("uni2").label("Metals");
    model.component("comp1").selection("uni2")
         .set("input", new String[]{"uni1", "geom1_uni3_dom", "geom1_c17_dom", "geom1_c19_dom"});
    model.component("comp1").selection().create("dif1", "Difference");
    model.component("comp1").selection("dif1").label("Insulators (External to Phase)");
    model.component("comp1").selection("dif1").set("add", new String[]{"geom1_c21_dom"});
    model.component("comp1").selection("dif1")
         .set("subtract", new String[]{"uni2", "geom1_uni1_dom", "geom1_uni2_dom"});
    model.component("comp1").selection().create("dif2", "Difference");
    model.component("comp1").selection("dif2").label("Air Pockets");
    model.component("comp1").selection("dif2").set("add", new String[]{"dif1"});
    model.component("comp1").selection("dif2")
         .set("subtract", new String[]{"geom1_dif1_dom", "geom1_dif2_dom", "geom1_c18_dom", "geom1_dif3_dom"});
    model.component("comp1").selection().create("dif3", "Difference");
    model.component("comp1").selection("dif3").label("Solid Domains");
    model.component("comp1").selection("dif3").set("add", new String[]{"geom1_c22_dom"});
    model.component("comp1").selection("dif3").set("subtract", new String[]{"dif2"});
    model.component("comp1").selection().create("adj1", "Adjacent");
    model.component("comp1").selection("adj1").label("Thermal Contact");
    model.component("comp1").selection("adj1").set("input", new String[]{"dif1"});
    model.component("comp1").selection("adj1").set("interior", true);

    model.component("comp1").view("view1").set("showmaterial", true);

    model.component("comp1").material().create("mat1", "Common");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("eta", "Piecewise");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("Cp", "Piecewise");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("rho", "Analytic");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("k", "Piecewise");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("cs", "Analytic");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("an1", "Analytic");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("an2", "Analytic");
    model.component("comp1").material("mat1").propertyGroup()
         .create("RefractiveIndex", "RefractiveIndex", "Refractive index");
    model.component("comp1").material("mat1").propertyGroup()
         .create("NonlinearModel", "NonlinearModel", "Nonlinear model");
    model.component("comp1").material("mat1").propertyGroup().create("idealGas", "idealGas", "Ideal gas");
    model.component("comp1").material("mat1").propertyGroup("idealGas").func().create("Cp", "Piecewise");
    model.component("comp1").material("mat1").label("Air");
    model.component("comp1").material("mat1").set("family", "air");
    model.component("comp1").material("mat1").propertyGroup("def").func("eta").set("arg", "T");
    model.component("comp1").material("mat1").propertyGroup("def").func("eta")
         .set("pieces", new String[][]{{"200.0", "1600.0", "-8.38278E-7+8.35717342E-8*T^1-7.69429583E-11*T^2+4.6437266E-14*T^3-1.06585607E-17*T^4"}});
    model.component("comp1").material("mat1").propertyGroup("def").func("eta").set("argunit", "K");
    model.component("comp1").material("mat1").propertyGroup("def").func("eta").set("fununit", "Pa*s");
    model.component("comp1").material("mat1").propertyGroup("def").func("Cp").set("arg", "T");
    model.component("comp1").material("mat1").propertyGroup("def").func("Cp")
         .set("pieces", new String[][]{{"200.0", "1600.0", "1047.63657-0.372589265*T^1+9.45304214E-4*T^2-6.02409443E-7*T^3+1.2858961E-10*T^4"}});
    model.component("comp1").material("mat1").propertyGroup("def").func("Cp").set("argunit", "K");
    model.component("comp1").material("mat1").propertyGroup("def").func("Cp").set("fununit", "J/(kg*K)");
    model.component("comp1").material("mat1").propertyGroup("def").func("rho")
         .set("expr", "pA*0.02897/R_const[K*mol/J]/T");
    model.component("comp1").material("mat1").propertyGroup("def").func("rho").set("args", new String[]{"pA", "T"});
    model.component("comp1").material("mat1").propertyGroup("def").func("rho").set("fununit", "kg/m^3");
    model.component("comp1").material("mat1").propertyGroup("def").func("rho")
         .set("argunit", new String[]{"Pa", "K"});
    model.component("comp1").material("mat1").propertyGroup("def").func("rho")
         .set("plotaxis", new String[]{"off", "on"});
    model.component("comp1").material("mat1").propertyGroup("def").func("rho")
         .set("plotfixedvalue", new String[]{"101325", "273.15"});
    model.component("comp1").material("mat1").propertyGroup("def").func("rho")
         .set("plotargs", new String[][]{{"pA", "101325", "101325"}, {"T", "273.15", "293.15"}});
    model.component("comp1").material("mat1").propertyGroup("def").func("k").set("arg", "T");
    model.component("comp1").material("mat1").propertyGroup("def").func("k")
         .set("pieces", new String[][]{{"200.0", "1600.0", "-0.00227583562+1.15480022E-4*T^1-7.90252856E-8*T^2+4.11702505E-11*T^3-7.43864331E-15*T^4"}});
    model.component("comp1").material("mat1").propertyGroup("def").func("k").set("argunit", "K");
    model.component("comp1").material("mat1").propertyGroup("def").func("k").set("fununit", "W/(m*K)");
    model.component("comp1").material("mat1").propertyGroup("def").func("cs")
         .set("expr", "sqrt(1.4*R_const[K*mol/J]/0.02897*T)");
    model.component("comp1").material("mat1").propertyGroup("def").func("cs").set("args", new String[]{"T"});
    model.component("comp1").material("mat1").propertyGroup("def").func("cs").set("fununit", "m/s");
    model.component("comp1").material("mat1").propertyGroup("def").func("cs").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("def").func("cs")
         .set("plotfixedvalue", new String[]{"273.15"});
    model.component("comp1").material("mat1").propertyGroup("def").func("cs")
         .set("plotargs", new String[][]{{"T", "273.15", "373.15"}});
    model.component("comp1").material("mat1").propertyGroup("def").func("an1").set("funcname", "alpha_p");
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("expr", "-1/rho(pA,T)*d(rho(pA,T),T)");
    model.component("comp1").material("mat1").propertyGroup("def").func("an1").set("args", new String[]{"pA", "T"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an1").set("fununit", "1/K");
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("argunit", new String[]{"Pa", "K"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("plotaxis", new String[]{"off", "on"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("plotfixedvalue", new String[]{"101325", "273.15"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("plotargs", new String[][]{{"pA", "101325", "101325"}, {"T", "273.15", "373.15"}});
    model.component("comp1").material("mat1").propertyGroup("def").func("an2").set("funcname", "muB");
    model.component("comp1").material("mat1").propertyGroup("def").func("an2").set("expr", "0.6*eta(T)");
    model.component("comp1").material("mat1").propertyGroup("def").func("an2").set("args", new String[]{"T"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an2").set("fununit", "Pa*s");
    model.component("comp1").material("mat1").propertyGroup("def").func("an2").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an2")
         .set("plotfixedvalue", new String[]{"200"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an2")
         .set("plotargs", new String[][]{{"T", "200", "1600"}});
    model.component("comp1").material("mat1").propertyGroup("def").set("thermalexpansioncoefficient", "");
    model.component("comp1").material("mat1").propertyGroup("def").set("molarmass", "");
    model.component("comp1").material("mat1").propertyGroup("def").set("bulkviscosity", "");
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"alpha_p(pA,T)", "0", "0", "0", "alpha_p(pA,T)", "0", "0", "0", "alpha_p(pA,T)"});
    model.component("comp1").material("mat1").propertyGroup("def").set("molarmass", "0.02897[kg/mol]");
    model.component("comp1").material("mat1").propertyGroup("def").set("bulkviscosity", "muB(T)");
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("relpermeability", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"});
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("relpermittivity", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"});
    model.component("comp1").material("mat1").propertyGroup("def").set("dynamicviscosity", "eta(T)");
    model.component("comp1").material("mat1").propertyGroup("def").set("ratioofspecificheat", "1.4");
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("electricconductivity", new String[]{"0[S/m]", "0", "0", "0", "0[S/m]", "0", "0", "0", "0[S/m]"});
    model.component("comp1").material("mat1").propertyGroup("def").set("heatcapacity", "Cp(T)");
    model.component("comp1").material("mat1").propertyGroup("def").set("density", "rho(pA,T)");
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("thermalconductivity", new String[]{"k(T)", "0", "0", "0", "k(T)", "0", "0", "0", "k(T)"});
    model.component("comp1").material("mat1").propertyGroup("def").set("soundspeed", "cs(T)");
    model.component("comp1").material("mat1").propertyGroup("def").addInput("temperature");
    model.component("comp1").material("mat1").propertyGroup("def").addInput("pressure");
    model.component("comp1").material("mat1").propertyGroup("RefractiveIndex")
         .set("n", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"});
    model.component("comp1").material("mat1").propertyGroup("NonlinearModel").set("BA", "def.gamma-1");
    model.component("comp1").material("mat1").propertyGroup("idealGas").func("Cp").label("Piecewise 2");
    model.component("comp1").material("mat1").propertyGroup("idealGas").func("Cp").set("arg", "T");
    model.component("comp1").material("mat1").propertyGroup("idealGas").func("Cp")
         .set("pieces", new String[][]{{"200.0", "1600.0", "1047.63657-0.372589265*T^1+9.45304214E-4*T^2-6.02409443E-7*T^3+1.2858961E-10*T^4"}});
    model.component("comp1").material("mat1").propertyGroup("idealGas").func("Cp").set("argunit", "K");
    model.component("comp1").material("mat1").propertyGroup("idealGas").func("Cp").set("fununit", "J/(kg*K)");
    model.component("comp1").material("mat1").propertyGroup("idealGas").set("Rs", "R_const/Mn");
    model.component("comp1").material("mat1").propertyGroup("idealGas").set("heatcapacity", "Cp(T)");
    model.component("comp1").material("mat1").propertyGroup("idealGas").set("ratioofspecificheat", "1.4");
    model.component("comp1").material("mat1").propertyGroup("idealGas").set("molarmass", "0.02897[kg/mol]");
    model.component("comp1").material("mat1").propertyGroup("idealGas").addInput("temperature");
    model.component("comp1").material("mat1").propertyGroup("idealGas").addInput("pressure");
    model.component("comp1").material("mat1").materialType("nonSolid");
    model.component("comp1").material().create("mat2", "Common");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("eta", "Piecewise");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("Cp", "Piecewise");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("rho", "Piecewise");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("k", "Piecewise");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("cs", "Interpolation");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("an1", "Analytic");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("an2", "Analytic");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("an3", "Analytic");
    model.component("comp1").material("mat2").label("Water, liquid");
    model.component("comp1").material("mat2").set("family", "water");
    model.component("comp1").material("mat2").propertyGroup("def").func("eta").set("arg", "T");
    model.component("comp1").material("mat2").propertyGroup("def").func("eta")
         .set("pieces", new String[][]{{"273.15", "413.15", "1.3799566804-0.021224019151*T^1+1.3604562827E-4*T^2-4.6454090319E-7*T^3+8.9042735735E-10*T^4-9.0790692686E-13*T^5+3.8457331488E-16*T^6"}, {"413.15", "553.75", "0.00401235783-2.10746715E-5*T^1+3.85772275E-8*T^2-2.39730284E-11*T^3"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("eta").set("argunit", "K");
    model.component("comp1").material("mat2").propertyGroup("def").func("eta").set("fununit", "Pa*s");
    model.component("comp1").material("mat2").propertyGroup("def").func("Cp").set("arg", "T");
    model.component("comp1").material("mat2").propertyGroup("def").func("Cp")
         .set("pieces", new String[][]{{"273.15", "553.75", "12010.1471-80.4072879*T^1+0.309866854*T^2-5.38186884E-4*T^3+3.62536437E-7*T^4"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("Cp").set("argunit", "K");
    model.component("comp1").material("mat2").propertyGroup("def").func("Cp").set("fununit", "J/(kg*K)");
    model.component("comp1").material("mat2").propertyGroup("def").func("rho").set("arg", "T");
    model.component("comp1").material("mat2").propertyGroup("def").func("rho").set("smooth", "contd1");
    model.component("comp1").material("mat2").propertyGroup("def").func("rho")
         .set("pieces", new String[][]{{"273.15", "293.15", "0.000063092789034*T^3-0.060367639882855*T^2+18.9229382407066*T-950.704055329848"}, {"293.15", "373.15", "0.000010335053319*T^3-0.013395065634452*T^2+4.969288832655160*T+432.257114008512"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("rho").set("argunit", "K");
    model.component("comp1").material("mat2").propertyGroup("def").func("rho").set("fununit", "kg/m^3");
    model.component("comp1").material("mat2").propertyGroup("def").func("k").set("arg", "T");
    model.component("comp1").material("mat2").propertyGroup("def").func("k")
         .set("pieces", new String[][]{{"273.15", "553.75", "-0.869083936+0.00894880345*T^1-1.58366345E-5*T^2+7.97543259E-9*T^3"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("k").set("argunit", "K");
    model.component("comp1").material("mat2").propertyGroup("def").func("k").set("fununit", "W/(m*K)");
    model.component("comp1").material("mat2").propertyGroup("def").func("cs")
         .set("table", new String[][]{{"273", "1403"}, 
         {"278", "1427"}, 
         {"283", "1447"}, 
         {"293", "1481"}, 
         {"303", "1507"}, 
         {"313", "1526"}, 
         {"323", "1541"}, 
         {"333", "1552"}, 
         {"343", "1555"}, 
         {"353", "1555"}, 
         {"363", "1550"}, 
         {"373", "1543"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("cs").set("interp", "piecewisecubic");
    model.component("comp1").material("mat2").propertyGroup("def").func("cs").set("fununit", new String[]{"m/s"});
    model.component("comp1").material("mat2").propertyGroup("def").func("cs").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an1").set("funcname", "alpha_p");
    model.component("comp1").material("mat2").propertyGroup("def").func("an1").set("expr", "-1/rho(T)*d(rho(T),T)");
    model.component("comp1").material("mat2").propertyGroup("def").func("an1").set("args", new String[]{"T"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an1").set("fununit", "1/K");
    model.component("comp1").material("mat2").propertyGroup("def").func("an1").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an1")
         .set("plotfixedvalue", new String[]{"273.15"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an1")
         .set("plotargs", new String[][]{{"T", "273.15", "373.15"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("an2").set("funcname", "gamma_w");
    model.component("comp1").material("mat2").propertyGroup("def").func("an2")
         .set("expr", "1+(T/Cp(T))*(alpha_p(T)*cs(T))^2");
    model.component("comp1").material("mat2").propertyGroup("def").func("an2").set("args", new String[]{"T"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an2").set("fununit", "1");
    model.component("comp1").material("mat2").propertyGroup("def").func("an2").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an2")
         .set("plotfixedvalue", new String[]{"273.15"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an2")
         .set("plotargs", new String[][]{{"T", "273.15", "373.15"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("an3").set("funcname", "muB");
    model.component("comp1").material("mat2").propertyGroup("def").func("an3").set("expr", "2.79*eta(T)");
    model.component("comp1").material("mat2").propertyGroup("def").func("an3").set("args", new String[]{"T"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an3").set("fununit", "Pa*s");
    model.component("comp1").material("mat2").propertyGroup("def").func("an3").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an3")
         .set("plotfixedvalue", new String[]{"273.15"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an3")
         .set("plotargs", new String[][]{{"T", "273.15", "553.75"}});
    model.component("comp1").material("mat2").propertyGroup("def").set("thermalexpansioncoefficient", "");
    model.component("comp1").material("mat2").propertyGroup("def").set("bulkviscosity", "");
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"alpha_p(T)", "0", "0", "0", "alpha_p(T)", "0", "0", "0", "alpha_p(T)"});
    model.component("comp1").material("mat2").propertyGroup("def").set("bulkviscosity", "muB(T)");
    model.component("comp1").material("mat2").propertyGroup("def").set("dynamicviscosity", "eta(T)");
    model.component("comp1").material("mat2").propertyGroup("def").set("ratioofspecificheat", "gamma_w(T)");
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("electricconductivity", new String[]{"5.5e-6[S/m]", "0", "0", "0", "5.5e-6[S/m]", "0", "0", "0", "5.5e-6[S/m]"});
    model.component("comp1").material("mat2").propertyGroup("def").set("heatcapacity", "Cp(T)");
    model.component("comp1").material("mat2").propertyGroup("def").set("density", "rho(T)");
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("thermalconductivity", new String[]{"k(T)", "0", "0", "0", "k(T)", "0", "0", "0", "k(T)"});
    model.component("comp1").material("mat2").propertyGroup("def").set("soundspeed", "cs(T)");
    model.component("comp1").material("mat2").propertyGroup("def").addInput("temperature");
    model.component("comp1").material("mat2").selection().set(2);
    model.component("comp1").material().create("mat3", "Common");
    model.component("comp1").material("mat3").label("Gravel, saturated");
    model.component("comp1").material("mat3").selection().set(1, 7);
    model.component("comp1").material("mat3").propertyGroup("def").set("relpermeability", "");
    model.component("comp1").material("mat3").propertyGroup("def").set("electricconductivity", "");
    model.component("comp1").material("mat3").propertyGroup("def").set("relpermittivity", "");
    model.component("comp1").material("mat3").propertyGroup("def").set("thermalconductivity", "");
    model.component("comp1").material("mat3").propertyGroup("def").set("density", "");
    model.component("comp1").material("mat3").propertyGroup("def").set("heatcapacity", "");
    model.component("comp1").material("mat3").set("family", "rock");
    model.component("comp1").material().duplicate("mat4", "mat3");
    model.component("comp1").material("mat4").label("Polyethylene");
    model.component("comp1").material("mat4").selection().named("geom1_dif1_dom");
    model.component("comp1").material("mat4").set("family", "oil");
    model.component("comp1").material().duplicate("mat5", "mat4");
    model.component("comp1").material("mat5").label("Polypropylene");
    model.component("comp1").material("mat5").selection().named("geom1_dif2_dom");
    model.component("comp1").material("mat5").set("family", "plastic");
    model.component("comp1").material("mat5").set("color", "gray");
    model.component("comp1").material().duplicate("mat6", "mat5");
    model.component("comp1").material("mat6").label("Cross-linked polyethylene (XLPE)");
    model.component("comp1").material("mat6").selection().named("geom1_uni2_dom");
    model.component("comp1").material("mat6").set("color", "white");
    model.component("comp1").material().duplicate("mat7", "mat6");
    model.component("comp1").material("mat7").label("Semiconductive compound");
    model.component("comp1").material("mat7").selection().named("geom1_uni1_dom");
    model.component("comp1").material("mat7").set("color", "black");
    model.component("comp1").material().duplicate("mat8", "mat7");
    model.component("comp1").material("mat8").label("Bitumen compound");
    model.component("comp1").material("mat8").selection().named("geom1_dif3_dom");
    model.component("comp1").material().create("mat9", "Common");
    model.component("comp1").material("mat9").propertyGroup()
         .create("Enu", "Enu", "Young's modulus and Poisson's ratio");
    model.component("comp1").material("mat9").propertyGroup()
         .create("RefractiveIndex", "RefractiveIndex", "Refractive index");
    model.component("comp1").material("mat9").label("Silica glass");
    model.component("comp1").material("mat9").set("family", "custom");
    model.component("comp1").material("mat9").set("diffuse", "custom");
    model.component("comp1").material("mat9").set("ambient", "custom");
    model.component("comp1").material("mat9").set("noise", true);
    model.component("comp1").material("mat9").set("fresnel", 0.99);
    model.component("comp1").material("mat9").set("roughness", 0.02);
    model.component("comp1").material("mat9").set("diffusewrap", 0);
    model.component("comp1").material("mat9").set("reflectance", 0);
    model.component("comp1").material("mat9").propertyGroup("def")
         .set("relpermeability", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"});
    model.component("comp1").material("mat9").propertyGroup("def")
         .set("electricconductivity", new String[]{"1e-14[S/m]", "0", "0", "0", "1e-14[S/m]", "0", "0", "0", "1e-14[S/m]"});
    model.component("comp1").material("mat9").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"0.55e-6[1/K]", "0", "0", "0", "0.55e-6[1/K]", "0", "0", "0", "0.55e-6[1/K]"});
    model.component("comp1").material("mat9").propertyGroup("def").set("heatcapacity", "703[J/(kg*K)]");
    model.component("comp1").material("mat9").propertyGroup("def")
         .set("relpermittivity", new String[]{"3.75", "0", "0", "0", "3.75", "0", "0", "0", "3.75"});
    model.component("comp1").material("mat9").propertyGroup("def").set("density", "2203[kg/m^3]");
    model.component("comp1").material("mat9").propertyGroup("def")
         .set("thermalconductivity", new String[]{"1.38[W/(m*K)]", "0", "0", "0", "1.38[W/(m*K)]", "0", "0", "0", "1.38[W/(m*K)]"});
    model.component("comp1").material("mat9").propertyGroup("Enu").set("E", "73.1[GPa]");
    model.component("comp1").material("mat9").propertyGroup("Enu").set("nu", "0.17");
    model.component("comp1").material("mat9").propertyGroup("RefractiveIndex")
         .set("n", new String[]{"1.45", "0", "0", "0", "1.45", "0", "0", "0", "1.45"});
    model.component("comp1").material("mat9").selection().named("geom1_c18_dom");
    model.component("comp1").material().duplicate("mat10", "mat8");
    model.component("comp1").material("mat10").label("Stainless steel");
    model.component("comp1").material("mat10").selection().named("geom1_c17_dom");
    model.component("comp1").material("mat10").set("family", "steel");
    model.component("comp1").material().duplicate("mat11", "mat10");
    model.component("comp1").material("mat11").label("Copper");
    model.component("comp1").material("mat11").selection().named("uni1");
    model.component("comp1").material("mat11").propertyGroup()
         .create("linzRes", "linzRes", "Linearized_resistivity");
    model.component("comp1").material("mat11").set("family", "copper");
    model.component("comp1").material().duplicate("mat12", "mat11");
    model.component("comp1").material("mat12").label("Lead");
    model.component("comp1").material("mat12").selection().named("geom1_uni3_dom");
    model.component("comp1").material("mat12").set("family", "lead");
    model.component("comp1").material().duplicate("mat13", "mat12");
    model.component("comp1").material("mat13").label("Galvanized steel");
    model.component("comp1").material("mat13").selection().named("geom1_c19_dom");
    model.component("comp1").material("mat13").set("family", "steel");
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("def").set("molarmass", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("def").set("bulkviscosity", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("def").set("relpermeability", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("def").set("relpermittivity", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("def").set("dynamicviscosity", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("def").set("ratioofspecificheat", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("def").set("electricconductivity", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("def").set("heatcapacity", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("def").set("density", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("def").set("thermalconductivity", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("def").set("soundspeed", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("RefractiveIndex").set("n", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("RefractiveIndex").set("ki", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("NonlinearModel").set("BA", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("idealGas").set("Rs", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("idealGas").set("heatcapacity", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("idealGas")
         .set("ratioofspecificheat", new String[]{"x"});
    model.component("comp1").material("mat1").propertyGroup("idealGas").set("molarmass", new String[]{"x"});
    model.material().label("Materials.");
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"alpha_p(pA,T)"});
    model.component("comp1").material("mat1").propertyGroup("def").set("molarmass", new String[]{"0.02897[kg/mol]"});
    model.component("comp1").material("mat1").propertyGroup("def").set("bulkviscosity", new String[]{"muB(T)"});
    model.component("comp1").material("mat1").propertyGroup("def").set("relpermeability", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("def").set("relpermittivity", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("def").set("dynamicviscosity", new String[]{"eta(T)"});
    model.component("comp1").material("mat1").propertyGroup("def").set("ratioofspecificheat", new String[]{"1.4"});
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("electricconductivity", new String[]{"1e-14[S/m]"});
    model.component("comp1").material("mat1").propertyGroup("def").set("heatcapacity", new String[]{"Cp(T)"});
    model.component("comp1").material("mat1").propertyGroup("def").set("density", new String[]{"rho(pA,T)"});
    model.component("comp1").material("mat1").propertyGroup("def").set("thermalconductivity", new String[]{"k(T)"});
    model.component("comp1").material("mat1").propertyGroup("def").set("soundspeed", new String[]{"cs(T)"});
    model.component("comp1").material("mat1").propertyGroup("RefractiveIndex").set("n", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("RefractiveIndex").set("ki", new String[]{"0"});
    model.component("comp1").material("mat1").propertyGroup("NonlinearModel")
         .set("BA", new String[]{"(def.gamma+1)/2"});
    model.component("comp1").material("mat1").propertyGroup("idealGas").set("Rs", new String[]{"R_const/Mn"});
    model.component("comp1").material("mat1").propertyGroup("idealGas").set("heatcapacity", new String[]{"Cp(T)"});
    model.component("comp1").material("mat1").propertyGroup("idealGas")
         .set("ratioofspecificheat", new String[]{"1.4"});
    model.component("comp1").material("mat1").propertyGroup("idealGas").set("molarmass", new String[]{"0.02897"});

    return model;
  }

  public static Model run2(Model model) {
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"x"});
    model.component("comp1").material("mat2").propertyGroup("def").set("bulkviscosity", new String[]{"x"});
    model.component("comp1").material("mat2").propertyGroup("def").set("dynamicviscosity", new String[]{"x"});
    model.component("comp1").material("mat2").propertyGroup("def").set("ratioofspecificheat", new String[]{"x"});
    model.component("comp1").material("mat2").propertyGroup("def").set("electricconductivity", new String[]{"x"});
    model.component("comp1").material("mat2").propertyGroup("def").set("heatcapacity", new String[]{"x"});
    model.component("comp1").material("mat2").propertyGroup("def").set("density", new String[]{"x"});
    model.component("comp1").material("mat2").propertyGroup("def").set("thermalconductivity", new String[]{"x"});
    model.component("comp1").material("mat2").propertyGroup("def").set("soundspeed", new String[]{"x"});
    model.material().label("Materials..");
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"alpha_p(T)"});
    model.component("comp1").material("mat2").propertyGroup("def").set("bulkviscosity", new String[]{"muB(T)"});
    model.component("comp1").material("mat2").propertyGroup("def").set("dynamicviscosity", new String[]{"eta(T)"});
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("ratioofspecificheat", new String[]{"gamma_w(T)"});
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("electricconductivity", new String[]{"5.5e-6[S/m]"});
    model.component("comp1").material("mat2").propertyGroup("def").set("heatcapacity", new String[]{"Cp(T)"});
    model.component("comp1").material("mat2").propertyGroup("def").set("density", new String[]{"rho(T)"});
    model.component("comp1").material("mat2").propertyGroup("def").set("thermalconductivity", new String[]{"k(T)"});
    model.component("comp1").material("mat2").propertyGroup("def").set("soundspeed", new String[]{"cs(T)"});
    model.component("comp1").material("mat3").propertyGroup("def").set("relpermeability", new String[]{"1"});
    model.component("comp1").material("mat3").propertyGroup("def")
         .set("electricconductivity", new String[]{"1[S/m]"});
    model.component("comp1").material("mat3").propertyGroup("def").set("relpermittivity", new String[]{"28"});
    model.component("comp1").material("mat3").propertyGroup("def")
         .set("thermalconductivity", new String[]{"1[W/(m*K)]"});
    model.component("comp1").material("mat3").propertyGroup("def").set("density", new String[]{"2020[kg/m^3]"});
    model.component("comp1").material("mat3").propertyGroup("def")
         .set("heatcapacity", new String[]{"2512[J/(kg*K)]"});
    model.component("comp1").material("mat4").propertyGroup("def").set("relpermeability", new String[]{"1"});
    model.component("comp1").material("mat4").propertyGroup("def")
         .set("electricconductivity", new String[]{"1e-18[S/m]"});
    model.component("comp1").material("mat4").propertyGroup("def").set("relpermittivity", new String[]{"2.25"});
    model.component("comp1").material("mat4").propertyGroup("def")
         .set("thermalconductivity", new String[]{"0.46[W/(m*K)]"});
    model.component("comp1").material("mat4").propertyGroup("def").set("density", new String[]{"935[kg/m^3]"});
    model.component("comp1").material("mat4").propertyGroup("def")
         .set("heatcapacity", new String[]{"2302[J/(kg*K)]"});
    model.component("comp1").material("mat5").propertyGroup("def").set("relpermeability", new String[]{"1"});
    model.component("comp1").material("mat5").propertyGroup("def")
         .set("electricconductivity", new String[]{"1e-18[S/m]"});
    model.component("comp1").material("mat5").propertyGroup("def").set("relpermittivity", new String[]{"2.36"});
    model.component("comp1").material("mat5").propertyGroup("def")
         .set("thermalconductivity", new String[]{"0.25[W/(m*K)]"});
    model.component("comp1").material("mat5").propertyGroup("def").set("density", new String[]{"946[kg/m^3]"});
    model.component("comp1").material("mat5").propertyGroup("def")
         .set("heatcapacity", new String[]{"1920[J/(kg*K)]"});
    model.component("comp1").material("mat6").propertyGroup("def").set("relpermeability", new String[]{"1"});
    model.component("comp1").material("mat6").propertyGroup("def")
         .set("electricconductivity", new String[]{"1e-18[S/m]"});
    model.component("comp1").material("mat6").propertyGroup("def")
         .set("thermalconductivity", new String[]{"0.46[W/(m*K)]"});
    model.component("comp1").material("mat6").propertyGroup("def").set("density", new String[]{"930[kg/m^3]"});
    model.component("comp1").material("mat6").propertyGroup("def")
         .set("heatcapacity", new String[]{"2302[J/(kg*K)]"});
    model.component("comp1").material("mat7").propertyGroup("def").set("relpermeability", new String[]{"1"});
    model.component("comp1").material("mat7").propertyGroup("def")
         .set("electricconductivity", new String[]{"2[S/m]"});
    model.component("comp1").material("mat7").propertyGroup("def").set("relpermittivity", new String[]{"2.25"});
    model.component("comp1").material("mat7").propertyGroup("def")
         .set("thermalconductivity", new String[]{"10[W/(m*K)]"});
    model.component("comp1").material("mat7").propertyGroup("def").set("density", new String[]{"1055[kg/m^3]"});
    model.component("comp1").material("mat7").propertyGroup("def")
         .set("heatcapacity", new String[]{"2405[J/(kg*K)]"});
    model.component("comp1").material("mat8").propertyGroup("def").set("relpermeability", new String[]{"1"});
    model.component("comp1").material("mat8").propertyGroup("def")
         .set("electricconductivity", new String[]{"3.2e-9[S/m]"});
    model.component("comp1").material("mat8").propertyGroup("def").set("relpermittivity", new String[]{"3.16"});
    model.component("comp1").material("mat8").propertyGroup("def")
         .set("thermalconductivity", new String[]{"0.17[W/(m*K)]"});
    model.component("comp1").material("mat8").propertyGroup("def").set("density", new String[]{"1062[kg/m^3]"});
    model.component("comp1").material("mat8").propertyGroup("def")
         .set("heatcapacity", new String[]{"1885[J/(kg*K)]"});
    model.component("comp1").material("mat9").propertyGroup("def").set("relpermeability", new String[]{"x"});
    model.component("comp1").material("mat9").propertyGroup("def").set("electricconductivity", new String[]{"x"});
    model.component("comp1").material("mat9").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"x"});
    model.component("comp1").material("mat9").propertyGroup("def").set("heatcapacity", new String[]{"x"});
    model.component("comp1").material("mat9").propertyGroup("def").set("relpermittivity", new String[]{"x"});
    model.component("comp1").material("mat9").propertyGroup("def").set("density", new String[]{"x"});
    model.component("comp1").material("mat9").propertyGroup("def").set("thermalconductivity", new String[]{"x"});
    model.component("comp1").material("mat9").propertyGroup("Enu").set("E", new String[]{"x"});
    model.component("comp1").material("mat9").propertyGroup("Enu").set("nu", new String[]{"x"});
    model.component("comp1").material("mat9").propertyGroup("RefractiveIndex").set("n", new String[]{"x"});
    model.component("comp1").material("mat9").propertyGroup("RefractiveIndex").set("ki", new String[]{"x"});
    model.material().label("Materials.");
    model.component("comp1").material("mat9").propertyGroup("def").set("relpermeability", new String[]{"1"});
    model.component("comp1").material("mat9").propertyGroup("def")
         .set("electricconductivity", new String[]{"1e-14[S/m]"});
    model.component("comp1").material("mat9").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"0.55e-6[1/K]"});
    model.component("comp1").material("mat9").propertyGroup("def")
         .set("heatcapacity", new String[]{"703[J/(kg*K)]"});
    model.component("comp1").material("mat9").propertyGroup("def").set("relpermittivity", new String[]{"3.75"});
    model.component("comp1").material("mat9").propertyGroup("def").set("density", new String[]{"2203[kg/m^3]"});
    model.component("comp1").material("mat9").propertyGroup("def")
         .set("thermalconductivity", new String[]{"1.38[W/(m*K)]"});
    model.component("comp1").material("mat9").propertyGroup("Enu").set("E", new String[]{"73.1e9[Pa]"});
    model.component("comp1").material("mat9").propertyGroup("Enu").set("nu", new String[]{"0.17"});
    model.component("comp1").material("mat9").propertyGroup("RefractiveIndex").set("n", new String[]{"1.45"});
    model.component("comp1").material("mat9").propertyGroup("RefractiveIndex").set("ki", new String[]{"0"});
    model.component("comp1").material("mat10").propertyGroup("def").set("relpermeability", new String[]{"1"});
    model.component("comp1").material("mat10").propertyGroup("def")
         .set("electricconductivity", new String[]{"1.46e6[S/m]"});
    model.component("comp1").material("mat10").propertyGroup("def").set("relpermittivity", new String[]{"1"});
    model.component("comp1").material("mat10").propertyGroup("def")
         .set("thermalconductivity", new String[]{"17.5[W/(m*K)]"});
    model.component("comp1").material("mat10").propertyGroup("def").set("density", new String[]{"7920[kg/m^3]"});
    model.component("comp1").material("mat10").propertyGroup("def")
         .set("heatcapacity", new String[]{"475[J/(kg*K)]"});
    model.component("comp1").material("mat11").propertyGroup("def").set("relpermittivity", new String[]{"1"});
    model.component("comp1").material("mat11").propertyGroup("def").set("density", new String[]{"8940[kg/m^3]"});
    model.component("comp1").material("mat11").propertyGroup("def")
         .set("heatcapacity", new String[]{"385[J/(kg*K)]"});
    model.component("comp1").material("mat12").propertyGroup("def").set("relpermittivity", new String[]{"1"});
    model.component("comp1").material("mat12").propertyGroup("def")
         .set("thermalconductivity", new String[]{"35.3[W/(m*K)]"});
    model.component("comp1").material("mat12").propertyGroup("def").set("density", new String[]{"11340[kg/m^3]"});
    model.component("comp1").material("mat12").propertyGroup("def")
         .set("heatcapacity", new String[]{"127[J/(kg*K)]"});
    model.component("comp1").material("mat13").propertyGroup("def").set("relpermittivity", new String[]{"1"});
    model.component("comp1").material("mat13").propertyGroup("def")
         .set("thermalconductivity", new String[]{"58[W/(m*K)]"});
    model.component("comp1").material("mat13").propertyGroup("def").set("density", new String[]{"7850[kg/m^3]"});
    model.component("comp1").material("mat13").propertyGroup("def")
         .set("heatcapacity", new String[]{"475[J/(kg*K)]"});
    model.material().label("Materials");

    model.component("comp1").mesh("mesh1").run();

    model.title("Submarine Cable 1 \u2014 Introduction");

    model
         .description("The model that results from this tutorial serves as a template for subsequent tutorials in this series (the Capacitive, Inductive, and Thermal Effects tutorials). It contains a detailed 2D geometry of a standard three-core lead sheathed XLPE HVAC submarine cable, along with a mesh. Some parameters, selections, and materials are prepared as well.\n\nExperienced COMSOL users with little or no interest in these topics \u2014 geometry, mesh, selections, and such \u2014 may choose to skip this part of the series and continue with one of the following tutorials. When you are new to COMSOL Multiphysics, however, it is worthwhile to take some time for this, as it will help you to familiarize yourself with the basics.");

    model.label("submarine_cable_01_introduction.mph");

    model.param().create("par3");
    model.param("par3").label("Electromagnetic Parameters");

//    To import content from file, use:
//    model.param("par3").loadFile("FILENAME");
    model.param("par3").set("f0", "50[Hz]", "Operating frequency");
    model.param("par3").set("w0", "(2*pi*f0[1/Hz])[rad/s]", "Angular frequency");
    model.param("par3").set("V0", "220[kV]/sqrt(3)", "Phase to ground voltage (amplitude)");
    model.param("par3").set("I0", "655[A]*sqrt(2)", "Rated current (amplitude)");
    model.param("par3").set("Scup", "5.96e7[S/m]", "Copper conductivity, at 20\u00b0C");
    model.param("par3").set("Spbs", "4.55e6[S/m]", "Lead sheath conductivity, at 20\u00b0C");
    model.param("par3").set("Sarm", "4.03e6[S/m]", "Armor wire conductivity, at 20\u00b0C");
    model.param("par3").set("Mcup", "1", "Relative permeability, copper");
    model.param("par3").set("Mpbs", "1", "Relative permeability, lead sheath");
    model.param("par3").set("Marm", "100-50*j", "Relative permeability, armor wires");
    model.param("par3")
         .set("Dscup", "min(1/real(sqrt(j*w0*mu0_const*Mcup*Scup)),Dcon/3)", "Skin depth, copper (analytic)");
    model.param("par3")
         .set("Dspbs", "min(1/real(sqrt(j*w0*mu0_const*Mpbs*Spbs)),12*Tpbs)", "Skin depth, lead sheath (analytic)");
    model.param("par3")
         .set("Dsarm", "min(1/real(sqrt(j*w0*mu0_const*Marm*Sarm)),Tarm/2)", "Skin depth, armor wires (analytic)");
    model.param("par3")
         .set("Rcon", "1/Acon/Scup", "Main conductor DC resistance per phase, at 20\u00b0C (analytic)");
    model.param("par3").set("Rpbs", "1/Apbs/Spbs", "Lead sheath DC resistance per phase, at 20\u00b0C (analytic)");
    model.param("par3").set("Exlpe", "2.5", "Relative permittivity XLPE (from IEC 60287)");
    model.param("par3")
         .set("Cpha", "2*pi*epsilon0_const*Exlpe/log((Dins/2-Tscc)/(Dcon/2+Tscc))", "Capacitance per phase (analytic)");
    model.param("par3").set("Icpha", "w0*Cpha*V0", "Charging current per phase (analytic)");

    model.component("comp1").physics().create("mf", "InductionCurrents", "geom1");
    model.component("comp1").physics("mf").selection().named("geom1_c22_dom");
    model.component("comp1").physics("mf").create("als1", "AmperesLawSolid", 2);
    model.component("comp1").physics("mf").feature("als1").selection().named("dif3");

    model.study().create("std1");
    model.study("std1").create("freq", "Frequency");
    model.study("std1").feature("freq").set("plist", "f0");
    model.study("std1").showAutoSequences("all");

    model.sol("sol1").feature("s1").feature().remove("p1");

    model.component("comp1").material("mat6").propertyGroup("def").set("relpermittivity", new String[]{"Exlpe"});
    model.component("comp1").material("mat11").propertyGroup("def").set("relpermeability", new String[]{"Mcup"});
    model.component("comp1").material("mat11").propertyGroup("def")
         .set("electricconductivity", new String[]{"Ncon*Scup"});
    model.component("comp1").material("mat12").propertyGroup("def").set("relpermeability", new String[]{"Mpbs"});
    model.component("comp1").material("mat12").propertyGroup("def")
         .set("electricconductivity", new String[]{"Spbs"});
    model.component("comp1").material("mat13").propertyGroup("def").set("relpermeability", new String[]{"Marm"});
    model.component("comp1").material("mat13").propertyGroup("def")
         .set("electricconductivity", new String[]{"Sarm"});

    model.component("comp1").physics("mf").create("coil1", "Coil", 2);
    model.component("comp1").physics("mf").feature("coil1").label("Phase 1");
    model.component("comp1").physics("mf").feature("coil1").selection().named("geom1_c1_dom");
    model.component("comp1").physics("mf").feature("coil1").set("ICoil", "I0");
    model.component("comp1").physics("mf").create("coil2", "Coil", 2);
    model.component("comp1").physics("mf").feature("coil2").label("Phase 2");
    model.component("comp1").physics("mf").feature("coil2").selection().named("geom1_c2_dom");
    model.component("comp1").physics("mf").feature("coil2").set("ICoil", "I0*exp(-120[deg]*j)");
    model.component("comp1").physics("mf").create("coil3", "Coil", 2);
    model.component("comp1").physics("mf").feature("coil3").label("Phase 3");
    model.component("comp1").physics("mf").feature("coil3").selection().named("geom1_c3_dom");
    model.component("comp1").physics("mf").feature("coil3").set("ICoil", "I0*exp(+120[deg]*j)");

    model.study("std1").setGenPlots(false);
    model.study("std1").createAutoSequences("all");

    model.sol("sol1").runAll();

    model.result().create("pg1", "PlotGroup2D");
    model.result("pg1").run();
    model.result("pg1").label("Magnetic Flux Density Norm (mf)");
    model.result("pg1").create("surf1", "Surface");
    model.result("pg1").feature("surf1").set("evaluationsettings", "parent");
    model.result("pg1").run();
    model.result("pg1").run();
    model.result("pg1").set("view", "new");
    model.result("pg1").run();
    model.result("pg1").run();
    model.result("pg1").feature("surf1").set("colortable", "Prism");
    model.result("pg1").feature("surf1").set("colortabletrans", "nonlinear");
    model.result("pg1").feature("surf1").set("colorcalibration", -1.5);
    model.result("pg1").feature("surf1").set("evaluationsettings", "manual");
    model.result("pg1").feature("surf1").set("resolution", "fine");
    model.result("pg1").run();
    model.result("pg1").run();
    model.result().duplicate("pg2", "pg1");
    model.result("pg2").run();
    model.result("pg2").label("Out of Plane Current Density (mf)");
    model.result("pg2").set("view", "new");
    model.result("pg2").run();
    model.result("pg2").feature("surf1").set("expr", "mf.normJ");
    model.result("pg2").feature("surf1").set("descr", "Current density norm");
    model.result("pg2").feature("surf1").set("colortabletrans", "none");
    model.result("pg2").run();
    model.result().dataset().duplicate("dset2", "dset1");
    model.result().dataset("dset2").selection().geom("geom1", 2);
    model.result().dataset("dset2").selection().named("geom1_c21_dom");
    model.result().dataset("dset2").selection().geom("geom1", 2);
    model.result().dataset("dset2").selection()
         .set(3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166);
    model.result("pg2").run();
    model.result("pg2").set("data", "dset2");
    model.result("pg2").run();
    model.result().duplicate("pg3", "pg2");
    model.result("pg3").run();
    model.result("pg3").label("Volumetric Loss Density (mf)");
    model.result("pg3").run();
    model.result("pg3").feature("surf1").set("expr", "mf.Qrh");
    model.result("pg3").feature("surf1").set("colortable", "GrayBody");
    model.result("pg3").run();
    model.result("pg1").run();
    model.result("pg1").feature("surf1").set("expr", "sqrt(real(mf.Bx)^2+real(mf.By)^2)");
    model.result("pg1").feature("surf1").set("descractive", true);
    model.result("pg1").feature("surf1").set("descr", "Magnetic flux density norm (instantaneous)");
    model.result("pg1").run();
    model.result("pg1").create("con1", "Contour");
    model.result("pg1").feature("con1").set("evaluationsettings", "parent");
    model.result("pg1").feature("con1").set("expr", "Az");
    model.result("pg1").feature("con1").set("titletype", "none");
    model.result("pg1").feature("con1").set("coloring", "uniform");
    model.result("pg1").feature("con1").set("color", "black");
    model.result("pg1").feature("con1").set("colorlegend", false);
    model.result("pg1").feature("con1").set("evaluationsettings", "manual");
    model.result("pg1").feature("con1").set("resolution", "fine");
    model.result("pg1").run();
    model.result().export().create("anim1", "Animation");
    model.result().export("anim1").set("target", "player");
    model.result().export("anim1").set("fontsize", "9");
    model.result().export("anim1").set("colortheme", "globaltheme");
    model.result().export("anim1").set("customcolor", new double[]{1, 1, 1});
    model.result().export("anim1").set("background", "color");
    model.result().export("anim1").set("gltfincludelines", "on");
    model.result().export("anim1").set("title1d", "on");
    model.result().export("anim1").set("legend1d", "on");
    model.result().export("anim1").set("logo1d", "on");
    model.result().export("anim1").set("options1d", "on");
    model.result().export("anim1").set("title2d", "on");
    model.result().export("anim1").set("legend2d", "on");
    model.result().export("anim1").set("logo2d", "on");
    model.result().export("anim1").set("options2d", "off");
    model.result().export("anim1").set("title3d", "on");
    model.result().export("anim1").set("legend3d", "on");
    model.result().export("anim1").set("logo3d", "on");
    model.result().export("anim1").set("options3d", "off");
    model.result().export("anim1").set("axisorientation", "on");
    model.result().export("anim1").set("grid", "on");
    model.result().export("anim1").set("axes1d", "on");
    model.result().export("anim1").set("axes2d", "on");
    model.result().export("anim1").set("showgrid", "on");
    model.result().export("anim1").set("sweeptype", "dde");
    model.result().export("anim1").set("maxframes", 6);
    model.result().export("anim1").run();
    model.result("pg2").run();
    model.result("pg2").feature("surf1").set("expr", "mf.Jz");
    model.result("pg2").feature("surf1").set("colortable", "Dipole");
    model.result("pg2").feature("surf1").set("colorscalemode", "linearsymmetric");
    model.result("pg2").feature("surf1").create("hght1", "Height");
    model.result("pg2").run();
    model.result("pg2").run();

    model.view("view4").set("showgrid", false);
    model.view("view4").set("showaxisorientation", false);

    model.result("pg2").run();
    model.result().export().create("anim2", "Animation");
    model.result().export("anim2").set("target", "player");
    model.result().export("anim2").set("fontsize", "9");
    model.result().export("anim2").set("colortheme", "globaltheme");
    model.result().export("anim2").set("customcolor", new double[]{1, 1, 1});
    model.result().export("anim2").set("background", "color");
    model.result().export("anim2").set("gltfincludelines", "on");
    model.result().export("anim2").set("title1d", "on");
    model.result().export("anim2").set("legend1d", "on");
    model.result().export("anim2").set("logo1d", "on");
    model.result().export("anim2").set("options1d", "on");
    model.result().export("anim2").set("title2d", "on");
    model.result().export("anim2").set("legend2d", "on");
    model.result().export("anim2").set("logo2d", "on");
    model.result().export("anim2").set("options2d", "off");
    model.result().export("anim2").set("title3d", "on");
    model.result().export("anim2").set("legend3d", "on");
    model.result().export("anim2").set("logo3d", "on");
    model.result().export("anim2").set("options3d", "off");
    model.result().export("anim2").set("axisorientation", "on");
    model.result().export("anim2").set("grid", "on");
    model.result().export("anim2").set("axes1d", "on");
    model.result().export("anim2").set("axes2d", "on");
    model.result().export("anim2").set("showgrid", "on");
    model.result().export("anim2").set("plotgroup", "pg2");
    model.result().export("anim2").set("sweeptype", "dde");
    model.result().export("anim2").set("maxframes", 6);
    model.result().export("anim2").run();
    model.result().numerical().create("int1", "IntSurface");
    model.result().numerical("int1").set("intvolume", true);
    model.result().numerical("int1").label("Phase Losses");
    model.result().numerical("int1").selection().named("uni1");
    model.result().numerical("int1").setIndex("expr", "mf.Qh", 0);
    model.result().numerical("int1").setIndex("unit", "W/km", 0);
    model.result().numerical("int1").setIndex("descr", "Phase losses (plain 2D model)", 0);
    model.result().table().create("tbl1", "Table");
    model.result().table("tbl1").comments("Phase Losses");
    model.result().numerical("int1").set("table", "tbl1");
    model.result().numerical("int1").setResult();
    model.result().numerical().create("int2", "IntSurface");
    model.result().numerical("int2").set("intvolume", true);
    model.result().numerical("int2").label("Screen Losses");
    model.result().numerical("int2").selection().named("geom1_uni3_dom");
    model.result().numerical("int2").setIndex("expr", "mf.Qh", 0);
    model.result().numerical("int2").setIndex("unit", "W/km", 0);
    model.result().numerical("int2").setIndex("descr", "Screen losses (plain 2D model)", 0);
    model.result().table().create("tbl2", "Table");
    model.result().table("tbl2").comments("Screen Losses");
    model.result().numerical("int2").set("table", "tbl2");
    model.result().numerical("int2").setResult();
    model.result().numerical().create("int3", "IntSurface");
    model.result().numerical("int3").set("intvolume", true);
    model.result().numerical("int3").label("Armor Losses");
    model.result().numerical("int3").selection().named("geom1_c19_dom");
    model.result().numerical("int3").setIndex("expr", "mf.Qh", 0);
    model.result().numerical("int3").setIndex("unit", "W/km", 0);
    model.result().numerical("int3").setIndex("descr", "Armor losses (plain 2D model)", 0);
    model.result().table().create("tbl3", "Table");
    model.result().table("tbl3").comments("Armor Losses");
    model.result().numerical("int3").set("table", "tbl3");
    model.result().numerical("int3").setResult();
    model.result().numerical().create("gev1", "EvalGlobal");
    model.result().numerical("gev1").label("Phase AC Resistance");
    model.result().numerical("gev1").setIndex("expr", "(mf.RCoil_1/1[m]+mf.RCoil_2/1[m]+mf.RCoil_3/1[m])/3", 0);
    model.result().numerical("gev1").setIndex("unit", "mohm/km", 0);
    model.result().numerical("gev1").setIndex("descr", "Phase AC resistance (plain 2D model)", 0);
    model.result().table().create("tbl4", "Table");
    model.result().table("tbl4").comments("Phase AC Resistance");
    model.result().numerical("gev1").set("table", "tbl4");
    model.result().numerical("gev1").setResult();
    model.result().numerical().create("gev2", "EvalGlobal");
    model.result().numerical("gev2").label("Phase Inductance");
    model.result().numerical("gev2").setIndex("expr", "(mf.LCoil_1/1[m]+mf.LCoil_2/1[m]+mf.LCoil_3/1[m])/3", 0);
    model.result().numerical("gev2").setIndex("unit", "mH/km", 0);
    model.result().numerical("gev2").setIndex("descr", "Phase inductance (plain 2D model)", 0);
    model.result().table().create("tbl5", "Table");
    model.result().table("tbl5").comments("Phase Inductance");
    model.result().numerical("gev2").set("table", "tbl5");
    model.result().numerical("gev2").setResult();

    model.component("comp1").physics("mf").create("coil4", "Coil", 2);
    model.component("comp1").physics("mf").feature("coil4").label("Cable Armor");
    model.component("comp1").physics("mf").feature("coil4").selection().named("geom1_c19_dom");
    model.component("comp1").physics("mf").feature("coil4").set("coilGroup", true);
    model.component("comp1").physics("mf").feature("coil4").set("CoilExcitation", "Voltage");
    model.component("comp1").physics("mf").feature("coil4").set("VCoil", "0[V]");

    model.study("std1").createAutoSequences("all");

    model.sol("sol1").runAll();

    model.result("pg1").run();
    model.result("pg1").run();
    model.result("pg2").run();
    model.result("pg2").run();
    model.result().export("anim2").showFrame();
    model.result().export("anim2").run();
    model.result().numerical("int1").setIndex("descr", "Phase losses (2.5D model)", 0);
    model.result().numerical("int1").set("table", "tbl1");
    model.result().numerical("int1").appendResult();
    model.result().numerical("int2").setIndex("descr", "Screen losses (2.5D model)", 0);
    model.result().numerical("int2").set("table", "tbl2");
    model.result().numerical("int2").appendResult();
    model.result().numerical("int3").setIndex("descr", "Armor losses (2.5D model)", 0);
    model.result().numerical("int3").set("table", "tbl3");
    model.result().numerical("int3").appendResult();
    model.result().numerical("gev1").setIndex("descr", "Phase AC resistance (2.5D model)", 0);
    model.result().numerical("gev1").set("table", "tbl4");
    model.result().numerical("gev1").appendResult();
    model.result().numerical("gev2").setIndex("descr", "Phase inductance (2.5D model)", 0);
    model.result().numerical("gev2").set("table", "tbl5");
    model.result().numerical("gev2").appendResult();
    model.result().dataset("dset2").selection().named("geom1_c21_dom");
    model.result("pg2").run();
    model.result("pg2").feature("surf1").set("expr", "mf.normJ");
    model.result("pg2").feature("surf1").set("colortable", "Prism");
    model.result("pg2").feature("surf1").set("colorscalemode", "linear");
    model.result("pg2").run();

    model.component("comp1").physics("mf").feature("coil1").set("ConductorModel", "Multi");
    model.component("comp1").physics("mf").feature("coil1").set("N", 1);
    model.component("comp1").physics("mf").feature("coil1").set("sigmaCoil", "Scup");
    model.component("comp1").physics("mf").feature("coil1").set("AreaFrom", "UserDefined");
    model.component("comp1").physics("mf").feature("coil1").set("coilWindArea", "Acon");
    model.component("comp1").physics("mf").feature("coil1").set("HarmonicLoss", false);
    model.component("comp1").physics("mf").feature("coil2").set("ConductorModel", "Multi");
    model.component("comp1").physics("mf").feature("coil2").set("N", 1);
    model.component("comp1").physics("mf").feature("coil2").set("sigmaCoil", "Scup");
    model.component("comp1").physics("mf").feature("coil2").set("AreaFrom", "UserDefined");
    model.component("comp1").physics("mf").feature("coil2").set("coilWindArea", "Acon");
    model.component("comp1").physics("mf").feature("coil2").set("HarmonicLoss", false);
    model.component("comp1").physics("mf").feature("coil3").set("ConductorModel", "Multi");
    model.component("comp1").physics("mf").feature("coil3").set("N", 1);
    model.component("comp1").physics("mf").feature("coil3").set("sigmaCoil", "Scup");
    model.component("comp1").physics("mf").feature("coil3").set("AreaFrom", "UserDefined");
    model.component("comp1").physics("mf").feature("coil3").set("coilWindArea", "Acon");
    model.component("comp1").physics("mf").feature("coil3").set("HarmonicLoss", false);

    model.study("std1").createAutoSequences("all");

    model.sol("sol1").runAll();

    model.result("pg1").run();
    model.result("pg2").run();
    model.result("pg2").run();
    model.result().numerical("int1").setIndex("descr", "Phase losses (2.5D+Milliken)", 0);
    model.result().numerical("int1").set("table", "tbl1");
    model.result().numerical("int1").appendResult();
    model.result().numerical("int2").setIndex("descr", "Screen losses (2.5D+Milliken)", 0);
    model.result().numerical("int2").set("table", "tbl2");
    model.result().numerical("int2").appendResult();
    model.result().numerical("int3").setIndex("descr", "Armor losses (2.5D+Milliken)", 0);
    model.result().numerical("int3").set("table", "tbl3");
    model.result().numerical("int3").appendResult();
    model.result().numerical("gev1").setIndex("descr", "Phase AC resistance (2.5D+Milliken)", 0);

    return model;
  }

  public static Model run3(Model model) {
    model.result().numerical("gev1").setIndex("expr", "Rcon", 1);
    model.result().numerical("gev1").setIndex("unit", "mohm/km", 1);
    model.result().numerical("gev1").set("table", "tbl4");
    model.result().numerical("gev1").appendResult();
    model.result().numerical("gev2").setIndex("descr", "Phase inductance (2.5D+Milliken)", 0);
    model.result().numerical("gev2").set("table", "tbl5");
    model.result().numerical("gev2").appendResult();
    model.result().export("anim1").showFrame();
    model.result().export("anim1").set("maxframes", 60);
    model.result().export("anim1").set("repeat", "forever");
    model.result().export("anim2").showFrame();
    model.result().export("anim2").set("maxframes", 60);
    model.result().export("anim2").set("repeat", "forever");
    model.result("pg2").run();
    model.result("pg2").run();

    model.view("view4").set("showgrid", true);
    model.view("view4").set("showaxisorientation", true);

    model.result("pg2").run();
    model.result("pg1").run();
    model.result("pg1").run();

    model.title("Submarine Cable 4 \u2014 Inductive Effects");

    model
         .description("Results from the Capacitive Effects and Bonding Capacitive tutorials (the previous tutorials in this series) show there is only a weak coupling between the inductive and capacitive phenomena in the cable. In addition to this, 3D twist models show that 2D and 2.5D inductive models are able to provide a good approximation of the cable\u2019s lumped quantities, and at only a fraction of the computational cost.\n\nThis justifies a 2D/2.5D inductive model that includes out-of-plane currents only. The model demonstrates methods suitable to approximate the armor twist, as well as certain milliken conductor designs. It serves as a basis and a reference for the Thermal Effects and the Inductive Effects 3D tutorials (chapters 6, and 8). Verification is included: the results are compared to the cable\u2019s official specifications.");

    model.label("submarine_cable_04_inductive_effects.mph");

    model.result("pg1").run();

//    This tutorial will focus on thermal effects. The model is a modified version of the one resulting from the Inductive Effects tutorial (chapter 4). It is available in the Application Libraries folder as submarine_cable_04_inductive_effects.mph .
//    Root
//    You can start by opening this file and saving it under a new name.
//    From the File menu, choose Open .
//    Browse to the model's Application Libraries folder and double-click the file submarine_cable_04_inductive_effects.mph .
//    From the File menu, choose Save As .
//    Browse to a suitable folder and type the filename submarine_cable_06_thermal_effects.mph .
//    Proceed by restoring the plain 2D configuration. That is; set the phases back to Single conductor and remove the coil group from the armor:
//    In the Model Builder window, expand the Component 1 (comp1) node.
//    The settings window for the coil feature contains a lot of sections. For many of these, the default settings are sufficient. Collapse them to have a closer look at the important part; the Coil section.
//    In the Model Builder window, expand the Component 1 (comp1) > Magnetic Fields (mf) node, then click Phase 1.
//    Click to collapse the Material Type section, the Coordinate System Selection section, and the Constitutive Relation sections.
//    Next, continue by setting the conductor model.
//    In the Settings window for Domain Coil, locate the Coil section.
//    From the Conductor model list, select Single conductor.

    model.component("comp1").physics("mf").feature("coil1").set("ConductorModel", "Single");

//    Phase 2, Phase 3
//    Repeat this step for Phase 2 , and Phase 3 .

    model.component("comp1").physics("mf").feature("coil2").set("ConductorModel", "Single");
    model.component("comp1").physics("mf").feature("coil3").set("ConductorModel", "Single");

//    In the Model Builder window, right-click Cable Armor and choose Delete.

    model.component("comp1").physics("mf").feature().remove("coil4");

//    Some parameters have been prepared for doing the thermal analysis. You can load them from a file.
//    In the Home toolbar, click Parameters and choose Add > Parameters.

    model.param().create("par4");

//    In the Settings window for Parameters, type Thermal Parameters in the Label text field.

    model.param("par4").label("Thermal Parameters");

//    Locate the Parameters section.
//    Click Load from File.
//    Browse to the model's Application Library folder and double-click the file submarine_cable_d_therm_parameters.txt.
//    To import content from file, use:
//    model.param("par4").loadFile("FILENAME");
    model.param("par4").set("Ntcon", "0.075281", "Main conductor thermal packing density (phase)");
    model.param("par4").set("Tmcon", "89.4[degC]", "Average temperature of main conductors (phase)");
    model.param("par4").set("Tmpbs", "82.7[degC]", "Average screen temperature (lead sheath)");
    model.param("par4").set("Tmarm", "70.1[degC]", "Average temperature of armor ring");
    model.param("par4").set("Tmext", "20[degC]", "External temperature (sea bed)");
    model.param("par4").set("Tmref", "20[degC]", "Linearized resistivity reference temperature");
    model.param("par4").set("R0cup", "1/Scup", "Reference resistivity, copper, at 20\u00b0C");
    model.param("par4").set("R0pbs", "1/Spbs", "Reference resistivity, lead sheath, at 20\u00b0C");
    model.param("par4").set("R0arm", "1/Sarm", "Reference resistivity, armor wires, at 20\u00b0C");
    model.param("par4").set("ALcup", "3.9e-3[1/K]", "Resistivity temperature coefficient, copper");
    model.param("par4").set("ALpbs", "3.86e-3[1/K]", "Resistivity temperature coefficient, lead sheath");
    model.param("par4").set("ALarm", "5.3e-3[1/K]", "Resistivity temperature coefficient, armor wires");

//    Twelve new parameters have been added. The last seven are used for temperature dependent material properties and Tmext refers to the external temperature.
//    The parameters Tmcon , Tmpbs , and Tmarm may require a further explanation. They are the expected average temperatures for the phases, screens and armor, respectively. They have been obtained from a model like this one, and will be validated later on. Their main purpose is to provide a good temperature estimate in 3D models with linearized resistivity, without actually having to solve a fully coupled 3D induction heating model (for more on this, see the Inductive Effects 3D tutorial).
//    Furthermore, Ntcon is used for the thermal properties of the stranded phase conductors (the model uses an effective material ). Depending on the kind of insulation (if any) between the strands, the anisotropic structure may significantly influence the thermal conductivity. The thermal energy will have to cross barriers of insulating material in order to escape in the radial direction.
//    A thermal 2D model that resolves the strands in detail will show you the cross sectional thermal resistivity in the core may increase up to 13 times for certain types of insulation (as compared to solid copper). However, the same model shows that the resulting temperature increase is rather small (about 0.1°C). As it turns out, the temperature in the core is dictated by the properties of the thermal insulators surrounding it, rather than the thermal conductivity in the core itself. Even so, now that a good approximation of the value Ntcon is known, we might just as well make use of it.
//    Let us proceed by adding the Heat Transfer in Solids interface, and a multiphysics coupling:
//    In the Home toolbar, click Add Physics to open the Add Physics window.
//    In the tree, select Heat Transfer > Heat Transfer in Solids (ht).
//    Click Add to Component 1 in the window toolbar.

    model.component("comp1").physics().create("ht", "HeatTransfer", "geom1");

//    In the Home toolbar, click Add Physics to close the Add Physics window.
//    In the Settings window for Heat Transfer in Solids, locate the Domain Selection section.
//    From the Selection list, select Thermal Domains.

    model.component("comp1").physics("ht").selection().named("geom1_r1_dom");

//    Click the Zoom to Selection button in the Graphics toolbar.
//    Multiphysics
//    In the Physics toolbar, click Multiphysics Couplings and choose Domain > Electromagnetic Heating.

    model.component("comp1").multiphysics().create("emh1", "ElectromagneticHeating", 2);

//    In the Settings window for Electromagnetic Heating, locate the Domain Selection section.
//    From the Selection list, select Electromagnetic Domains.

    model.component("comp1").multiphysics("emh1").selection().named("geom1_c22_dom");

//    Click the Zoom to Selection button in the Graphics toolbar.
//    Locate the Boundary Selection section.
//    Click Clear Selection.

    model.component("comp1").multiphysics("emh1").selection("BoundarySelection").set();

//    Before adding a new study, you can remove the old one. That will automatically clean unnecessary clutter from the Results part of the model. This is because removing Study 1 , will also remove everything referring to it — either directly or indirectly (plot groups, domain integrals, ... and such). The items in Derived Values you want to keep, however. To this end, you should decouple them from the dataset.
//    In the Model Builder window, expand the Results > Derived Values node, then click Phase Losses.
//    In the Settings window for Surface Integration, locate the Data section.
//    From the Dataset list, select None.

    model.result().numerical("int1").set("data", "none");

//    Screen and Armor Losses, Phase AC Resistance and Inductance
//    Repeat these steps for Screen Losses , Armor Losses , Phase AC Resistance , and Phase Inductance .

    model.result().numerical("int2").set("data", "none");
    model.result().numerical("int3").set("data", "none");
    model.result().numerical("gev1").set("data", "none");
    model.result().numerical("gev2").set("data", "none");

//    Next, remove the existing study and create a new one.

    model.study().remove("std1");

//    Study 1
//    In the Model Builder window, right-click Study 1 and choose Delete (when asked whether to remove the associated result nodes, choose Yes ).
//    In the Home toolbar, click Add Study to open the Add Study window.
//    Find the Studies subsection.
//    In the Select Study tree, select Preset Studies for Selected Multiphysics > Frequency–Stationary.
//    Right-click and choose Add Study.

    model.study().create("std1");
    model.study("std1").create("fstat", "FrequencyStationary");
    model.study("std1").feature("fstat").set("freq", "1000000");
    model.study("std1").feature("fstat").set("solnum", "auto");
    model.study("std1").feature("fstat").set("notsolnum", "auto");
    model.study("std1").feature("fstat").set("outputmap", new String[]{});
    model.study("std1").feature("fstat").set("ngenAUX", "1");
    model.study("std1").feature("fstat").set("goalngenAUX", "1");
    model.study("std1").feature("fstat").set("ngenAUX", "1");
    model.study("std1").feature("fstat").set("goalngenAUX", "1");

//    In the Home toolbar, click Add Study to close the Add Study window.
//    In the Settings window for Frequency–Stationary, locate the Study Settings section.
//    In the Frequency text field, type f0.

    model.study("std1").feature("fstat").set("freq", "f0");

//    Most of the material properties have already been prepared in the Introduction tutorial and the Inductive Effects tutorial. The effective thermal conductivity of the main conductors has not yet been set however, as it depends on the parameter Ntcon .
//    In the Model Builder window, expand the Component 1 (comp1) > Materials node, then click Copper (mat11).
//    In the Settings window for Material, locate the Material Contents section.
//    In the table, enter the following settings:

    model.component("comp1").material("mat11").propertyGroup("def")
         .set("thermalconductivity", new String[]{"Ntcon*400[W/(m*K)]"});

//    In case you are wondering; the material properties for linearized resistivity will be discussed later .
//    In order to model the thermal contact resistance between the cable's components, a Thin Layer boundary feature will be used. For this, a boundary material is added.
//    In the Model Builder window, right-click Component 1 (comp1) > Materials > Air (mat1) and choose Duplicate.

    model.component("comp1").material().duplicate("mat14", "mat1");

//    In the Settings window for Material, type Thermal Contact Layer in the Label text field.

    model.component("comp1").material("mat14").label("Thermal Contact Layer");

//    Locate the Geometric Entity Selection section.
//    From the Geometric entity level list, select Boundary.

    model.component("comp1").material("mat14").selection().geom("geom1", 1);

//    From the Selection list, select Thermal Contact.

    model.component("comp1").material("mat14").selection().named("adj1");

//    Click the Zoom to Selection button in the Graphics toolbar.
//    Notice that for the air, some of the material properties are given by a function, rather than a constant. You can find and plot these functions by expanding the material's node in the Model Builder tree.
//    Please be aware that in the end, many of the material properties used in this model will be either ignored, overridden or proven to be insignificant (as seen in the Capacitive and Inductive Effects tutorials). In case of this particular study type for example, the density and the heat capacity are not strictly needed (as transient thermal effects are neglected). For the sake of completeness, they are listed anyway.
//    Modeling Instructions — One-Way Induction Heating
//    Now that the materials have been set and double-checked, let us have a look at the physics.
//    In the Physics toolbar, click Boundaries and choose Thin Layer.

    model.component("comp1").physics("ht").create("sls1", "SolidLayeredShell", 1);

//    In the Settings window for Thin Layer, locate the Boundary Selection section.
//    From the Selection list, select Thermal Contact.

    model.component("comp1").physics("ht").feature("sls1").selection().named("adj1");

//    Locate the Shell Properties section.
//    From the Shell type list, select Nonlayered shell.

    model.component("comp1").physics("ht").feature("sls1").set("lth_mat", "userdef");

//    In the \[L_\textrm{th}\] text field, type 20[um].

    model.component("comp1").physics("ht").feature("sls1").set("lth", "20[um]");

//    Here, we intend to approximate a thermal contact resistance by adding a 20 μm thick layer of air (the Thermally thick approximation is valid for thin, highly resistive layers).
//    Admittedly, this is a bit of a crude way to model a contact resistance. When you have access to the Heat Transfer Module , much better would be to use the Thermal Contact boundary condition, and do some investigation on where it is applicable, and to what extent.
//    In the Physics toolbar, click Boundaries and choose Temperature.

    model.component("comp1").physics("ht").create("temp1", "TemperatureBoundary", 1);

//    Click the Zoom Extents button in the Graphics toolbar.
//    Select Boundaries 1, 2, 3, 5, 10, 11.

    model.component("comp1").physics("ht").feature("temp1").selection().set(1, 2, 3, 5, 10, 11);

//    In the Settings window for Temperature, locate the Temperature section.
//    In the \[T_{\textrm{0}}\] text field, type Tmext.

    model.component("comp1").physics("ht").feature("temp1").set("T0", "Tmext");

//    As you might have noticed, from a thermal viewpoint the model is rather simple. Effects like convection (buoyancy, ocean currents) are not included here. For more information on heat transfer and flow modeling, please have a look at one of the tutorial models in the COMSOL Application Gallery specifically addressing those topics. Proceed by computing the solution.
//    In the Study toolbar, click Compute.

    model.study("std1").createAutoSequences("all");

    model.sol("sol1").runAll();

    model.result().create("pg1", "PlotGroup2D");
    model.result("pg1").label("Magnetic Flux Density (mf)");
    model.result("pg1").set("frametype", "spatial");
    model.result("pg1").set("showlegendsmaxmin", true);
    model.result("pg1").feature().create("surf1", "Surface");
    model.result("pg1").feature("surf1").set("solutionparams", "parent");
    model.result("pg1").feature("surf1").set("colortable", "Prism");
    model.result("pg1").feature("surf1").set("colortabletrans", "nonlinear");
    model.result("pg1").feature("surf1").set("colorcalibration", -0.8);
    model.result("pg1").feature("surf1").set("evaluationsettings", "parent");
    model.result("pg1").feature("surf1").set("data", "parent");
    model.result("pg1").feature().create("str1", "Streamline");
    model.result("pg1").feature("str1").set("solutionparams", "parent");
    model.result("pg1").feature("str1").set("titletype", "none");
    model.result("pg1").feature("str1").set("posmethod", "uniform");
    model.result("pg1").feature("str1").set("udensity", 2);
    model.result("pg1").feature("str1").set("color", "custom");
    model.result("pg1").feature("str1")
         .set("customcolor", new double[]{0.3764705955982208, 0.3764705955982208, 0.3764705955982208});
    model.result("pg1").feature("str1").set("evaluationsettings", "parent");
    model.result("pg1").feature("str1").set("maxlen", 0.4);
    model.result("pg1").feature("str1").set("maxtime", Double.POSITIVE_INFINITY);
    model.result("pg1").feature("str1").set("inheritcolor", false);
    model.result("pg1").feature("str1").set("maxtime", Double.POSITIVE_INFINITY);
    model.result("pg1").feature("str1").set("data", "parent");
    model.result("pg1").feature("str1").selection().geom("geom1", 1);
    model.result("pg1").feature("str1").selection()
         .set(6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664);
    model.result("pg1").feature("str1").set("inheritplot", "surf1");
    model.result("pg1").feature("str1").feature().create("filt1", "Filter");
    model.result("pg1").feature("str1").feature("filt1").set("expr", "!isScalingSystemDomain");
    model.result("pg1").feature().create("con1", "Contour");
    model.result("pg1").feature("con1").set("solutionparams", "parent");
    model.result("pg1").feature("con1").set("expr", "mf.Az");
    model.result("pg1").feature("con1").set("titletype", "none");
    model.result("pg1").feature("con1").set("number", 10);
    model.result("pg1").feature("con1").set("levelrounding", false);
    model.result("pg1").feature("con1").set("coloring", "uniform");
    model.result("pg1").feature("con1").set("colorlegend", false);
    model.result("pg1").feature("con1").set("color", "custom");
    model.result("pg1").feature("con1")
         .set("customcolor", new double[]{0.3764705955982208, 0.3764705955982208, 0.3764705955982208});
    model.result("pg1").feature("con1").set("evaluationsettings", "parent");
    model.result("pg1").feature("con1").set("inheritcolor", false);
    model.result("pg1").feature("con1").set("data", "parent");
    model.result("pg1").feature("con1").set("inheritplot", "surf1");
    model.result("pg1").feature("con1").feature().create("filt1", "Filter");
    model.result("pg1").feature("con1").feature("filt1").set("expr", "!isScalingSystemDomain");
    model.result().create("pg2", "PlotGroup2D");
    model.result("pg2").label("Temperature (ht)");
    model.result("pg2").set("smooth", "internal");
    model.result("pg2").feature().create("surf1", "Surface");
    model.result("pg2").feature("surf1").set("solutionparams", "parent");
    model.result("pg2").feature("surf1").set("expr", "T");
    model.result("pg2").feature("surf1").set("colortable", "HeatCameraLight");
    model.result("pg2").feature("surf1").set("data", "parent");
    model.result("pg1").run();

//    In the Magnetic Flux Density (mf) toolbar, click Plot.

    model.result("pg1").run();

//    The Magnetic Flux Density Norm plot contains a lot of empty space, since the important bit (the cable) comprises only a small part of the total model. Let us focus on the cable by applying a selection to the solution.
//    In the Model Builder window, expand the Results > Datasets node, then click Study 1/Solution 1 (sol1).
//    In the Results toolbar, click Attributes and choose Selection.
//    In the Settings window for Selection, locate the Geometric Entity Selection section.
//    From the Geometric entity level list, select Domain.

    model.result().dataset("dset1").selection().geom("geom1", 2);

//    From the Selection list, select Cable Domains.

    model.result().dataset("dset1").selection().named("geom1_c21_dom");

//    Click the Zoom to Selection button in the Graphics toolbar.

    model.result("pg1").run();

//    The second thing to notice is that the plot is zoomed-in quite a bit. This is because it is still locked to the camera settings used in the geometry and the mesh. Let us give it a separate view. Furthermore, you can fine-tune the surface plot settings to get a better picture of the field. The nonlinear color table transformation will allow you to get a higher resolution in the nonmagnetic domains.
//    In the Model Builder window, under Results, click Magnetic Flux Density (mf).
//    In the Settings window for 2D Plot Group, locate the Plot Settings section.
//    From the View list, select View 2D 2.

    model.result("pg1").set("view", "view2");
    model.result("pg1").run();

//    In the Model Builder window, expand the Magnetic Flux Density (mf) node, then click Surface 1.
//    In the Settings window for Surface, locate the Coloring and Style section.
//    Set the Color calibration parameter value to -1.5.

    model.result("pg1").feature("surf1").set("colorcalibration", -1.5);
    model.result("pg1").run();

//    In the Model Builder window, right-click Streamline 1 and choose Disable.

    model.result("pg1").feature("str1").active(false);
    model.result("pg1").run();

//    In the Model Builder window, click Contour 1.
//    In the Settings window for Contour, locate the Levels section.
//    In the Total levels text field, type 20.

    model.result("pg1").feature("con1").set("number", 20);

//    In the Magnetic Flux Density (mf) toolbar, click Plot.

    model.result("pg1").run();

//    Click the Zoom Extents button in the Graphics toolbar.
//    The plot looks more or less identical to the one we had initially in the Inductive Effects tutorial. We will not spend more time on it here. Next, proceed by investigating the temperatures.

    model.result("pg2").run();

//    In the Model Builder window, under Results, click Temperature (ht).
//    In the Settings window for 2D Plot Group, locate the Plot Settings section.
//    From the View list, select View 2D 2.

    model.result("pg2").set("view", "view2");

//    Locate the Color Legend section.
//    Select the Show maximum and minimum values checkbox.

    model.result("pg2").set("showlegendsmaxmin", true);
    model.result("pg2").run();

//    In the Model Builder window, expand the Temperature (ht) node, then click Surface 1.
//    In the Temperature (ht) toolbar, click Plot.

    model.result("pg2").run();

//    Click the Zoom Extents button in the Graphics toolbar.
//    This is a good start. Let us make it more insightful (that is, more fancy ).
//    In the Settings window for Surface, locate the Expression section.
//    In the Unit field, type degC.

    model.result("pg2").feature("surf1").set("unit", "degC");

//    Click to expand the Quality section.
//    From the Evaluation settings list, select Manual.
//    From the Resolution list, select Fine.

    model.result("pg2").feature("surf1").set("resolution", "fine");

//    Right-click Surface 1 and choose Height Expression.

    model.result("pg2").feature("surf1").create("hght1", "Height");
    model.result("pg2").run();

//    In the Settings window for Height Expression, locate the Expression section.
//    From the Height data list, select Expression.

    model.result("pg2").feature("surf1").feature("hght1").set("heightdata", "expr");

//    In the Expression text field, type T-55[degC].

    model.result("pg2").feature("surf1").feature("hght1").set("expr", "T-55[degC]");
    model.result("pg2").run();

    model.view("view5").set("showgrid", false);
    model.view("view5").set("showaxisorientation", false);

//    In the Temperature (ht) toolbar, click Plot.

    model.result("pg2").run();

//    Click the Go to Default View button in the Graphics toolbar.
//    This shape shows some similarities with the Electric Potential plot in the Capacitive Effects tutorial, in the sense that the metals tend to behave like equipotentials.
//    The poorest thermal conductor seems to be the air. Furthermore, we see the maximum temperature (about 81°C), is not unreasonable: These cables can be loaded continuously up to temperatures of about 90°C. You can continue by checking the effects of this temperature raise on the electromagnetic properties of the cable.
//    In the Model Builder window, under Results > Derived Values, click Phase Losses.
//    In the Settings window for Surface Integration, locate the Data section.
//    From the Dataset list, select Study 1/Solution 1 (sol1).

    model.result().numerical("int1").set("data", "dset1");

//    Locate the Selection section.
//    From the Selection list, select Phases.

    model.result().numerical("int1").selection().named("uni1");

//    In the table, enter the following settings. That is; replace “ W/m ” (the default) with “ W/km ”, and “ 2.5D+Milliken ” with “ one-way ih ”:
//    Locate the Expressions section.
//    In the table, enter the following settings:

    model.result().numerical("int1").setIndex("unit", "W/km", 0);
    model.result().numerical("int1").setIndex("descr", "Phase losses (one-way ih)", 0);

//    Click Evaluate.

    model.result().numerical("int1").set("table", "tbl1");
    model.result().numerical("int1").appendResult();

//    The result should be about 47 kW/km.
//    In the Model Builder window, under Results > Derived Values, click Screen Losses.
//    In the Settings window for Surface Integration, locate the Data section.
//    From the Dataset list, select Study 1/Solution 1 (sol1).

    model.result().numerical("int2").set("data", "dset1");

//    Locate the Selection section.
//    From the Selection list, select Screens.

    model.result().numerical("int2").selection().named("geom1_uni3_dom");

//    Locate the Expressions section.
//    In the table, enter the following settings:

    model.result().numerical("int2").setIndex("unit", "W/km", 0);
    model.result().numerical("int2").setIndex("descr", "Screen losses (one-way ih)", 0);

//    Click Evaluate.

    model.result().numerical("int2").set("table", "tbl2");
    model.result().numerical("int2").appendResult();

//    The result should be about 13 kW/km.
//    In the Model Builder window, under Results > Derived Values, click Armor Losses.
//    In the Settings window for Surface Integration, locate the Data section.
//    From the Dataset list, select Study 1/Solution 1 (sol1).

    model.result().numerical("int3").set("data", "dset1");

//    Locate the Selection section.
//    From the Selection list, select Cable Armor.

    model.result().numerical("int3").selection().named("geom1_c19_dom");

//    Locate the Expressions section.
//    In the table, enter the following settings:

    model.result().numerical("int3").setIndex("unit", "W/km", 0);
    model.result().numerical("int3").setIndex("descr", "Armor losses (one-way ih)", 0);

//    Click Evaluate.

    model.result().numerical("int3").set("table", "tbl3");
    model.result().numerical("int3").appendResult();

//    This should be about 7.6 kW/km.
//    Notice that these values are virtually identical to the ones in the Inductive Effects tutorial (for the plain 2D configuration): The electromagnetic part has not been affected at all by the raise in temperature. This is because for the most dominant lossy domains (the metals), the model does not yet include temperature dependent material properties. Before implementing this, let us first have a look at the thermal parameters and do some reflection on what should happen.
//    Modeling Instructions — Linearized Resistivity (Phases)
//    Proceed by reproducing this result. To this end, you can introduce a temperature dependence for the three main conductors.

    return model;
  }

  public static Model run4(Model model) {
//    In the Model Builder window, under Component 1 (comp1) > Magnetic Fields (mf), click Phase 1.
//    In the Settings window for Domain Coil, locate the Constitutive Relation Jc-E section.
//    From the Conduction model list, select Linearized resistivity.

    model.component("comp1").physics("mf").feature("coil1").set("ConstitutiveRelationJcE", "LinearizedResistivity");

//    Phase 2, Phase 3
//    Repeat these steps for Phase 2 , and Phase 3 .

    model.component("comp1").physics("mf").feature("coil2").set("ConstitutiveRelationJcE", "LinearizedResistivity");
    model.component("comp1").physics("mf").feature("coil3").set("ConstitutiveRelationJcE", "LinearizedResistivity");

//    Materials
//    Now, you will see that COMSOL starts detecting missing material properties. The properties that should be added are listed in the following table. Please check all of them for the correct value, even the ones that are already filled in. Note that for cases like this, a convenient option is to copy-paste the values directly from this *.pdf file to COMSOL .
//    In the Model Builder window, under Component 1 (comp1) > Materials , add the following material properties:

    model.component("comp1").material("mat11").propertyGroup("linzRes").set("rho0", new String[]{"R0cup/Ncon"});
    model.component("comp1").material("mat11").propertyGroup("linzRes").set("alpha", new String[]{"ALcup"});
    model.component("comp1").material("mat11").propertyGroup("linzRes").set("Tref", new String[]{"Tmref"});
    model.component("comp1").material("mat12").propertyGroup("linzRes").set("rho0", new String[]{"R0pbs"});
    model.component("comp1").material("mat12").propertyGroup("linzRes").set("alpha", new String[]{"ALpbs"});
    model.component("comp1").material("mat12").propertyGroup("linzRes").set("Tref", new String[]{"Tmref"});
    model.component("comp1").material("mat13").propertyGroup("linzRes").set("rho0", new String[]{"R0arm"});
    model.component("comp1").material("mat13").propertyGroup("linzRes").set("alpha", new String[]{"ALarm"});
    model.component("comp1").material("mat13").propertyGroup("linzRes").set("Tref", new String[]{"Tmref"});

//    The reference resistivity for copper is divided by Ncon . This is because the phase conductors consist of compacted strands, rather than solid copper. For more information on this, see the Inductive Effects tutorial.
//    Although the material data listed for the lead and steel is not yet used at this point, you can fill them in anyway. They will become useful later on. Now, let us check the results.
//    In the Study toolbar, click Compute.

    model.study("std1").createAutoSequences("all");

    model.sol("sol1").runAll();

    model.result("pg1").run();
    model.result().numerical("int1").setIndex("descr", "Phase losses (linres phases)", 0);

//    In the Model Builder window, under Results > Derived Values, click Phase Losses.
//    In the Settings window for Surface Integration , locate the Expressions section.
//    In the table, update the description. Type Phase losses (linres phases) , that is; replace “ one-way ih ” with “ linres phases ”.
//    In the Settings window for Surface Integration , click Evaluate .
//    Screen Losses, Armor Losses
//    Repeat these steps for Screen Losses and Armor Losses .

    model.result().numerical("int1").set("table", "tbl1");
    model.result().numerical("int1").appendResult();
    model.result().numerical("int2").setIndex("descr", "Screen losses (linres phases)", 0);
    model.result().numerical("int2").set("table", "tbl2");
    model.result().numerical("int2").appendResult();
    model.result().numerical("int3").setIndex("descr", "Armor losses (linres phases)", 0);
    model.result().numerical("int3").set("table", "tbl3");
    model.result().numerical("int3").appendResult();

//    Table
//    Go to the Table window.
//    The losses per kilometer should still be about 13 kW and 7.7 kW for the screens and the armor respectively (virtually unchanged). The phase losses however, should be about 58 kW/km now, an increase of 24%, as predicted.

    model.result("pg2").run();

//    In the Model Builder window, under Results, click Temperature (ht).
//    In the Temperature (ht) toolbar, click Plot.

    model.result("pg2").run();

//    Click the Go to Default View button in the Graphics toolbar.
//    Getting an increase in losses equal to our crude initial guess may look great at first, but when you think about it, it does raise questions. As you can see, due to the additional losses the temperature has risen further; from 81°C to 92°C. With that kind of temperature raise, the increase in losses should actually have been (92-20)*0.004 , which evaluates to 29%. Let us investigate further, by adding linearized resistivity to the screens and armor as well.
//    Modeling Instructions — Linearized Resistivity (Screens and Armor)
//    In the Physics toolbar, click Domains and choose Ampère's Law in Solids.

    model.component("comp1").physics("mf").create("als2", "AmperesLawSolid", 2);

//    In the Settings window for Ampère's Law in Solids, type Screens in the Label text field.

    model.component("comp1").physics("mf").feature("als2").label("Screens");

//    Locate the Domain Selection section.
//    From the Selection list, select Screens.

    model.component("comp1").physics("mf").feature("als2").selection().named("geom1_uni3_dom");

//    The settings window for the Ampère's Law feature contains a lot of sections. For many of these, the default settings are sufficient. Collapse them to have a closer look at the important part; the Constitutive Relation Jc-E section.
//    Click to collapse the Coordinate System Selection section, the Constitutive Relation B-H section, and the Constitutive Relation D-E section.
//    Next, proceed by setting the conduction model.
//    Locate the Constitutive Relation Jc-E section.
//    From the Conduction model list, select Linearized resistivity.

    model.component("comp1").physics("mf").feature("als2").set("ConstitutiveRelationJcE", "LinearizedResistivity");

//    Right-click Screens and choose Duplicate.

    model.component("comp1").physics("mf").feature().duplicate("als3", "als2");

//    In the Settings window for Ampère's Law in Solids, type Cable Armor in the Label text field.

    model.component("comp1").physics("mf").feature("als3").label("Cable Armor");

//    Locate the Domain Selection section.
//    From the Selection list, select Cable Armor.

    model.component("comp1").physics("mf").feature("als3").selection().named("geom1_c19_dom");

//    With elevated temperatures and increased resistance in both the phases, screens, and armor, surely you would expect even more losses and even higher temperatures. Let us see if this reasoning is correct.
//    In the Study toolbar, click Compute.

    model.study("std1").createAutoSequences("all");

    model.sol("sol1").runAll();

    model.result("pg1").run();
    model.result().numerical("int1").setIndex("descr", "Phase losses (coupled ih)", 0);

//    In the Model Builder window, under Results > Derived Values, click Phase Losses.
//    In the Settings window for Surface Integration , locate the Expressions section.
//    In the table, update the description. Type Phase losses (coupled ih) , that is; replace “ linres phases ” with “ coupled ih ”.
//    In the Settings window for Surface Integration , click Evaluate .
//    Screen Losses, Armor Losses
//    Repeat these steps for Screen Losses and Armor Losses .

    model.result().numerical("int1").set("table", "tbl1");
    model.result().numerical("int1").appendResult();
    model.result().numerical("int2").setIndex("descr", "Screen losses (coupled ih)", 0);
    model.result().numerical("int2").set("table", "tbl2");
    model.result().numerical("int2").appendResult();
    model.result().numerical("int3").setIndex("descr", "Armor losses (coupled ih)", 0);
    model.result().numerical("int3").set("table", "tbl3");
    model.result().numerical("int3").appendResult();

//    Table
//    Go to the Table window.
//    As opposed to what you might have expected, the losses in the screens and armor actually went down (by about 14–15% and 11–13% respectively). The phase losses went down as well, albeit slightly. This is because the currents in the screens and armor are induced by the electromotive force (emf) coming from the currents in the central conductors. The currents in the screens and armor are therefore voltage driven : When the resistance goes up, the currents and losses go down.
//    With this new insight, we are also able to explain why our initial guess for the increase in losses was spot on (24%). In the phase conductors there are two competing effects at work: On one hand the increase in losses causes a further rise in temperature, causing more losses and so on. On the other hand, the higher resistivity will suppress voltage driven induction currents. Basically, it means parasitic effects are reduced (the skin depth becomes larger).
//    In our initial guess we used stationary-electric reasoning ; forgetting about transient effects. For \[R_\textrm{dc}\] it would have worked perfectly, and for homogenized multiturn coils too (see section On Coil Domains in the Inductive Effects tutorial). For this case it just happened to “work”, because we forgot about the additional raise in temperature as well.
//    Applying stationary-electric reasoning for approximations and basic understanding is common. Please be aware however, as frequencies go up, this reasoning loses validity. A common pitfall is to apply static reasoning to dynamic phenomena without question . Note for example that the ratio between the AC resistance and the DC resistance \[\eta\] should decrease, as the temperature increases. Let us investigate.
//    In the Model Builder window, click Phase AC Resistance.
//    In the Settings window for Global Evaluation, locate the Data section.
//    From the Dataset list, select Study 1/Solution 1 (sol1).

    model.result().numerical("gev1").set("data", "dset1");

//    In the table, enter the following settings. That is; replace “ Ω/m ” (the default) with “ mohm/km ”, replace “ 2.5D+Milliken ” with “ coupled ih ”, and rewrite the row for Rcon altogether:
//    Locate the Expressions section.
//    In the table, enter the following settings:

    model.result().numerical("gev1").setIndex("unit", "mohm/km", 0);
    model.result().numerical("gev1").setIndex("descr", "Phase AC resistance (coupled ih)", 0);
    model.result().numerical("gev1").setIndex("expr", "Rcon*(1+ALcup*(Tmcon-Tmref))", 1);
    model.result().numerical("gev1")
         .setIndex("descr", "Main conductor DC resistance per phase, at 90\u00b0C (analytic)", 1);

//    Click Evaluate.

    model.result().numerical("gev1").set("table", "tbl4");
    model.result().numerical("gev1").appendResult();

//    In the Model Builder window, click Phase Inductance.
//    In the Settings window for Global Evaluation, locate the Data section.
//    From the Dataset list, select Study 1/Solution 1 (sol1).

    model.result().numerical("gev2").set("data", "dset1");

//    In the table, enter the following settings. That is; replace “ H/m ” (the default) with “ mH/km ”, and “ 2.5D+Milliken ” with “ coupled ih ”:
//    Locate the Expressions section.
//    In the table, enter the following settings:

    model.result().numerical("gev2").setIndex("unit", "mH/km", 0);
    model.result().numerical("gev2").setIndex("descr", "Phase inductance (coupled ih)", 0);

//    Click Evaluate.

    model.result().numerical("gev2").set("table", "tbl5");
    model.result().numerical("gev2").appendResult();

//    The phase AC resistance per kilometer for the fully coupled induction heating model should be about 59 mΩ. The AC/DC ratio \[\eta\] for 20°C is given by dividing the table columns AC resistance, plain 2D , and DC resistance, 20°C , which should evaluate to about 1.57. At 90°C, this ratio ( AC resistance, coupled ih divided by DC resistance, 90°C ) has been reduced to 1.39, confirming our reasoning. Finally, the inductance per kilometer should be about 0.43 mH — the increased resistivity has little effect on it.

    model.result("pg2").run();

//    In the Model Builder window, under Results, click Temperature (ht).
//    In the Temperature (ht) toolbar, click Plot.

    model.result("pg2").run();

//    Click the Go to Default View button in the Graphics toolbar.
//    Already from the plot, you should be able to see the value is about 90°C. Notice this is a decrease with respect to last time. It is in agreement with the reduction in losses we have seen just now.
//    Note that the results obtained here are of particular importance . The plain 2D configuration at room temperature is known to agree well with the 3D twist models at room temperature (when it comes to overall losses and resistance). The plain 2D configuration with fully coupled induction heating and elevated temperatures, should therefore provide a realistic temperature profile for the 3D model.
//    So instead of having to solve a fully coupled 3D induction heating model, you can probe the average temperatures here and use them as a “predetermined temperature distribution” in a 3D model with linearized resistivity applied. To this end, proceed by evaluating the average temperatures for the phases, screens, and armor.
//    In the Results toolbar, click More Derived Values and choose Average > Surface Average.

    model.result().numerical().create("av1", "AvSurface");
    model.result().numerical("av1").set("intvolume", true);

//    In the Settings window for Surface Average, type Average Temperature in the Label text field.

    model.result().numerical("av1").label("Average Temperature");

//    Locate the Selection section.
//    From the Selection list, select Phases.

    model.result().numerical("av1").selection().named("uni1");

//    Locate the Expressions section.
//    In the table, enter the following settings:

    model.result().numerical("av1").setIndex("unit", "degC", 0);
    model.result().numerical("av1").setIndex("descr", "Temperature (phases)", 0);

//    Click Evaluate.

    model.result().table().create("tbl6", "Table");
    model.result().table("tbl6").comments("Average Temperature");
    model.result().numerical("av1").set("table", "tbl6");
    model.result().numerical("av1").setResult();

//    Locate the Selection section.
//    From the Selection list, select Screens.

    model.result().numerical("av1").selection().named("geom1_uni3_dom");
    model.result().numerical("av1").setIndex("descr", "Temperature (screens)", 0);

//    Locate the Expressions section. In the table, update the description. Type Temperature (screens) , that is; replace “ phases ” with “ screens ”.
//    Click Evaluate.

    model.result().numerical("av1").set("table", "tbl6");
    model.result().numerical("av1").appendResult();

//    From the Selection list, select Cable Armor.

    model.result().numerical("av1").selection().named("geom1_c19_dom");
    model.result().numerical("av1").setIndex("descr", "Temperature (armor)", 0);

//    In the table, update the description. Type Temperature (armor) , that is; replace “ screens ” with “ armor ”.
//    Click Evaluate.

    model.result().numerical("av1").set("table", "tbl6");
    model.result().numerical("av1").appendResult();

//    The average temperatures should be about 90°C, 83°C, and 70°C for the phases, screens, and armor respectively (and in agreement with Tmcon , Tmpbs , and Tmarm ).
//    Finally, let us see how the conductivity can be set, such that the cable assumes a certain specified resistance.
//    Modeling Instructions — Preset Resistance
//    In the Inductive Effects tutorial, we have seen that the chosen conductor model ( Single conductor , or Homogenized multiturn ) makes a difference when it comes to the losses. In practice, it may not always be clear which one best approximates the actual conditions.
//    Start by creating a component coupling, to probe for the average phase temperature.
//    In the Definitions toolbar, click Nonlocal Couplings and choose Average.

    model.component("comp1").cpl().create("aveop1", "Average");
    model.component("comp1").cpl("aveop1").set("axisym", true);

//    In the Settings window for Average, locate the Source Selection section.
//    From the Selection list, select Phases.

    model.component("comp1").cpl("aveop1").selection().named("uni1");

//    When this operator is used in global expressions (not related to any particular domain or boundary), it will return the average value of some locally evaluated quantity in the phase domains. For example: “ aveop1(T) ” will return the average phase temperature. This temperature can then be inserted in a known or measured \[R_\textrm{ac}(T)\] relation, to obtain the desired \[R_\textrm{ac}\] value.
//    Proceed by adding an analytic function for \[R_\textrm{ac}(T)\].
//    In the Definitions toolbar, click Analytic.

    model.component("comp1").func().create("an1", "Analytic");

//    In the Settings window for Analytic, type Linearized Resistance in the Label text field.

    model.component("comp1").func("an1").label("Linearized Resistance");

//    In the Function name text field, type Rac.

    model.component("comp1").func("an1").set("funcname", "Rac");

//    Locate the Definition section.
//    In the Expression text field, type 1.39*Rcon*(1+ALcup*(T-Tmref)).

    model.component("comp1").func("an1").set("expr", "1.39*Rcon*(1+ALcup*(T-Tmref))");

//    In the Arguments text field, type T.

    model.component("comp1").func("an1").set("args", "T");

//    Locate the Units section.
//    In the table, enter the following settings:

    model.component("comp1").func("an1").setIndex("argunit", "K", 0);

//    In the Function text field, type ohm/m.

    model.component("comp1").func("an1").set("fununit", "ohm/m");

//    Locate the Plot Parameters section.
//    In the table, enter the following settings:

    model.component("comp1").func("an1").setIndex("plotargs", "80[degC]", 0, 1);
    model.component("comp1").func("an1").setIndex("plotargs", "100[degC]", 0, 2);

//    Click Plot.
//    In other words, this exercise serves as a proof of concept : Feel free to substitute your own temperature dependent resistance here — it does not even have to be an analytic relation, it could be an interpolating curve based on measured data, for example. The true curve will depend on the cable type and the operating conditions.
//    Next, introduce a Global ODEs and DAEs interface to determine the effective copper conductivity.
//    In the Home toolbar, click Add Physics to open the Add Physics window.
//    In the tree, select Mathematics > ODE and DAE Interfaces > Global ODEs and DAEs (ge).
//    Click Add to Component 1 in the window toolbar.

    model.component("comp1").physics().create("ge", "GlobalEquations", "geom1");
    model.component("comp1").physics("ge").prop("EquationForm").set("form", "Automatic");

//    In the Home toolbar, click Add Physics to close the Add Physics window.
//    In the Settings window for Global Equations, locate the Global Equations section.
//    In the table, enter the following settings:

    model.component("comp1").physics("ge").feature("ge1").setIndex("name", "Scup2", 0, 0);
    model.component("comp1").physics("ge").feature("ge1")
         .setIndex("equation", "Rac(aveop1(T))-(mf.RCoil_1/1[m]+mf.RCoil_2/1[m]+mf.RCoil_3/1[m])/3", 0, 0);
    model.component("comp1").physics("ge").feature("ge1").setIndex("initialValueU", "Scup", 0, 0);

//    Locate the Units section.
//    Click Define Dependent Variable Unit.

    model.component("comp1").physics("ge").feature("ge1").set("CustomDependentVariableUnit", "1");
    model.component("comp1").physics("ge").feature("ge1").set("DependentVariableQuantity", "none");

//    In the Dependent variable quantity table, enter the following settings:

    model.component("comp1").physics("ge").feature("ge1").setIndex("CustomDependentVariableUnit", "S/m", 0, 0);

//    Click Define Source Term Unit.

    model.component("comp1").physics("ge").feature("ge1").set("CustomSourceTermUnit", "1");
    model.component("comp1").physics("ge").feature("ge1").set("SourceTermQuantity", "none");

//    In the Source term quantity table, enter the following settings:

    model.component("comp1").physics("ge").feature("ge1").setIndex("CustomSourceTermUnit", "ohm/m", 0, 0);

//    This Global Equation , will introduce an additional dependent variable : Scup2 . Dependent variables are not predefined, nor are they derived from other variables (as is the case for derived variables ). They are the variables to solve for, the unknowns of the system of equations.
//    The new dependent variable comes equipped with a global constraint (the expression of the form: Rac(aveop1(T))-(mf.RCoil_1... ) and an initial value . Starting with that initial value, COMSOL will look for the value Scup2 that satisfies the constraint (that sets it to zero). In other words, solving the model means looking for the value of Scup2 that makes the average phase AC resistance equal to Rac(aveop1(T)) .
//    Using equations like this requires a bit of insight. After all there may be infinitely many values of Scup2 that are valid, or there may be none at all. In those cases the model may give an arbitrary result, or it may not converge in the first place (depending on the solver settings chosen). The next steps are needed to find a unique solution .
//    Click the Show More Options button in the Model Builder toolbar.
//    In the Show More Options dialog, in the tree, select the checkbox for the Physics > Advanced Physics Options node.
//    Click OK.
//    In the Model Builder window, under Component 1 (comp1) > Global ODEs and DAEs (ge), click Global Equations 1 (ODE1).
//    In the Settings window for Global Equations, click to expand the Discretization section.
//    From the Value type when using splitting of complex variables list, select Real.

    model.component("comp1").physics("ge").feature("ge1").set("valueType", "real");

//    This sets Scup2 to a strictly real value, as is the case for the temperature T , for example.
//    If you do not use this setting, Scup2 will be interpreted as a complex value, like any other variable in the frequency domain. The problem with this, is that the constraint Rac(T)-RCoil is only affected by the real part of Scup2 (as the resistance is the real part of the impedance ), leaving the imaginary part completely undetermined. In addition to this, we did not intend Scup2 to be complex in the first place.
//    Let us use the new Scup2 variable in the Magnetic Fields interface and recompute. Start by removing the linearized resistivity, and switch back to the Homogenized multiturn conductor model.
//    In the Model Builder window, under Component 1 (comp1) > Magnetic Fields (mf), click Phase 1.
//    In the Settings window for Domain Coil, locate the Constitutive Relation Jc-E section.
//    From the Conduction model list, select Electric conductivity.

    model.component("comp1").physics("mf").feature("coil1").set("ConstitutiveRelationJcE", "ElectricalConductivity");

//    Locate the Coil section.
//    From the Conductor model list, select Homogenized multiturn.

    model.component("comp1").physics("mf").feature("coil1").set("ConductorModel", "Multi");

//    Locate the Homogenized Conductor section.
//    In the \[\sigma\] text field, type Scup2.

    model.component("comp1").physics("mf").feature("coil1").set("sigmaCoil", "Scup2");

//    Phase 2, Phase 3
//    Repeat these steps for Phase 2 , and Phase 3 .

    model.component("comp1").physics("mf").feature("coil2").set("ConstitutiveRelationJcE", "ElectricalConductivity");
    model.component("comp1").physics("mf").feature("coil2").set("ConductorModel", "Multi");
    model.component("comp1").physics("mf").feature("coil2").set("sigmaCoil", "Scup2");
    model.component("comp1").physics("mf").feature("coil3").set("ConstitutiveRelationJcE", "ElectricalConductivity");
    model.component("comp1").physics("mf").feature("coil3").set("ConductorModel", "Multi");
    model.component("comp1").physics("mf").feature("coil3").set("sigmaCoil", "Scup2");

//    The multiturn conductor model is chosen, because it sets the current directly. This is different from the Single conductor conductor model, that excites the phase by means of an electric field. It will then search for the electric field magnitude required to get the desired current (this is in a way, very similar to looking for the value of Scup2 required to get the desired resistance).
//    Having two things to search for at the same time (two global unknowns) will make this induction heating model rather unstable. The multiturn conductor model therefore provides a more robust alternative. For more on coil domains, see section On Coil Domains in the Inductive Effects tutorial.
//    In case you are wondering, the chosen conductor model affects the loss distribution by one per cent or so: The multiturn model lowers the losses in the phases a bit, and therefore — as the total loss is predetermined by \[R_\textrm{ac}(T)\] — raises the screen and armor losses. The effects on the temperature distribution are small however, as you will see in a minute.
//    Recompute the solution. To improve nonlinear solver convergence, put the degrees of freedom for the electromagnetic problem in a separate segregated group. The ODE variable can be grouped together with the temperature. Start with a default solver.
//    In the Model Builder window, right-click Solver Configurations and choose Reset Solver to Default.

    model.sol("sol1").createAutoSequence("std1");

//    In the Model Builder window, expand the Study 1 > Solver Configurations > Solution 1 (sol1) > Stationary Solver 1 node.
//    Right-click Stationary Solver 1 and choose Segregated.

    model.sol("sol1").feature("s1").create("se1", "Segregated");

//    In the Model Builder window, expand the Study 1 > Solver Configurations > Solution 1 (sol1) > Stationary Solver 1 > Segregated 1 node, then click Segregated Step.
//    In the Settings window for Segregated Step, locate the General section.
//    In the Variables list, select External Temperature (comp1.ht.TextFace), Temperature (comp1.T), Global Equations 1 (comp1.ODE1).
//    Under Variables, click Delete.

    model.sol("sol1").feature("s1").feature("se1").feature("ssDef").set("segvar", new String[]{"comp1_A"});

//    In the Model Builder window, right-click Segregated 1 and choose Segregated Step.

    model.sol("sol1").feature("s1").feature("se1").create("ss1", "SegregatedStep");

//    In the Settings window for Segregated Step, locate the General section.
//    Under Variables, click Add.
//    In the Add dialog, select External Temperature (comp1.ht.TextFace), Temperature (comp1.T), Global Equations 1 (comp1.ODE1) in the Variables list.
//    Click OK.

    model.sol("sol1").feature("s1").feature("se1").feature("ss1")
         .set("segvar", new String[]{"comp1_ht_TextFace", "comp1_T", "comp1_ODE1"});

//    In the Study toolbar, click Compute.

    model.study("std1").createAutoSequences("all");

    model.sol("sol1").runAll();

    model.result("pg1").run();
    model.result("pg2").run();

//    In the Model Builder window, under Results, click Temperature (ht).
//    In the Temperature (ht) toolbar, click Plot.

    model.result("pg2").run();

//    Click the Go to Default View button in the Graphics toolbar.
//    The third significant digit might be different this time. This kind of accuracy is expected, as the ratio between the AC resistance and the DC resistance is set, up to three significant digits only. Moreover, the same value is used for all three phases, while the actual figure should be slightly different for each one of them.
//    Now, let us do some sanity checks: For this temperature, the phase AC resistance should be 59 mΩ/km, as given by Rac(90[degC]) . Additionally, the total thermal energy generated in the cable should be 76 kW/km, as given by 3*(I0^2/2)*Rac(90[degC]) . Here, “3” comes from the fact that we have three phases, and “1/2” comes from the peak-to-RMS conversion.
//    Let us see if these assumptions are correct.

    model.result().numerical("int1").setIndex("descr", "Phase losses (preset Rac)", 0);

//    In the Model Builder window, under Results > Derived Values, click Phase Losses.
//    In the Settings window for Surface Integration , locate the Expressions section.
//    In the table, update the description. Type Phase losses (preset Rac) , that is; replace “ coupled ih ” with “ preset Rac ”.
//    In the Settings window for Surface Integration , click Evaluate .
//    Screen Losses, Armor Losses
//    Repeat these steps for Screen Losses and Armor Losses .

    model.result().numerical("int1").set("table", "tbl1");
    model.result().numerical("int1").appendResult();
    model.result().numerical("int2").setIndex("descr", "Screen losses (preset Rac)", 0);
    model.result().numerical("int2").set("table", "tbl2");
    model.result().numerical("int2").appendResult();
    model.result().numerical("int3").setIndex("descr", "Armor losses (preset Rac)", 0);
    model.result().numerical("int3").set("table", "tbl3");
    model.result().numerical("int3").appendResult();

//    Table
//    Go to the Table window.
//    If you now add the phase, screen and armor losses, the result will equate to 76 kW/km indeed. Therefore, energy is conserved : electric power in, equals thermal power out. Hint: you can get even better accuracy by comparing 3*(I0^2/2)*Rac(aveop1(T)) to the integral of mf.Qh over all electromagnetic domains, directly.
//    Finally, reevaluate the resistance and the inductance.

    model.result().numerical("gev1").set("expr", new String[]{});
    model.result().numerical("gev1").set("descr", new String[]{});

//    In the table, enter the following settings. That is; replace “ coupled ih ” with “ preset Rac ”, and remove the second row altogether:
//    In the Model Builder window, click Phase AC Resistance.
//    In the Settings window for Global Evaluation, locate the Expressions section.
//    In the table, enter the following settings:

    model.result().numerical("gev1").setIndex("expr", "(mf.RCoil_1/1[m]+mf.RCoil_2/1[m]+mf.RCoil_3/1[m])/3", 0);
    model.result().numerical("gev1").setIndex("unit", "mohm/km", 0);
    model.result().numerical("gev1").setIndex("descr", "Phase AC resistance (preset Rac)", 0);

//    Click Evaluate.

    model.result().numerical("gev1").set("table", "tbl4");
    model.result().numerical("gev1").appendResult();
    model.result().numerical("gev2").setIndex("descr", "Phase inductance (preset Rac)", 0);

//    In the Model Builder window, click Phase Inductance.
//    In the Settings window for Global Evaluation , locate the Expressions section.
//    In the table, update the description. Type Phase inductance (preset Rac) , that is; replace “ coupled ih ” with “ preset Rac ”.
//    In the Settings window for Global Evaluation, click Evaluate.

    model.result().numerical("gev2").set("table", "tbl5");
    model.result().numerical("gev2").appendResult();

//    So when compared to the plain 2D configuration at room temperature, the cable's resistance has risen with about 13%, the exact same figure with which the total losses have increased. Feel free to investigate this further by comparing the results from this model to those from the Inductive Effects tutorial. Lastly, observe the cable's inductive properties are barely affected by the increase in temperature (as they should).

    return model;
  }

  public static Model run5(Model model) {
//    So far, all investigations in this series have been done in 2D. This is understandable, as 2D and 2.5D models can provide pretty accurate results when it comes to the total loss, resistance, and inductance (and with very little computational effort, too). However, even though 2D models are able to provide a good insight into the general behavior of the device, capturing the precise interaction between the phases, screens, and armor will still require a full 3D twist model .
//    When developing advanced numerical models in 3D with many degrees of freedom (a high DOF count ), one of the major challenges is to prepare a good mesh — notice that for the 2D models, we have not spent any time on this at all. The next tutorial will therefore provide a detailed treatment of the 3D twist mesh (and geometry) as needed for chapter 8: The Inductive Effects 3D tutorial.
//    You have now completed this tutorial, subsequent tutorials will refer to the resulting file as submarine_cable_06_thermal_effects.mph .
//    From the File menu, choose Save .

    model.result("pg2").run();
    model.result("pg2").run();

    model.view("view5").set("showgrid", true);
    model.view("view5").set("showaxisorientation", true);

    model.result("pg2").run();

    model.title("Submarine Cable 6 \u2014 Thermal Effects");

    model
         .description("This tutorial uses the Inductive Effects model from this series as a basis and adds thermal effects, including a temperature dependent conductivity (through linearized resistivity). It shows how to achieve a multiphysics coupling between electromagnetic fields and heat transfer, using the frequency-stationary study type (induction heating).\n\nThe influence of elevated temperatures on losses in the phases, screens, and armor is investigated (verification is included). The obtained temperature values are used in the Inductive Effects 3D tutorial, to apply a first-order temperature correction in 3D. Finally, the tutorial demonstrates how to match the resulting AC resistance to the one given by the IEC series of standards.");

    return model;
  }

  public static void main(String[] args) {
    Model model = run();
    model = run2(model);
    model = run3(model);
    model = run4(model);
    run5(model);
  }

}
