/*
 * sesam_laser_heating.java
 */

import com.comsol.model.*;
import com.comsol.model.util.*;

/** Model exported on May 14 2026, 08:42 by COMSOL 6.4.0.420. */
public class sesam_laser_heating {

  public static Model run() {
    Model model = ModelUtil.create("Model");

//    From the File menu, choose New.
//    In the New window, click Model Wizard.
//    In the Model Wizard window, click 2D.
//    In the Select Physics tree, select Heat Transfer > Electromagnetic Heating > Laser Heating.
//    Click Add.
//    Click Study.
//    In the Select Study tree, select Preset Studies for Selected Multiphysics > Frequency–Stationary.
//    Click Done.

    model.component().create("comp1", true);

    model.component("comp1").geom().create("geom1", 2);

    model.component("comp1").mesh().create("mesh1");

    model.component("comp1").physics().create("ewbe", "ElectromagneticWavesBeamEnvelopes", "geom1");
    model.component("comp1").physics().create("ht", "HeatTransfer", "geom1");
    model.component("comp1").physics("ht").prop("PhysicalModelProperty").set("dz", "1[m]");

    model.component("comp1").multiphysics().create("emh1", "ElectromagneticHeating", 2);
    model.component("comp1").multiphysics("emh1").set("EMHeat_physics", "ewbe");
    model.component("comp1").multiphysics("emh1").set("Heat_physics", "ht");
    model.component("comp1").multiphysics("emh1").selection().all();

    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 Model Builder window, under Component 1 (comp1), click Geometry 1.
//    In the Settings window for Geometry, locate the Units section.
//    From the Length unit list, select µm.

    model.component("comp1").geom("geom1").lengthUnit("\u00b5m");

//    In the Model Builder window, under Global Definitions, click Parameters 1.
//    In the Settings window for Parameters, type SESAM Parameters in the Label text field.

    model.param().label("SESAM Parameters");

//    Locate the Parameters section.
//    Click Load from File.
//    Browse to the model's Application Library folder and double-click the file sesam_laser_heating_sesam_parameters.txt.
//    To import content from file, use:
//    model.param().loadFile("FILENAME");
    model.param().set("height", "1.5[mm]", "SESAM length");
    model.param().set("thickness", "500[um]", "SESAM thickness");
    model.param().set("tau_R", "1[ps]", "SESAM relaxation time");
    model.param().set("I_0", "F_A/tau_R", "Saturation intensity");
    model.param().set("F_A", "60[uJ/cm^2]", "Saturation fluence");
    model.param().set("thickness_air", "thickness", "Thickness of the air domain");
    model.param().set("thickness_QW", "30[nm]", "Thickness of the quantum well");
    model.param().set("thickness_GaAs", "74.12[nm]", "Bragg mirror GaAs layer thickness");
    model.param().set("thickness_AlAs", "87.39[nm]", "Bragg Mirror AlAs thickness");
    model.param().set("N_layers", "30", "Number of layers in the SESAM Bragg reflector");

//    In the Home toolbar, click Parameters and choose Add > Parameters.

    model.param().create("par2");

//    In the Settings window for Parameters, type Beam Parameters in the Label text field.

    model.param("par2").label("Beam Parameters");

//    Locate the Parameters section.
//    Click Load from File.
//    Browse to the model's Application Library folder and double-click the file sesam_laser_heating_beam_parameters.txt.
//    To import content from file, use:
//    model.param("par2").loadFile("FILENAME");
    model.param("par2").set("lda0", "1.03[um]", "Pulse Wavelength");
    model.param("par2").set("w0", "250[um]", "Beam 1/e^2 radius");
    model.param("par2").set("Rrep", "1[MHz]", "Pulse repetition rate");
    model.param("par2").set("P_ave", "1[W]", "Average power of laser");
    model.param("par2").set("Area_beam", "pi*w0^2", "Beam area");
    model.param("par2").set("tau_p", "1[ps]", "Pulse duration");
    model.param("par2").set("P_ind", "1[W]", "Power index used for fitting study");
    model.param("par2").set("rho", "50[m]", "Wavefront curvature");

//    In the Geometry toolbar, click Rectangle.

    model.component("comp1").geom("geom1").create("r1", "Rectangle");

//    In the Settings window for Rectangle, locate the Size and Shape section.
//    In the Width text field, type thickness_air+thickness.

    model.component("comp1").geom("geom1").feature("r1").set("size", new String[]{"thickness_air+thickness", "1"});

//    In the Height text field, type height.

    model.component("comp1").geom("geom1").feature("r1").setIndex("size", "height", 1);

//    Locate the Position section.
//    In the x text field, type -thickness_air.

    model.component("comp1").geom("geom1").feature("r1").set("pos", new String[]{"-thickness_air", "0"});

//    In the y text field, type -height/2.

    model.component("comp1").geom("geom1").feature("r1").setIndex("pos", "-height/2", 1);

//    In the Geometry toolbar, click Rectangle.

    model.component("comp1").geom("geom1").run("r1");
    model.component("comp1").geom("geom1").create("r2", "Rectangle");

//    In the Settings window for Rectangle, type GaAs in the Label text field.

    model.component("comp1").geom("geom1").feature("r2").label("GaAs");

//    Locate the Size and Shape section.
//    In the Width text field, type thickness_GaAs.

    model.component("comp1").geom("geom1").feature("r2").set("size", new String[]{"thickness_GaAs", "1"});

//    In the Height text field, type height.

    model.component("comp1").geom("geom1").feature("r2").setIndex("size", "height", 1);

//    Locate the Position section.
//    In the y text field, type -height/2.

    model.component("comp1").geom("geom1").feature("r2").set("pos", new String[]{"0", "-height/2"});

//    In the Geometry toolbar, click Selections and choose Explicit Selection.

    model.component("comp1").geom("geom1").run("r2");
    model.component("comp1").geom("geom1").create("sel1", "ExplicitSelection");

//    In the Settings window for Explicit Selection, type GaAs Layers in the Label text field.

    model.component("comp1").geom("geom1").feature("sel1").label("GaAs Layers");

//    On the object r2, select Domain 1.

    model.component("comp1").geom("geom1").feature("sel1").selection("selection").set("r2", 1);

//    In the Geometry toolbar, click Rectangle.

    model.component("comp1").geom("geom1").run("sel1");
    model.component("comp1").geom("geom1").create("r3", "Rectangle");

//    In the Settings window for Rectangle, type AlAs in the Label text field.

    model.component("comp1").geom("geom1").feature("r3").label("AlAs");

//    Locate the Size and Shape section.
//    In the Width text field, type thickness_AlAs.

    model.component("comp1").geom("geom1").feature("r3").set("size", new String[]{"thickness_AlAs", "1"});

//    In the Height text field, type height.

    model.component("comp1").geom("geom1").feature("r3").setIndex("size", "height", 1);

//    Locate the Position section.
//    In the x text field, type thickness_GaAs.

    model.component("comp1").geom("geom1").feature("r3").set("pos", new String[]{"thickness_GaAs", "0"});

//    In the y text field, type -height/2.

    model.component("comp1").geom("geom1").feature("r3").setIndex("pos", "-height/2", 1);

//    In the Geometry toolbar, click Selections and choose Explicit Selection.

    model.component("comp1").geom("geom1").run("r3");
    model.component("comp1").geom("geom1").create("sel2", "ExplicitSelection");

//    In the Settings window for Explicit Selection, type AlAs Layers in the Label text field.

    model.component("comp1").geom("geom1").feature("sel2").label("AlAs Layers");

//    On the object r3, select Domain 1.

    model.component("comp1").geom("geom1").feature("sel2").selection("selection").set("r3", 1);

//    In the Geometry toolbar, click Transforms and choose Array.

    model.component("comp1").geom("geom1").run("sel2");
    model.component("comp1").geom("geom1").create("arr1", "Array");

//    Select the objects r2, r3.

    model.component("comp1").geom("geom1").feature("arr1").selection("input").set("r2", "r3");

//    In the Settings window for Array, locate the Size section.
//    In the x size text field, type N_layers.

    model.component("comp1").geom("geom1").feature("arr1").set("fullsize", new String[]{"N_layers", "1"});

//    Locate the Displacement section.
//    In the x text field, type thickness_AlAs+thickness_GaAs.

    model.component("comp1").geom("geom1").feature("arr1")
         .set("displ", new String[]{"thickness_AlAs+thickness_GaAs", "0"});

//    In the Geometry toolbar, click Rectangle.

    model.component("comp1").geom("geom1").run("arr1");
    model.component("comp1").geom("geom1").create("r4", "Rectangle");

//    In the Settings window for Rectangle, locate the Size and Shape section.
//    In the Width text field, type thickness_QW.

    model.component("comp1").geom("geom1").feature("r4").set("size", new String[]{"thickness_QW", "1"});

//    In the Height text field, type height.

    model.component("comp1").geom("geom1").feature("r4").setIndex("size", "height", 1);

//    Locate the Position section.
//    In the x text field, type thickness_GaAs-thickness_QW.

    model.component("comp1").geom("geom1").feature("r4").set("pos", new String[]{"thickness_GaAs-thickness_QW", "0"});

//    In the y text field, type -height/2.

    model.component("comp1").geom("geom1").feature("r4").setIndex("pos", "-height/2", 1);

//    This puts the QW layer over the first interface between the GaAs and AlAs layers. This places them in the antinode of the E-field in the Bragg reflector.
//    In the Geometry toolbar, click Selections and choose Explicit Selection.

    model.component("comp1").geom("geom1").run("r4");
    model.component("comp1").geom("geom1").create("sel3", "ExplicitSelection");

//    In the Settings window for Explicit Selection, type QW in the Label text field.

    model.component("comp1").geom("geom1").feature("sel3").label("QW");

//    On the object r4, select Domain 1.

    model.component("comp1").geom("geom1").feature("sel3").selection("selection").set("r4", 1);

//    In the Geometry toolbar, click Booleans and Partitions and choose Union.

    model.component("comp1").geom("geom1").run("sel3");
    model.component("comp1").geom("geom1").create("uni1", "Union");

//    In the Settings window for Union, locate the Union section.
//    From the Input objects list, select All objects.

    model.component("comp1").geom("geom1").feature("uni1").selection("input").all();

//    Click Build Selected.

    model.component("comp1").geom("geom1").run("uni1");

//    In the Geometry toolbar, click Selections and choose Explicit Selection.

    model.component("comp1").geom("geom1").create("sel4", "ExplicitSelection");

//    In the Settings window for Explicit Selection, type Substrate in the Label text field.

    model.component("comp1").geom("geom1").feature("sel4").label("Substrate");

//    On the object uni1, select Domain 63.

    model.component("comp1").geom("geom1").feature("sel4").selection("selection").set("uni1", 63);

//    In the Geometry toolbar, click Selections and choose Union Selection.

    model.component("comp1").geom("geom1").run("sel4");
    model.component("comp1").geom("geom1").create("unisel1", "UnionSelection");

//    In the Settings window for Union Selection, type GaAs Domains in the Label text field.

    model.component("comp1").geom("geom1").feature("unisel1").label("GaAs Domains");

//    Locate the Input Entities section.
//    Click Add.
//    In the Add dialog, select GaAs Layers, Substrate in the Selections to add list.
//    Click OK.

    model.component("comp1").geom("geom1").feature("unisel1").set("input", new String[]{"sel1", "sel4"});

//    In the Geometry toolbar, click Selections and choose Explicit Selection.

    model.component("comp1").geom("geom1").run("unisel1");
    model.component("comp1").geom("geom1").create("sel5", "ExplicitSelection");

//    In the Settings window for Explicit Selection, type SESAM Surface in the Label text field.

    model.component("comp1").geom("geom1").feature("sel5").label("SESAM Surface");

//    Locate the Entities to Select section.
//    From the Geometric entity level list, select Boundary.

    model.component("comp1").geom("geom1").feature("sel5").selection("selection").init(1);

//    On the object uni1, select Boundary 4.

    model.component("comp1").geom("geom1").feature("sel5").selection("selection").set("uni1", 4);

//    In the Geometry toolbar, click Point.

    model.component("comp1").geom("geom1").run("sel5");
    model.component("comp1").geom("geom1").create("pt1", "Point");

//    Click Build All.

    model.component("comp1").geom("geom1").run("fin");

//    In the Model Builder window, under Component 1 (comp1), click Electromagnetic Waves, Beam Envelopes (ewbe).
//    Select Domains 1, 2, 3, 4, 5, 6, 7, 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.

    model.component("comp1").physics("ewbe").selection()
         .set(1, 2, 3, 4, 5, 6, 7, 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);

//    In the Settings window for Electromagnetic Waves, Beam Envelopes, locate the Components section.
//    From the Electric field components solved for list, select Out-of-plane vector.

    model.component("comp1").physics("ewbe").prop("components").set("components", "outofplane");

//    In the Physics toolbar, click Boundaries and choose Scattering Boundary Condition.

    model.component("comp1").physics("ewbe").create("sctr1", "Scattering", 1);

//    Click the Zoom Extents button in the Graphics toolbar.
//    Select Boundary 1.

    model.component("comp1").physics("ewbe").feature("sctr1").selection().set(1);

//    In the Settings window for Scattering Boundary Condition, locate the Scattering Boundary Condition section.
//    From the Incident field list, select Gaussian beam.

    model.component("comp1").physics("ewbe").feature("sctr1").set("IncidentField", "GaussianBeam");

//    In the \[w_0\] text field, type w0.

    model.component("comp1").physics("ewbe").feature("sctr1").set("w0", "w0");

//    From the Input quantity list, select Power.

    model.component("comp1").physics("ewbe").feature("sctr1").set("inputQuantity", "Power");

//    In the \[P\] text field, type P_ave/w0.

    model.component("comp1").physics("ewbe").feature("sctr1").set("inputPower", "P_ave/w0");

//    Specify the \[\mathbf{E}_{\textrm{g0}}\] vector as

    model.component("comp1").physics("ewbe").feature("sctr1").set("Eg0NN", new int[]{0, 0, 1});

//    In the Physics toolbar, click Boundaries and choose Scattering Boundary Condition.

    model.component("comp1").physics("ewbe").create("sctr2", "Scattering", 1);

//    Select Boundary 188.

    model.component("comp1").physics("ewbe").feature("sctr2").selection().set(188);

//    This scattering boundary condition absorbs any remaining optical power assuming it is dissipated into the substrate without having to include that domain in the optical modeling.
//    Next, set a fixed temperature at the backface of the substrate to emulate an attached heat sink. The fixed temperature around the air domain maintains ambient room temperature.
//    In the Physics toolbar, click Boundaries and choose Temperature.

    model.component("comp1").physics("ht").create("temp1", "TemperatureBoundary", 1);

//    Select Boundaries 1, 2, 3, 191.

    model.component("comp1").physics("ht").feature("temp1").selection().set(1, 2, 3, 191);

//    In the Home toolbar, click Add Physics to open the Add Physics window.
//    In the tree, select Structural Mechanics > Solid Mechanics (solid).
//    Click Add to Component 1 in the window toolbar.

    model.component("comp1").physics().create("solid", "SolidMechanics", "geom1");

//    In the Home toolbar, click Add Physics to close the Add Physics window.
//    Select Domains 2, 3, 4, 5, 6, 7, 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.

    model.component("comp1").physics("solid").selection()
         .set(2, 3, 4, 5, 6, 7, 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);

//    In the Physics toolbar, click Boundaries and choose Fixed Constraint.

    model.component("comp1").physics("solid").create("fix1", "Fixed", 1);

//    Click the Select Box button in the Graphics toolbar.
//    Select Boundaries 189, 190, 191.

    model.component("comp1").physics("solid").feature("fix1").selection().set(189, 190, 191);

//    In the Physics toolbar, click Multiphysics Couplings and choose Domain > Thermal Expansion.

    model.component("comp1").multiphysics().create("te1", "ThermalExpansion", 2);

//    Click the Select Box button in the Graphics toolbar.
//    Select Domains 2, 3, 4, 5, 6, 7, 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.

    model.component("comp1").multiphysics("te1").selection()
         .set(2, 3, 4, 5, 6, 7, 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);

//    The nature of this model requires a specific mesh to solve efficiently as the optical domains require a much finer mesh then that needed to model thermal effects.
//    In the Model Builder window, under Component 1 (comp1), click Mesh 1.
//    In the Settings window for Mesh, locate the Sequence Type section.
//    From the list, select User-controlled mesh.

    model.component("comp1").mesh("mesh1").automatic(false);

//    In the Mesh toolbar, click Clear Sequence.

    model.component("comp1").mesh("mesh1").feature().clear();

//    Right-click Component 1 (comp1) > Mesh 1 and choose Distribution.

    model.component("comp1").mesh("mesh1").create("dis1", "Distribution");

//    Select Boundary 1.

    model.component("comp1").mesh("mesh1").feature("dis1").selection().set(1);

//    In the Settings window for Distribution, locate the Distribution section.
//    In the Number of elements text field, type floor(0.12*height/lda0).

    model.component("comp1").mesh("mesh1").feature("dis1").set("numelem", "floor(0.12*height/lda0)");

//    In the Model Builder window, right-click Mesh 1 and choose Distribution.

    model.component("comp1").mesh("mesh1").create("dis2", "Distribution");

//    Select Boundary 2.

    model.component("comp1").mesh("mesh1").feature("dis2").selection().set(2);

//    In the Settings window for Distribution, locate the Distribution section.
//    In the Number of elements text field, type floor(0.1*thickness_air/lda0).

    model.component("comp1").mesh("mesh1").feature("dis2").set("numelem", "floor(0.1*thickness_air/lda0)");

//    Right-click Mesh 1 and choose Distribution.

    model.component("comp1").mesh("mesh1").create("dis3", "Distribution");

//    Click the Select Box button in the Graphics toolbar.
//    Select Boundaries 5, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99, 102, 105, 108, 111, 114, 117, 120, 123, 126, 129, 132, 135, 138, 141, 144, 147, 150, 153, 156, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186.

    model.component("comp1").mesh("mesh1").feature("dis3").selection()
         .set(5, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99, 102, 105, 108, 111, 114, 117, 120, 123, 126, 129, 132, 135, 138, 141, 144, 147, 150, 153, 156, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186);

//    Right-click Mesh 1 and choose Distribution.

    model.component("comp1").mesh("mesh1").create("dis4", "Distribution");

//    Select Boundary 189.

    model.component("comp1").mesh("mesh1").feature("dis4").selection().set(189);

//    In the Settings window for Distribution, locate the Distribution section.
//    From the Distribution type list, select Predefined.

    model.component("comp1").mesh("mesh1").feature("dis4").set("type", "predefined");

//    In the Number of elements text field, type floor(0.03*thickness/lda0).

    model.component("comp1").mesh("mesh1").feature("dis4").set("elemcount", "floor(0.03*thickness/lda0)");

//    In the Element ratio text field, type 0.1.

    model.component("comp1").mesh("mesh1").feature("dis4").set("elemratio", 0.1);

//    From the Growth rate list, select Exponential.

    model.component("comp1").mesh("mesh1").feature("dis4").set("growthrate", "exponential");

//    In the Mesh toolbar, click Mapped.

    model.component("comp1").mesh("mesh1").create("map1", "Map");

//    In the Settings window for Mapped, click to expand the Reduce Element Skewness section.
//    Select the Adjust edge mesh checkbox.

    model.component("comp1").mesh("mesh1").feature("map1").set("adjustedgdistr", true);

//    Click Build All.

    model.component("comp1").mesh("mesh1").run();

//    In the Model Builder window, expand the Component 1 (comp1) > Definitions node.
//    Right-click Definitions and choose Variables.

    model.component("comp1").variable().create("var1");

//    These variables define the saturation properties of the SESAM and will be applied in the material properties.
//    In the Settings window for Variables, type Variables SESAM in the Label text field.

    model.component("comp1").variable("var1").label("Variables SESAM");

//    Locate the Variables section.
//    In the table, enter the following settings:

    model.component("comp1").variable("var1").set("I_pulse", "ewbe.Poav1x/(Rrep*tau_p)");
    model.component("comp1").variable("var1").descr("I_pulse", "Pulse intensity");
    model.component("comp1").variable("var1").set("del_q", "1/(1+I_pulse/I_0)");
    model.component("comp1").variable("var1").descr("del_q", "Change in absorption");

//    Right-click Definitions and choose Variables.

    model.component("comp1").variable().create("var2");

//    These variables will be used later when fitting the curvature of the SESAM.
//    In the Settings window for Variables, type Fitting Variables in the Label text field.

    model.component("comp1").variable("var2").label("Fitting Variables");

//    Locate the Variables section.
//    In the table, enter the following settings:

    model.component("comp1").variable("var2").set("delx_para", "-1/Radius*y^2+Peak");
    model.component("comp1").variable("var2").descr("delx_para", "Parabolic approximation");
    model.component("comp1").variable("var2").set("Para_fit", "intop1((delx-delx_para)^2)");
    model.component("comp1").variable("var2").descr("Para_fit", "Error function");
    model.component("comp1").variable("var2").set("delx", "withsol('sol3', solid.disp, setval(P_ave, P_ind))");
    model.component("comp1").variable("var2").descr("delx", "Numerical Solution");
    model.component("comp1").variable("var2").set("delx_0", "withsol('sol3', maxop1(solid.disp))");
    model.component("comp1").variable("var2").descr("delx_0", "Maximum displacement");

//    In the Definitions toolbar, click Nonlocal Couplings and choose Integration.

    model.component("comp1").cpl().create("intop1", "Integration");
    model.component("comp1").cpl("intop1").set("axisym", true);

//    In the Settings window for Integration, locate the Source Selection section.
//    From the Geometric entity level list, select Boundary.

    model.component("comp1").cpl("intop1").selection().geom("geom1", 1);

//    From the Selection list, select SESAM Surface.

    model.component("comp1").cpl("intop1").selection().named("geom1_sel5");

//    In the Definitions toolbar, click Nonlocal Couplings and choose Integration.

    model.component("comp1").cpl().create("intop2", "Integration");
    model.component("comp1").cpl("intop2").set("axisym", true);

//    In the Settings window for Integration, locate the Source Selection section.
//    From the Geometric entity level list, select Boundary.

    model.component("comp1").cpl("intop2").selection().geom("geom1", 1);

//    Select Boundary 1.

    model.component("comp1").cpl("intop2").selection().set(1);

//    In the Definitions toolbar, click Nonlocal Couplings and choose Maximum.

    model.component("comp1").cpl().create("maxop1", "Maximum");

//    In the Settings window for Maximum, locate the Source Selection section.
//    From the Geometric entity level list, select Boundary.

    model.component("comp1").cpl("maxop1").selection().geom("geom1", 1);

//    From the Selection list, select SESAM Surface.

    model.component("comp1").cpl("maxop1").selection().named("geom1_sel5");

//    In the Definitions toolbar, click Nonlocal Couplings and choose Integration.

    model.component("comp1").cpl().create("intop3", "Integration");
    model.component("comp1").cpl("intop3").set("axisym", true);

//    In the Settings window for Integration, locate the Source Selection section.
//    From the Geometric entity level list, select Point.

    model.component("comp1").cpl("intop3").selection().geom("geom1", 0);

//    Select Point 4.

    model.component("comp1").cpl("intop3").selection().set(4);

//    In the Materials toolbar, click Add Material to open the Add Material window.
//    In the tree, select Built-in > Air.
//    Click Add to Component in the window toolbar.

    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"});

    return model;
  }

  public static Model run2(Model model) {
    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");

//    In the tree, select Optical > Inorganic Materials > As - Arsenides > Models and simulations > GaAs (Gallium arsenide) (Adachi 1989: n,k 0.207-12.4 um).
//    Click Add to Component in the window toolbar.

    model.component("comp1").material().create("mat2", "Common");
    model.component("comp1").material("mat2").propertyGroup()
         .create("RefractiveIndex", "RefractiveIndex", "Refractive index");
    model.component("comp1").material("mat2").propertyGroup("RefractiveIndex").func().create("int1", "Interpolation");
    model.component("comp1").material("mat2").propertyGroup("RefractiveIndex").func().create("int2", "Interpolation");
    model.component("comp1").material("mat2").label("GaAs (Gallium arsenide) (Adachi 1989: n,k 0.207-12.4 um)");
    model.component("comp1").material("mat2").propertyGroup("RefractiveIndex").func("int1").set("funcname", "nr");
    model.component("comp1").material("mat2").propertyGroup("RefractiveIndex").func("int1")
         .set("table", new String[][]{{"2.0664e-01", "1.3106e+00"}, 
         {"2.0767e-01", "1.3191e+00"}, 
         {"2.0870e-01", "1.3278e+00"}, 
         {"2.0975e-01", "1.3369e+00"}, 
         {"2.1081e-01", "1.3464e+00"}, 
         {"2.1188e-01", "1.3563e+00"}, 
         {"2.1295e-01", "1.3666e+00"}, 
         {"2.1404e-01", "1.3774e+00"}, 
         {"2.1515e-01", "1.3886e+00"}, 
         {"2.1626e-01", "1.4005e+00"}, 
         {"2.1738e-01", "1.4129e+00"}, 
         {"2.1852e-01", "1.4261e+00"}, 
         {"2.1967e-01", "1.4400e+00"}, 
         {"2.2083e-01", "1.4547e+00"}, 
         {"2.2200e-01", "1.4704e+00"}, 
         {"2.2318e-01", "1.4871e+00"}, 
         {"2.2438e-01", "1.5049e+00"}, 
         {"2.2559e-01", "1.5240e+00"}, 
         {"2.2681e-01", "1.5446e+00"}, 
         {"2.2805e-01", "1.5667e+00"}, 
         {"2.2930e-01", "1.5906e+00"}, 
         {"2.3057e-01", "1.6165e+00"}, 
         {"2.3184e-01", "1.6447e+00"}, 
         {"2.3314e-01", "1.6754e+00"}, 
         {"2.3444e-01", "1.7090e+00"}, 
         {"2.3577e-01", "1.7458e+00"}, 
         {"2.3710e-01", "1.7863e+00"}, 
         {"2.3845e-01", "1.8308e+00"}, 
         {"2.3982e-01", "1.8799e+00"}, 
         {"2.4120e-01", "1.9343e+00"}, 
         {"2.4260e-01", "1.9944e+00"}, 
         {"2.4402e-01", "2.0610e+00"}, 
         {"2.4545e-01", "2.1348e+00"}, 
         {"2.4690e-01", "2.2163e+00"}, 
         {"2.4837e-01", "2.3063e+00"}, 
         {"2.4985e-01", "2.4052e+00"}, 
         {"2.5135e-01", "2.5132e+00"}, 
         {"2.5287e-01", "2.6304e+00"}, 
         {"2.5441e-01", "2.7559e+00"}, 
         {"2.5597e-01", "2.8887e+00"}, 
         {"2.5755e-01", "3.0267e+00"}, 
         {"2.5914e-01", "3.1671e+00"}, 
         {"2.6076e-01", "3.3062e+00"}, 
         {"2.6239e-01", "3.4399e+00"}, 
         {"2.6405e-01", "3.5640e+00"}, 
         {"2.6573e-01", "3.6747e+00"}, 
         {"2.6743e-01", "3.7691e+00"}, 
         {"2.6915e-01", "3.8454e+00"}, 
         {"2.7089e-01", "3.9032e+00"}, 
         {"2.7266e-01", "3.9433e+00"}, 
         {"2.7445e-01", "3.9673e+00"}, 
         {"2.7626e-01", "3.9775e+00"}, 
         {"2.7810e-01", "3.9762e+00"}, 
         {"2.7996e-01", "3.9661e+00"}, 
         {"2.8185e-01", "3.9492e+00"}, 
         {"2.8376e-01", "3.9277e+00"}, 
         {"2.8570e-01", "3.9032e+00"}, 
         {"2.8766e-01", "3.8770e+00"}, 
         {"2.8966e-01", "3.8503e+00"}, 
         {"2.9168e-01", "3.8238e+00"}, 
         {"2.9372e-01", "3.7983e+00"}, 
         {"2.9580e-01", "3.7743e+00"}, 
         {"2.9791e-01", "3.7520e+00"}, 
         {"3.0005e-01", "3.7317e+00"}, 
         {"3.0222e-01", "3.7136e+00"}, 
         {"3.0442e-01", "3.6979e+00"}, 
         {"3.0665e-01", "3.6845e+00"}, 
         {"3.0891e-01", "3.6736e+00"}, 
         {"3.1121e-01", "3.6651e+00"}, 
         {"3.1354e-01", "3.6591e+00"}, 
         {"3.1591e-01", "3.6555e+00"}, 
         {"3.1832e-01", "3.6543e+00"}, 
         {"3.2076e-01", "3.6555e+00"}, 
         {"3.2324e-01", "3.6590e+00"}, 
         {"3.2576e-01", "3.6650e+00"}, 
         {"3.2831e-01", "3.6732e+00"}, 
         {"3.3091e-01", "3.6837e+00"}, 
         {"3.3355e-01", "3.6966e+00"}, 
         {"3.3623e-01", "3.7118e+00"}, 
         {"3.3896e-01", "3.7293e+00"}, 
         {"3.4173e-01", "3.7491e+00"}, 
         {"3.4454e-01", "3.7713e+00"}, 
         {"3.4741e-01", "3.7959e+00"}, 
         {"3.5032e-01", "3.8230e+00"}, 
         {"3.5328e-01", "3.8526e+00"}, 
         {"3.5629e-01", "3.8848e+00"}, 
         {"3.5935e-01", "3.9197e+00"}, 
         {"3.6246e-01", "3.9574e+00"}, 
         {"3.6563e-01", "3.9981e+00"}, 
         {"3.6886e-01", "4.0419e+00"}, 
         {"3.7214e-01", "4.0891e+00"}, 
         {"3.7548e-01", "4.1398e+00"}, 
         {"3.7888e-01", "4.1944e+00"}, 
         {"3.8235e-01", "4.2532e+00"}, 
         {"3.8588e-01", "4.3165e+00"}, 
         {"3.8947e-01", "4.3848e+00"}, 
         {"3.9313e-01", "4.4587e+00"}, 
         {"3.9686e-01", "4.5386e+00"}, 
         {"4.0066e-01", "4.6252e+00"}, 
         {"4.0454e-01", "4.7187e+00"}, 
         {"4.0849e-01", "4.8193e+00"}, 
         {"4.1252e-01", "4.9256e+00"}, 
         {"4.1663e-01", "5.0335e+00"}, 
         {"4.2082e-01", "5.1333e+00"}, 
         {"4.2510e-01", "5.2088e+00"}, 
         {"4.2947e-01", "5.2163e+00"}, 
         {"4.3392e-01", "5.0820e+00"}, 
         {"4.3847e-01", "4.9573e+00"}, 
         {"4.4312e-01", "4.8338e+00"}, 
         {"4.4786e-01", "4.7159e+00"}, 
         {"4.5271e-01", "4.6069e+00"}, 
         {"4.5767e-01", "4.5079e+00"}, 
         {"4.6273e-01", "4.4196e+00"}, 
         {"4.6791e-01", "4.3497e+00"}, 
         {"4.7320e-01", "4.2958e+00"}, 
         {"4.7862e-01", "4.2462e+00"}, 
         {"4.8416e-01", "4.2004e+00"}, 
         {"4.8983e-01", "4.1580e+00"}, 
         {"4.9564e-01", "4.1187e+00"}, 
         {"5.0158e-01", "4.0822e+00"}, 
         {"5.0767e-01", "4.0481e+00"}, 
         {"5.1391e-01", "4.0162e+00"}, 
         {"5.2030e-01", "3.9864e+00"}, 
         {"5.2686e-01", "3.9584e+00"}, 
         {"5.3358e-01", "3.9322e+00"}, 
         {"5.4048e-01", "3.9076e+00"}, 
         {"5.4756e-01", "3.8844e+00"}, 
         {"5.5482e-01", "3.8627e+00"}, 
         {"5.6228e-01", "3.8423e+00"}, 
         {"5.6994e-01", "3.8231e+00"}, 
         {"5.7782e-01", "3.8052e+00"}, 
         {"5.8591e-01", "3.7883e+00"}, 
         {"5.9424e-01", "3.7726e+00"}, 
         {"6.0281e-01", "3.7578e+00"}, 
         {"6.1162e-01", "3.7441e+00"}, 
         {"6.2070e-01", "3.7314e+00"}, 
         {"6.3005e-01", "3.7197e+00"}, 
         {"6.3969e-01", "3.7088e+00"}, 
         {"6.4963e-01", "3.6989e+00"}, 
         {"6.5988e-01", "3.6899e+00"}, 
         {"6.7046e-01", "3.6818e+00"}, 
         {"6.8138e-01", "3.6745e+00"}, 
         {"6.9267e-01", "3.6681e+00"}, 
         {"7.0433e-01", "3.6549e+00"}, 
         {"7.1640e-01", "3.6423e+00"}, 
         {"7.2889e-01", "3.6329e+00"}, 
         {"7.4182e-01", "3.6250e+00"}, 
         {"7.5521e-01", "3.6183e+00"}, 
         {"7.6910e-01", "3.6126e+00"}, 
         {"7.8351e-01", "3.6077e+00"}, 
         {"7.9847e-01", "3.6038e+00"}, 
         {"8.1402e-01", "3.6007e+00"}, 
         {"8.3018e-01", "3.5984e+00"}, 
         {"8.4699e-01", "3.5970e+00"}, 
         {"8.6450e-01", "3.5964e+00"}, 
         {"8.8275e-01", "3.5665e+00"}, 
         {"9.0179e-01", "3.5442e+00"}, 
         {"9.2166e-01", "3.5280e+00"}, 
         {"9.4243e-01", "3.5144e+00"}, 
         {"9.6416e-01", "3.5023e+00"}, 
         {"9.8691e-01", "3.4913e+00"}, 
         {"1.0108e+00", "3.4811e+00"}, 
         {"1.0358e+00", "3.4717e+00"}, 
         {"1.0621e+00", "3.4628e+00"}, 
         {"1.0898e+00", "3.4544e+00"}, 
         {"1.1190e+00", "3.4465e+00"}, 
         {"1.1497e+00", "3.4389e+00"}, 
         {"1.1822e+00", "3.4318e+00"}, 
         {"1.2166e+00", "3.4249e+00"}, 
         {"1.2531e+00", "3.4184e+00"}, 
         {"1.2918e+00", "3.4122e+00"}, 
         {"1.3329e+00", "3.4063e+00"}, 
         {"1.3768e+00", "3.4007e+00"}, 
         {"1.4237e+00", "3.3953e+00"}, 
         {"1.4739e+00", "3.3901e+00"}, 
         {"1.5277e+00", "3.3852e+00"}, 
         {"1.5857e+00", "3.3806e+00"}, 
         {"1.6482e+00", "3.3761e+00"}, 
         {"1.7158e+00", "3.3719e+00"}, 
         {"1.7892e+00", "3.3678e+00"}, 
         {"1.8692e+00", "3.3640e+00"}, 
         {"1.9566e+00", "3.3604e+00"}, 
         {"2.0527e+00", "3.3569e+00"}, 
         {"2.1586e+00", "3.3537e+00"}, 
         {"2.2761e+00", "3.3506e+00"}, 
         {"2.4071e+00", "3.3477e+00"}, 
         {"2.5541e+00", "3.3450e+00"}, 
         {"2.7203e+00", "3.3425e+00"}, 
         {"2.9095e+00", "3.3401e+00"}, 
         {"3.1271e+00", "3.3379e+00"}, 
         {"3.3798e+00", "3.3359e+00"}, 
         {"3.6770e+00", "3.3340e+00"}, 
         {"4.0315e+00", "3.3323e+00"}, 
         {"4.4616e+00", "3.3308e+00"}, 
         {"4.9945e+00", "3.3294e+00"}, 
         {"5.6719e+00", "3.3282e+00"}, 
         {"6.5619e+00", "3.3271e+00"}, 
         {"7.7832e+00", "3.3262e+00"}, 
         {"9.5631e+00", "3.3255e+00"}, 
         {"1.2398e+01", "3.3249e+00"}});
    model.component("comp1").material("mat2").propertyGroup("RefractiveIndex").func("int1")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat2").propertyGroup("RefractiveIndex").func("int1")
         .set("argunit", new String[]{"um"});
    model.component("comp1").material("mat2").propertyGroup("RefractiveIndex").func("int2").set("funcname", "ni");
    model.component("comp1").material("mat2").propertyGroup("RefractiveIndex").func("int2")
         .set("table", new String[][]{{"2.0664e-01", "2.2934e+00"}, 
         {"2.0767e-01", "2.3145e+00"}, 
         {"2.0870e-01", "2.3361e+00"}, 
         {"2.0975e-01", "2.3583e+00"}, 
         {"2.1081e-01", "2.3811e+00"}, 
         {"2.1188e-01", "2.4047e+00"}, 
         {"2.1295e-01", "2.4289e+00"}, 
         {"2.1404e-01", "2.4539e+00"}, 
         {"2.1515e-01", "2.4797e+00"}, 
         {"2.1626e-01", "2.5064e+00"}, 
         {"2.1738e-01", "2.5339e+00"}, 
         {"2.1852e-01", "2.5623e+00"}, 
         {"2.1967e-01", "2.5918e+00"}, 
         {"2.2083e-01", "2.6222e+00"}, 
         {"2.2200e-01", "2.6537e+00"}, 
         {"2.2318e-01", "2.6864e+00"}, 
         {"2.2438e-01", "2.7203e+00"}, 
         {"2.2559e-01", "2.7554e+00"}, 
         {"2.2681e-01", "2.7918e+00"}, 
         {"2.2805e-01", "2.8296e+00"}, 
         {"2.2930e-01", "2.8687e+00"}, 
         {"2.3057e-01", "2.9094e+00"}, 
         {"2.3184e-01", "2.9515e+00"}, 
         {"2.3314e-01", "2.9951e+00"}, 
         {"2.3444e-01", "3.0401e+00"}, 
         {"2.3577e-01", "3.0867e+00"}, 
         {"2.3710e-01", "3.1346e+00"}, 
         {"2.3845e-01", "3.1838e+00"}, 
         {"2.3982e-01", "3.2341e+00"}, 
         {"2.4120e-01", "3.2852e+00"}, 
         {"2.4260e-01", "3.3368e+00"}, 
         {"2.4402e-01", "3.3882e+00"}, 
         {"2.4545e-01", "3.4389e+00"}, 
         {"2.4690e-01", "3.4879e+00"}, 
         {"2.4837e-01", "3.5340e+00"}, 
         {"2.4985e-01", "3.5757e+00"}, 
         {"2.5135e-01", "3.6114e+00"}, 
         {"2.5287e-01", "3.6389e+00"}, 
         {"2.5441e-01", "3.6560e+00"}, 
         {"2.5597e-01", "3.6603e+00"}, 
         {"2.5755e-01", "3.6493e+00"}, 
         {"2.5914e-01", "3.6213e+00"}, 
         {"2.6076e-01", "3.5749e+00"}, 
         {"2.6239e-01", "3.5101e+00"}, 
         {"2.6405e-01", "3.4278e+00"}, 
         {"2.6573e-01", "3.3306e+00"}, 
         {"2.6743e-01", "3.2218e+00"}, 
         {"2.6915e-01", "3.1056e+00"}, 
         {"2.7089e-01", "2.9862e+00"}, 
         {"2.7266e-01", "2.8675e+00"}, 
         {"2.7445e-01", "2.7530e+00"}, 
         {"2.7626e-01", "2.6449e+00"}, 
         {"2.7810e-01", "2.5450e+00"}, 
         {"2.7996e-01", "2.4543e+00"}, 
         {"2.8185e-01", "2.3729e+00"}, 
         {"2.8376e-01", "2.3009e+00"}, 
         {"2.8570e-01", "2.2378e+00"}, 
         {"2.8766e-01", "2.1830e+00"}, 
         {"2.8966e-01", "2.1358e+00"}, 
         {"2.9168e-01", "2.0956e+00"}, 
         {"2.9372e-01", "2.0616e+00"}, 
         {"2.9580e-01", "2.0331e+00"}, 
         {"2.9791e-01", "2.0096e+00"}, 
         {"3.0005e-01", "1.9904e+00"}, 
         {"3.0222e-01", "1.9750e+00"}, 
         {"3.0442e-01", "1.9629e+00"}, 
         {"3.0665e-01", "1.9538e+00"}, 
         {"3.0891e-01", "1.9472e+00"}, 
         {"3.1121e-01", "1.9429e+00"}, 
         {"3.1354e-01", "1.9405e+00"}, 
         {"3.1591e-01", "1.9397e+00"}, 
         {"3.1832e-01", "1.9405e+00"}, 
         {"3.2076e-01", "1.9424e+00"}, 
         {"3.2324e-01", "1.9455e+00"}, 
         {"3.2576e-01", "1.9494e+00"}, 
         {"3.2831e-01", "1.9541e+00"}, 
         {"3.3091e-01", "1.9595e+00"}, 
         {"3.3355e-01", "1.9653e+00"}, 
         {"3.3623e-01", "1.9716e+00"}, 
         {"3.3896e-01", "1.9782e+00"}, 
         {"3.4173e-01", "1.9850e+00"}, 
         {"3.4454e-01", "1.9920e+00"}, 
         {"3.4741e-01", "1.9989e+00"}, 
         {"3.5032e-01", "2.0059e+00"}, 
         {"3.5328e-01", "2.0128e+00"}, 
         {"3.5629e-01", "2.0195e+00"}, 
         {"3.5935e-01", "2.0259e+00"}, 
         {"3.6246e-01", "2.0320e+00"}, 
         {"3.6563e-01", "2.0377e+00"}, 
         {"3.6886e-01", "2.0428e+00"}, 
         {"3.7214e-01", "2.0474e+00"}, 
         {"3.7548e-01", "2.0513e+00"}, 
         {"3.7888e-01", "2.0543e+00"}, 
         {"3.8235e-01", "2.0565e+00"}, 
         {"3.8588e-01", "2.0575e+00"}, 
         {"3.8947e-01", "2.0574e+00"}, 
         {"3.9313e-01", "2.0558e+00"}, 
         {"3.9686e-01", "2.0528e+00"}, 
         {"4.0066e-01", "2.0480e+00"}, 
         {"4.0454e-01", "2.0416e+00"}, 
         {"4.0849e-01", "2.0337e+00"}, 
         {"4.1252e-01", "2.0249e+00"}, 
         {"4.1663e-01", "2.0170e+00"}, 
         {"4.2082e-01", "2.0139e+00"}, 
         {"4.2510e-01", "2.0215e+00"}, 
         {"4.2947e-01", "1.9748e+00"}, 
         {"4.3392e-01", "1.6611e+00"}, 
         {"4.3847e-01", "1.4432e+00"}, 
         {"4.4312e-01", "1.2573e+00"}, 
         {"4.4786e-01", "1.0840e+00"}, 
         {"4.5271e-01", "9.1489e-01"}, 
         {"4.5767e-01", "7.4554e-01"}, 
         {"4.6273e-01", "5.7364e-01"}, 
         {"4.6791e-01", "4.7218e-01"}, 
         {"4.7320e-01", "4.6313e-01"}, 
         {"4.7862e-01", "4.5342e-01"}, 
         {"4.8416e-01", "4.4314e-01"}, 
         {"4.8983e-01", "4.3233e-01"}, 
         {"4.9564e-01", "4.2105e-01"}, 
         {"5.0158e-01", "4.0936e-01"}, 
         {"5.0767e-01", "3.9731e-01"}, 
         {"5.1391e-01", "3.8494e-01"}, 
         {"5.2030e-01", "3.7229e-01"}, 
         {"5.2686e-01", "3.5942e-01"}, 
         {"5.3358e-01", "3.4637e-01"}, 
         {"5.4048e-01", "3.3317e-01"}, 
         {"5.4756e-01", "3.1988e-01"}, 
         {"5.5482e-01", "3.0653e-01"}, 
         {"5.6228e-01", "2.9317e-01"}, 
         {"5.6994e-01", "2.7984e-01"}, 
         {"5.7782e-01", "2.6660e-01"}, 
         {"5.8591e-01", "2.5348e-01"}, 
         {"5.9424e-01", "2.4053e-01"}, 
         {"6.0281e-01", "2.2782e-01"}, 
         {"6.1162e-01", "2.1538e-01"}, 
         {"6.2070e-01", "2.0326e-01"}, 
         {"6.3005e-01", "1.9151e-01"}, 
         {"6.3969e-01", "1.8017e-01"}, 
         {"6.4963e-01", "1.6927e-01"}, 
         {"6.5988e-01", "1.5880e-01"}, 
         {"6.7046e-01", "1.4869e-01"}, 
         {"6.8138e-01", "1.3873e-01"}, 
         {"6.9267e-01", "1.2802e-01"}, 
         {"7.0433e-01", "1.1392e-01"}, 
         {"7.1640e-01", "1.1165e-01"}, 
         {"7.2889e-01", "1.0992e-01"}, 
         {"7.4182e-01", "1.0775e-01"}, 
         {"7.5521e-01", "1.0506e-01"}, 
         {"7.6910e-01", "1.0173e-01"}, 
         {"7.8351e-01", "9.7601e-02"}, 
         {"7.9847e-01", "9.2432e-02"}, 
         {"8.1402e-01", "8.5863e-02"}, 
         {"8.3018e-01", "7.7266e-02"}, 
         {"8.4699e-01", "6.5330e-02"}, 
         {"8.6450e-01", "4.5715e-02"}, 
         {"8.8275e-01", "1.7586e-02"}, 
         {"9.0179e-01", "1.7184e-02"}, 
         {"9.2166e-01", "1.6758e-02"}, 
         {"9.4243e-01", "1.6327e-02"}, 
         {"9.6416e-01", "1.5895e-02"}, 
         {"9.8691e-01", "1.5465e-02"}, 
         {"1.0108e+00", "1.5037e-02"}, 
         {"1.0358e+00", "1.4613e-02"}, 
         {"1.0621e+00", "1.4192e-02"}, 
         {"1.0898e+00", "1.3776e-02"}, 
         {"1.1190e+00", "1.3363e-02"}, 
         {"1.1497e+00", "1.2954e-02"}, 
         {"1.1822e+00", "1.2550e-02"}, 
         {"1.2166e+00", "1.2149e-02"}, 
         {"1.2531e+00", "1.1752e-02"}, 
         {"1.2918e+00", "1.1359e-02"}, 
         {"1.3329e+00", "1.0970e-02"}, 
         {"1.3768e+00", "1.0584e-02"}, 
         {"1.4237e+00", "1.0202e-02"}, 
         {"1.4739e+00", "9.8236e-03"}, 
         {"1.5277e+00", "9.4483e-03"}, 
         {"1.5857e+00", "9.0761e-03"}, 
         {"1.6482e+00", "8.7070e-03"}, 
         {"1.7158e+00", "8.3408e-03"}, 
         {"1.7892e+00", "7.9774e-03"}, 
         {"1.8692e+00", "7.6168e-03"}, 
         {"1.9566e+00", "7.2587e-03"}, 
         {"2.0527e+00", "6.9030e-03"}, 
         {"2.1586e+00", "6.5497e-03"}, 
         {"2.2761e+00", "6.1986e-03"}, 
         {"2.4071e+00", "5.8496e-03"}, 
         {"2.5541e+00", "5.5025e-03"}, 
         {"2.7203e+00", "5.1573e-03"}, 
         {"2.9095e+00", "4.8139e-03"}, 
         {"3.1271e+00", "4.4721e-03"}, 
         {"3.3798e+00", "4.1317e-03"}, 
         {"3.6770e+00", "3.7928e-03"}, 
         {"4.0315e+00", "3.4551e-03"}, 
         {"4.4616e+00", "3.1186e-03"}, 
         {"4.9945e+00", "2.7831e-03"}, 
         {"5.6719e+00", "2.4486e-03"}, 
         {"6.5619e+00", "2.1148e-03"}, 
         {"7.7832e+00", "1.7818e-03"}, 
         {"9.5631e+00", "1.4494e-03"}, 
         {"1.2398e+01", "1.1175e-03"}});
    model.component("comp1").material("mat2").propertyGroup("RefractiveIndex").func("int2")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat2").propertyGroup("RefractiveIndex").func("int2")
         .set("argunit", new String[]{"um"});
    model.component("comp1").material("mat2").propertyGroup("RefractiveIndex")
         .set("n", new String[]{"nr(c_const/freq)", "0", "0", "0", "nr(c_const/freq)", "0", "0", "0", "nr(c_const/freq)"});
    model.component("comp1").material("mat2").propertyGroup("RefractiveIndex")
         .set("ki", new String[]{"ni(c_const/freq)", "0", "0", "0", "ni(c_const/freq)", "0", "0", "0", "ni(c_const/freq)"});
    model.component("comp1").material("mat2").propertyGroup("RefractiveIndex").addInput("frequency");

//    In the Settings window for Material, locate the Geometric Entity Selection section.
//    From the Selection list, select GaAs Domains.

    model.component("comp1").material("mat2").selection().named("geom1_unisel1");

//    Locate the Material Contents section.
//    In the table, enter the following settings:

    model.component("comp1").material("mat2").propertyGroup("def")
         .set("thermalconductivity", new String[]{"55[W/(m*K)]"});
    model.component("comp1").material("mat2").propertyGroup("def").set("density", new String[]{"5318[kg/m^3]"});
    model.component("comp1").material("mat2").propertyGroup("def").set("heatcapacity", new String[]{"330[J/(kg*K)]"});
    model.component("comp1").material("mat2").propertyGroup()
         .create("Enu", "Enu", "Young's_modulus_and_Poisson's_ratio");
    model.component("comp1").material("mat2").propertyGroup("Enu").set("E", new String[]{"85.5[GPa]"});
    model.component("comp1").material("mat2").propertyGroup("Enu").set("nu", new String[]{"0.31"});
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"5.73e-6"});

//    In the tree, select Optical > Inorganic Materials > As - Arsenides > Models and simulations > AlAs (Aluminium arsenide) (Rakic and Majewski 1996: n,k 0.221-2.48 um).
//    Click Add to Component in the window toolbar.

    model.component("comp1").material().create("mat3", "Common");
    model.component("comp1").material("mat3").propertyGroup()
         .create("RefractiveIndex", "RefractiveIndex", "Refractive index");
    model.component("comp1").material("mat3").propertyGroup("RefractiveIndex").func().create("int1", "Interpolation");
    model.component("comp1").material("mat3").propertyGroup("RefractiveIndex").func().create("int2", "Interpolation");
    model.component("comp1").material("mat3")
         .label("AlAs (Aluminium arsenide) (Rakic and Majewski 1996: n,k 0.221-2.48 um)");
    model.component("comp1").material("mat3").propertyGroup("RefractiveIndex").func("int1").set("funcname", "nr");

    return model;
  }

  public static Model run3(Model model) {
    model.component("comp1").material("mat3").propertyGroup("RefractiveIndex").func("int1")
         .set("table", new String[][]{{"2.2140e-01", "1.4237e+00"}, 
         {"2.2242e-01", "1.4464e+00"}, 
         {"2.2345e-01", "1.4711e+00"}, 
         {"2.2448e-01", "1.4978e+00"}, 
         {"2.2553e-01", "1.5267e+00"}, 
         {"2.2659e-01", "1.5582e+00"}, 
         {"2.2765e-01", "1.5925e+00"}, 
         {"2.2873e-01", "1.6297e+00"}, 
         {"2.2981e-01", "1.6704e+00"}, 
         {"2.3091e-01", "1.7147e+00"}, 
         {"2.3202e-01", "1.7631e+00"}, 
         {"2.3314e-01", "1.8158e+00"}, 
         {"2.3427e-01", "1.8735e+00"}, 
         {"2.3541e-01", "1.9363e+00"}, 
         {"2.3656e-01", "2.0049e+00"}, 
         {"2.3772e-01", "2.0796e+00"}, 
         {"2.3889e-01", "2.1607e+00"}, 
         {"2.4008e-01", "2.2487e+00"}, 
         {"2.4128e-01", "2.3437e+00"}, 
         {"2.4249e-01", "2.4458e+00"}, 
         {"2.4371e-01", "2.5549e+00"}, 
         {"2.4494e-01", "2.6705e+00"}, 
         {"2.4619e-01", "2.7920e+00"}, 
         {"2.4745e-01", "2.9184e+00"}, 
         {"2.4872e-01", "3.0482e+00"}, 
         {"2.5000e-01", "3.1797e+00"}, 
         {"2.5130e-01", "3.3110e+00"}, 
         {"2.5261e-01", "3.4402e+00"}, 
         {"2.5394e-01", "3.5655e+00"}, 
         {"2.5528e-01", "3.6854e+00"}, 
         {"2.5663e-01", "3.7992e+00"}, 
         {"2.5800e-01", "3.9065e+00"}, 
         {"2.5939e-01", "4.0077e+00"}, 
         {"2.6078e-01", "4.1035e+00"}, 
         {"2.6220e-01", "4.1942e+00"}, 
         {"2.6363e-01", "4.2798e+00"}, 
         {"2.6507e-01", "4.3583e+00"}, 
         {"2.6653e-01", "4.4266e+00"}, 
         {"2.6801e-01", "4.4802e+00"}, 
         {"2.6950e-01", "4.5155e+00"}, 
         {"2.7101e-01", "4.5307e+00"}, 
         {"2.7254e-01", "4.5267e+00"}, 
         {"2.7408e-01", "4.5065e+00"}, 
         {"2.7564e-01", "4.4738e+00"}, 
         {"2.7722e-01", "4.4324e+00"}, 
         {"2.7882e-01", "4.3854e+00"}, 
         {"2.8044e-01", "4.3354e+00"}, 
         {"2.8207e-01", "4.2841e+00"}, 
         {"2.8373e-01", "4.2330e+00"}, 
         {"2.8540e-01", "4.1834e+00"}, 
         {"2.8709e-01", "4.1364e+00"}, 
         {"2.8881e-01", "4.0937e+00"}, 
         {"2.9054e-01", "4.0578e+00"}, 
         {"2.9230e-01", "4.0327e+00"}, 
         {"2.9407e-01", "4.0255e+00"}, 
         {"2.9587e-01", "4.0470e+00"}, 
         {"2.9769e-01", "4.1111e+00"}, 
         {"2.9954e-01", "4.2293e+00"}, 
         {"3.0140e-01", "4.3953e+00"}, 
         {"3.0329e-01", "4.5730e+00"}, 
         {"3.0521e-01", "4.7129e+00"}, 
         {"3.0714e-01", "4.7926e+00"}, 
         {"3.0911e-01", "4.8263e+00"}, 
         {"3.1109e-01", "4.8436e+00"}, 
         {"3.1311e-01", "4.8714e+00"}, 
         {"3.1515e-01", "4.9270e+00"}, 
         {"3.1721e-01", "5.0094e+00"}, 
         {"3.1931e-01", "5.0937e+00"}, 
         {"3.2143e-01", "5.1445e+00"}, 
         {"3.2358e-01", "5.1442e+00"}, 
         {"3.2576e-01", "5.1001e+00"}, 
         {"3.2797e-01", "5.0298e+00"}, 
         {"3.3020e-01", "4.9482e+00"}, 
         {"3.3247e-01", "4.8644e+00"}, 
         {"3.3477e-01", "4.7830e+00"}, 
         {"3.3711e-01", "4.7063e+00"}, 
         {"3.3947e-01", "4.6347e+00"}, 
         {"3.4187e-01", "4.5685e+00"}, 
         {"3.4430e-01", "4.5073e+00"}, 
         {"3.4677e-01", "4.4508e+00"}, 
         {"3.4928e-01", "4.3985e+00"}, 
         {"3.5182e-01", "4.3500e+00"}, 
         {"3.5439e-01", "4.3051e+00"}, 
         {"3.5701e-01", "4.2633e+00"}, 
         {"3.5966e-01", "4.2243e+00"}, 
         {"3.6236e-01", "4.1880e+00"}, 
         {"3.6509e-01", "4.1541e+00"}, 
         {"3.6787e-01", "4.1225e+00"}, 
         {"3.7069e-01", "4.0928e+00"}, 
         {"3.7355e-01", "4.0651e+00"}, 
         {"3.7645e-01", "4.0391e+00"}, 
         {"3.7941e-01", "4.0148e+00"}, 
         {"3.8241e-01", "3.9919e+00"}, 
         {"3.8545e-01", "3.9704e+00"}, 
         {"3.8855e-01", "3.9390e+00"}, 
         {"3.9169e-01", "3.9102e+00"}, 
         {"3.9489e-01", "3.8858e+00"}, 
         {"3.9814e-01", "3.8636e+00"}, 
         {"4.0145e-01", "3.8430e+00"}, 
         {"4.0480e-01", "3.8225e+00"}, 
         {"4.0822e-01", "3.7968e+00"}, 
         {"4.1169e-01", "3.7615e+00"}, 
         {"4.1523e-01", "3.7313e+00"}, 
         {"4.1882e-01", "3.7068e+00"}, 
         {"4.2248e-01", "3.6782e+00"}, 
         {"4.2620e-01", "3.6505e+00"}, 
         {"4.2999e-01", "3.6250e+00"}, 
         {"4.3385e-01", "3.6011e+00"}, 
         {"4.3777e-01", "3.5786e+00"}, 
         {"4.4177e-01", "3.5571e+00"}, 
         {"4.4584e-01", "3.5366e+00"}, 
         {"4.4999e-01", "3.5169e+00"}, 
         {"4.5421e-01", "3.4980e+00"}, 
         {"4.5852e-01", "3.4798e+00"}, 
         {"4.6291e-01", "3.4622e+00"}, 
         {"4.6738e-01", "3.4452e+00"}, 
         {"4.7194e-01", "3.4287e+00"}, 
         {"4.7659e-01", "3.4128e+00"}, 
         {"4.8133e-01", "3.3973e+00"}, 
         {"4.8616e-01", "3.3823e+00"}, 
         {"4.9110e-01", "3.3677e+00"}, 
         {"4.9614e-01", "3.3535e+00"}, 
         {"5.0128e-01", "3.3398e+00"}, 
         {"5.0653e-01", "3.3264e+00"}, 
         {"5.1188e-01", "3.3133e+00"}, 
         {"5.1736e-01", "3.3006e+00"}, 
         {"5.2295e-01", "3.2883e+00"}, 
         {"5.2867e-01", "3.2762e+00"}, 
         {"5.3451e-01", "3.2645e+00"}, 
         {"5.4048e-01", "3.2530e+00"}, 
         {"5.4659e-01", "3.2418e+00"}, 
         {"5.5283e-01", "3.2309e+00"}, 
         {"5.5922e-01", "3.2203e+00"}, 
         {"5.6576e-01", "3.2099e+00"}, 
         {"5.7246e-01", "3.1997e+00"}, 
         {"5.7931e-01", "3.1898e+00"}, 
         {"5.8633e-01", "3.1802e+00"}, 
         {"5.9353e-01", "3.1707e+00"}, 
         {"6.0090e-01", "3.1615e+00"}, 
         {"6.0846e-01", "3.1525e+00"}, 
         {"6.1621e-01", "3.1437e+00"}, 
         {"6.2416e-01", "3.1350e+00"}, 
         {"6.3231e-01", "3.1266e+00"}, 
         {"6.4069e-01", "3.1184e+00"}, 
         {"6.4929e-01", "3.1103e+00"}, 
         {"6.5812e-01", "3.1025e+00"}, 
         {"6.6719e-01", "3.0948e+00"}, 
         {"6.7652e-01", "3.0872e+00"}, 
         {"6.8612e-01", "3.0799e+00"}, 
         {"6.9599e-01", "3.0727e+00"}, 
         {"7.0615e-01", "3.0656e+00"}, 
         {"7.1661e-01", "3.0587e+00"}, 
         {"7.2738e-01", "3.0520e+00"}, 
         {"7.3849e-01", "3.0454e+00"}, 
         {"7.4993e-01", "3.0390e+00"}, 
         {"7.6174e-01", "3.0326e+00"}, 
         {"7.7393e-01", "3.0265e+00"}, 
         {"7.8651e-01", "3.0204e+00"}, 
         {"7.9951e-01", "3.0146e+00"}, 
         {"8.1294e-01", "3.0088e+00"}, 
         {"8.2684e-01", "3.0031e+00"}, 
         {"8.4122e-01", "2.9976e+00"}, 
         {"8.5610e-01", "2.9922e+00"}, 
         {"8.7152e-01", "2.9870e+00"}, 
         {"8.8751e-01", "2.9818e+00"}, 
         {"9.0410e-01", "2.9768e+00"}, 
         {"9.2132e-01", "2.9719e+00"}, 
         {"9.3920e-01", "2.9670e+00"}, 
         {"9.5780e-01", "2.9623e+00"}, 
         {"9.7714e-01", "2.9578e+00"}, 
         {"9.9729e-01", "2.9533e+00"}, 
         {"1.0183e+00", "2.9489e+00"}, 
         {"1.0402e+00", "2.9446e+00"}, 
         {"1.0630e+00", "2.9405e+00"}, 
         {"1.0869e+00", "2.9364e+00"}, 
         {"1.1119e+00", "2.9324e+00"}, 
         {"1.1380e+00", "2.9285e+00"}, 
         {"1.1655e+00", "2.9248e+00"}, 
         {"1.1942e+00", "2.9211e+00"}, 
         {"1.2245e+00", "2.9175e+00"}, 
         {"1.2563e+00", "2.9140e+00"}, 
         {"1.2897e+00", "2.9106e+00"}, 
         {"1.3251e+00", "2.9073e+00"}, 
         {"1.3624e+00", "2.9041e+00"}, 
         {"1.4019e+00", "2.9009e+00"}, 
         {"1.4437e+00", "2.8979e+00"}, 
         {"1.4881e+00", "2.8949e+00"}, 
         {"1.5353e+00", "2.8920e+00"}, 
         {"1.5857e+00", "2.8893e+00"}, 
         {"1.6394e+00", "2.8865e+00"}, 
         {"1.6969e+00", "2.8839e+00"}, 
         {"1.7586e+00", "2.8814e+00"}, 
         {"1.8249e+00", "2.8789e+00"}, 
         {"1.8965e+00", "2.8765e+00"}, 
         {"1.9738e+00", "2.8742e+00"}, 
         {"2.0578e+00", "2.8720e+00"}, 
         {"2.1492e+00", "2.8699e+00"}, 
         {"2.2491e+00", "2.8678e+00"}, 
         {"2.3588e+00", "2.8658e+00"}, 
         {"2.4797e+00", "2.8639e+00"}});
    model.component("comp1").material("mat3").propertyGroup("RefractiveIndex").func("int1")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat3").propertyGroup("RefractiveIndex").func("int1")
         .set("argunit", new String[]{"um"});
    model.component("comp1").material("mat3").propertyGroup("RefractiveIndex").func("int2").set("funcname", "ni");
    model.component("comp1").material("mat3").propertyGroup("RefractiveIndex").func("int2")
         .set("table", new String[][]{{"2.2140e-01", "3.1989e+00"}, 
         {"2.2242e-01", "3.2370e+00"}, 
         {"2.2345e-01", "3.2763e+00"}, 
         {"2.2448e-01", "3.3169e+00"}, 
         {"2.2553e-01", "3.3588e+00"}, 
         {"2.2659e-01", "3.4020e+00"}, 
         {"2.2765e-01", "3.4464e+00"}, 
         {"2.2873e-01", "3.4920e+00"}, 
         {"2.2981e-01", "3.5388e+00"}, 
         {"2.3091e-01", "3.5865e+00"}, 
         {"2.3202e-01", "3.6350e+00"}, 
         {"2.3314e-01", "3.6842e+00"}, 
         {"2.3427e-01", "3.7337e+00"}, 
         {"2.3541e-01", "3.7832e+00"}, 
         {"2.3656e-01", "3.8322e+00"}, 
         {"2.3772e-01", "3.8802e+00"}, 
         {"2.3889e-01", "3.9264e+00"}, 
         {"2.4008e-01", "3.9701e+00"}, 
         {"2.4128e-01", "4.0102e+00"}, 
         {"2.4249e-01", "4.0457e+00"}, 
         {"2.4371e-01", "4.0754e+00"}, 
         {"2.4494e-01", "4.0979e+00"}, 
         {"2.4619e-01", "4.1118e+00"}, 
         {"2.4745e-01", "4.1160e+00"}, 
         {"2.4872e-01", "4.1094e+00"}, 
         {"2.5000e-01", "4.0911e+00"}, 
         {"2.5130e-01", "4.0610e+00"}, 
         {"2.5261e-01", "4.0192e+00"}, 
         {"2.5394e-01", "3.9665e+00"}, 
         {"2.5528e-01", "3.9039e+00"}, 
         {"2.5663e-01", "3.8331e+00"}, 
         {"2.5800e-01", "3.7552e+00"}, 
         {"2.5939e-01", "3.6714e+00"}, 
         {"2.6078e-01", "3.5819e+00"}, 
         {"2.6220e-01", "3.4863e+00"}, 
         {"2.6363e-01", "3.3831e+00"}, 
         {"2.6507e-01", "3.2708e+00"}, 
         {"2.6653e-01", "3.1486e+00"}, 
         {"2.6801e-01", "3.0177e+00"}, 
         {"2.6950e-01", "2.8819e+00"}, 
         {"2.7101e-01", "2.7466e+00"}, 
         {"2.7254e-01", "2.6174e+00"}, 
         {"2.7408e-01", "2.4988e+00"}, 
         {"2.7564e-01", "2.3933e+00"}, 
         {"2.7722e-01", "2.3022e+00"}, 
         {"2.7882e-01", "2.2255e+00"}, 
         {"2.8044e-01", "2.1629e+00"}, 
         {"2.8207e-01", "2.1138e+00"}, 
         {"2.8373e-01", "2.0777e+00"}, 
         {"2.8540e-01", "2.0547e+00"}, 
         {"2.8709e-01", "2.0451e+00"}, 
         {"2.8881e-01", "2.0499e+00"}, 
         {"2.9054e-01", "2.0705e+00"}, 
         {"2.9230e-01", "2.1088e+00"}, 
         {"2.9407e-01", "2.1658e+00"}, 
         {"2.9587e-01", "2.2402e+00"}, 
         {"2.9769e-01", "2.3229e+00"}, 
         {"2.9954e-01", "2.3918e+00"}, 
         {"3.0140e-01", "2.4124e+00"}, 
         {"3.0329e-01", "2.3581e+00"}, 
         {"3.0521e-01", "2.2396e+00"}, 
         {"3.0714e-01", "2.0998e+00"}, 
         {"3.0911e-01", "1.9772e+00"}, 
         {"3.1109e-01", "1.8865e+00"}, 
         {"3.1311e-01", "1.8217e+00"}, 
         {"3.1515e-01", "1.7621e+00"}, 
         {"3.1721e-01", "1.6785e+00"}, 
         {"3.1931e-01", "1.5487e+00"}, 
         {"3.2143e-01", "1.3781e+00"}, 
         {"3.2358e-01", "1.1957e+00"}, 
         {"3.2576e-01", "1.0288e+00"}, 
         {"3.2797e-01", "8.8937e-01"}, 
         {"3.3020e-01", "7.7761e-01"}, 
         {"3.3247e-01", "6.8904e-01"}, 
         {"3.3477e-01", "6.1852e-01"}, 
         {"3.3711e-01", "5.6168e-01"}, 
         {"3.3947e-01", "5.1517e-01"}, 
         {"3.4187e-01", "4.7648e-01"}, 
         {"3.4430e-01", "4.4379e-01"}, 
         {"3.4677e-01", "4.1574e-01"}, 
         {"3.4928e-01", "3.9132e-01"}, 
         {"3.5182e-01", "3.6975e-01"}, 
         {"3.5439e-01", "3.5043e-01"}, 
         {"3.5701e-01", "3.3290e-01"}, 
         {"3.5966e-01", "3.1678e-01"}, 
         {"3.6236e-01", "3.0175e-01"}, 
         {"3.6509e-01", "2.8754e-01"}, 
         {"3.6787e-01", "2.7391e-01"}, 
         {"3.7069e-01", "2.6063e-01"}, 
         {"3.7355e-01", "2.4746e-01"}, 
         {"3.7645e-01", "2.3415e-01"}, 
         {"3.7941e-01", "2.2033e-01"}, 
         {"3.8241e-01", "2.0543e-01"}, 
         {"3.8545e-01", "1.8785e-01"}, 
         {"3.8855e-01", "1.6510e-01"}, 
         {"3.9169e-01", "1.5569e-01"}, 
         {"3.9489e-01", "1.4573e-01"}, 
         {"3.9814e-01", "1.3506e-01"}, 
         {"4.0145e-01", "1.2336e-01"}, 
         {"4.0480e-01", "1.0981e-01"}, 
         {"4.0822e-01", "9.3241e-02"}, 
         {"4.1169e-01", "7.8298e-02"}, 
         {"4.1523e-01", "6.5678e-02"}, 
         {"4.1882e-01", "4.7059e-02"}, 
         {"4.2248e-01", "3.3231e-02"}, 
         {"4.2620e-01", "2.8085e-02"}, 
         {"4.2999e-01", "2.5642e-02"}, 
         {"4.3385e-01", "2.3682e-02"}, 
         {"4.3777e-01", "2.1879e-02"}, 
         {"4.4177e-01", "2.0202e-02"}, 
         {"4.4584e-01", "1.8643e-02"}, 
         {"4.4999e-01", "1.7194e-02"}, 
         {"4.5421e-01", "1.5849e-02"}, 
         {"4.5852e-01", "1.4601e-02"}, 
         {"4.6291e-01", "1.3442e-02"}, 
         {"4.6738e-01", "1.2368e-02"}, 
         {"4.7194e-01", "1.1372e-02"}, 
         {"4.7659e-01", "1.0450e-02"}, 
         {"4.8133e-01", "9.5962e-03"}, 
         {"4.8616e-01", "8.8061e-03"}, 
         {"4.9110e-01", "8.0755e-03"}, 
         {"4.9614e-01", "7.4003e-03"}, 
         {"5.0128e-01", "6.7766e-03"}, 
         {"5.0653e-01", "6.2009e-03"}, 
         {"5.1188e-01", "5.6700e-03"}, 
         {"5.1736e-01", "5.1805e-03"}, 
         {"5.2295e-01", "4.7296e-03"}, 
         {"5.2867e-01", "4.3146e-03"}, 
         {"5.3451e-01", "3.9329e-03"}, 
         {"5.4048e-01", "3.5820e-03"}, 
         {"5.4659e-01", "3.2598e-03"}, 
         {"5.5283e-01", "2.9641e-03"}, 
         {"5.5922e-01", "2.6930e-03"}, 
         {"5.6576e-01", "2.4446e-03"}, 
         {"5.7246e-01", "2.2172e-03"}, 
         {"5.7931e-01", "2.0092e-03"}, 
         {"5.8633e-01", "1.8191e-03"}, 
         {"5.9353e-01", "1.6455e-03"}, 
         {"6.0090e-01", "1.4872e-03"}, 
         {"6.0846e-01", "1.3429e-03"}, 
         {"6.1621e-01", "1.2114e-03"}, 
         {"6.2416e-01", "1.0918e-03"}, 
         {"6.3231e-01", "9.8315e-04"}, 
         {"6.4069e-01", "8.8444e-04"}, 
         {"6.4929e-01", "7.9488e-04"}, 
         {"6.5812e-01", "7.1371e-04"}, 
         {"6.6719e-01", "6.4020e-04"}, 
         {"6.7652e-01", "5.7370e-04"}, 
         {"6.8612e-01", "5.1361e-04"}, 
         {"6.9599e-01", "4.5935e-04"}, 
         {"7.0615e-01", "4.1042e-04"}, 
         {"7.1661e-01", "3.6632e-04"}, 
         {"7.2738e-01", "3.2663e-04"}, 
         {"7.3849e-01", "2.9094e-04"}, 
         {"7.4993e-01", "2.5889e-04"}, 
         {"7.6174e-01", "2.3012e-04"}, 
         {"7.7393e-01", "2.0434e-04"}, 
         {"7.8651e-01", "1.8125e-04"}, 
         {"7.9951e-01", "1.6060e-04"}, 
         {"8.1294e-01", "1.4215e-04"}, 
         {"8.2684e-01", "1.2568e-04"}, 
         {"8.4122e-01", "1.1100e-04"}, 
         {"8.5610e-01", "9.7927e-05"}, 
         {"8.7152e-01", "8.6297e-05"}, 
         {"8.8751e-01", "7.5962e-05"}, 
         {"9.0410e-01", "6.6790e-05"}, 
         {"9.2132e-01", "5.8658e-05"}, 
         {"9.3920e-01", "5.1457e-05"}, 
         {"9.5780e-01", "4.5088e-05"}, 
         {"9.7714e-01", "3.9461e-05"}, 
         {"9.9729e-01", "3.4496e-05"}, 
         {"1.0183e+00", "3.0119e-05"}, 
         {"1.0402e+00", "2.6266e-05"}, 
         {"1.0630e+00", "2.2878e-05"}, 
         {"1.0869e+00", "1.9903e-05"}, 
         {"1.1119e+00", "1.7293e-05"}, 
         {"1.1380e+00", "1.5006e-05"}, 
         {"1.1655e+00", "1.3006e-05"}, 
         {"1.1942e+00", "1.1257e-05"}, 
         {"1.2245e+00", "9.7316e-06"}, 
         {"1.2563e+00", "8.4014e-06"}, 
         {"1.2897e+00", "7.2435e-06"}, 
         {"1.3251e+00", "6.2368e-06"}, 
         {"1.3624e+00", "5.3626e-06"}, 
         {"1.4019e+00", "4.6046e-06"}, 
         {"1.4437e+00", "3.9483e-06"}, 
         {"1.4881e+00", "3.3806e-06"}, 
         {"1.5353e+00", "2.8904e-06"}, 
         {"1.5857e+00", "2.4676e-06"}, 
         {"1.6394e+00", "2.1035e-06"}, 
         {"1.6969e+00", "1.7904e-06"}, 
         {"1.7586e+00", "1.5216e-06"}, 
         {"1.8249e+00", "1.2910e-06"}, 
         {"1.8965e+00", "1.0936e-06"}, 
         {"1.9738e+00", "9.2491e-07"}, 
         {"2.0578e+00", "7.8088e-07"}, 
         {"2.1492e+00", "6.5813e-07"}, 
         {"2.2491e+00", "5.5368e-07"}, 
         {"2.3588e+00", "4.6496e-07"}, 
         {"2.4797e+00", "3.8971e-07"}});
    model.component("comp1").material("mat3").propertyGroup("RefractiveIndex").func("int2")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat3").propertyGroup("RefractiveIndex").func("int2")
         .set("argunit", new String[]{"um"});
    model.component("comp1").material("mat3").propertyGroup("RefractiveIndex")
         .set("n", new String[]{"nr(c_const/freq)", "0", "0", "0", "nr(c_const/freq)", "0", "0", "0", "nr(c_const/freq)"});
    model.component("comp1").material("mat3").propertyGroup("RefractiveIndex")
         .set("ki", new String[]{"ni(c_const/freq)", "0", "0", "0", "ni(c_const/freq)", "0", "0", "0", "ni(c_const/freq)"});
    model.component("comp1").material("mat3").propertyGroup("RefractiveIndex").addInput("frequency");

//    In the Settings window for Material, locate the Geometric Entity Selection section.
//    From the Selection list, select AlAs Layers.

    model.component("comp1").material("mat3").selection().named("geom1_sel2");

//    Locate the Material Contents section.
//    In the table, enter the following settings:

    model.component("comp1").material("mat3").propertyGroup("def")
         .set("thermalconductivity", new String[]{"90[W/(m*K)]"});
    model.component("comp1").material("mat3").propertyGroup("def").set("density", new String[]{"3720[kg/m^3]"});
    model.component("comp1").material("mat3").propertyGroup("def").set("heatcapacity", new String[]{"330[J/(kg*K)]"});
    model.component("comp1").material("mat3").propertyGroup()
         .create("Enu", "Enu", "Young's_modulus_and_Poisson's_ratio");
    model.component("comp1").material("mat3").propertyGroup("Enu").set("E", new String[]{"160[GPa]"});
    model.component("comp1").material("mat3").propertyGroup("Enu").set("nu", new String[]{"0.31"});
    model.component("comp1").material("mat3").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"2.6e-6"});

//    In the tree, select Optical > Miscellaneous > Semiconductor alloys > GaAs-InAs (Gallium indium arsenide, GaInAs) (Adachi 1989: n,k 0.207-12.4 um).
//    Click Add to Component in the window toolbar.

    model.component("comp1").material().create("mat4", "Common");
    model.component("comp1").material("mat4").propertyGroup()
         .create("RefractiveIndex", "RefractiveIndex", "Refractive index");
    model.component("comp1").material("mat4").propertyGroup("RefractiveIndex").func().create("int1", "Interpolation");
    model.component("comp1").material("mat4").propertyGroup("RefractiveIndex").func().create("int2", "Interpolation");
    model.component("comp1").material("mat4")
         .label("GaAs-InAs (Gallium indium arsenide, GaInAs) (Adachi 1989: n,k 0.207-12.4 um)");
    model.component("comp1").material("mat4").propertyGroup("RefractiveIndex").func("int1").set("funcname", "nr");
    model.component("comp1").material("mat4").propertyGroup("RefractiveIndex").func("int1")
         .set("table", new String[][]{{"2.0664e-01", "1.2541e+00"}, 
         {"2.0767e-01", "1.2603e+00"}, 
         {"2.0870e-01", "1.2668e+00"}, 
         {"2.0975e-01", "1.2737e+00"}, 
         {"2.1081e-01", "1.2808e+00"}, 
         {"2.1188e-01", "1.2882e+00"}, 
         {"2.1295e-01", "1.2960e+00"}, 
         {"2.1404e-01", "1.3042e+00"}, 
         {"2.1515e-01", "1.3128e+00"}, 
         {"2.1626e-01", "1.3218e+00"}, 
         {"2.1738e-01", "1.3312e+00"}, 
         {"2.1852e-01", "1.3411e+00"}, 
         {"2.1967e-01", "1.3515e+00"}, 
         {"2.2083e-01", "1.3625e+00"}, 
         {"2.2200e-01", "1.3740e+00"}, 
         {"2.2318e-01", "1.3862e+00"}, 
         {"2.2438e-01", "1.3990e+00"}, 
         {"2.2559e-01", "1.4126e+00"}, 
         {"2.2681e-01", "1.4270e+00"}, 
         {"2.2805e-01", "1.4421e+00"}, 
         {"2.2930e-01", "1.4582e+00"}, 
         {"2.3057e-01", "1.4753e+00"}, 
         {"2.3184e-01", "1.4934e+00"}, 
         {"2.3314e-01", "1.5126e+00"}, 
         {"2.3444e-01", "1.5330e+00"}, 
         {"2.3577e-01", "1.5548e+00"}, 
         {"2.3710e-01", "1.5781e+00"}, 
         {"2.3845e-01", "1.6028e+00"}, 
         {"2.3982e-01", "1.6293e+00"}, 
         {"2.4120e-01", "1.6576e+00"}, 
         {"2.4260e-01", "1.6878e+00"}, 
         {"2.4402e-01", "1.7202e+00"}, 
         {"2.4545e-01", "1.7549e+00"}, 
         {"2.4690e-01", "1.7921e+00"}, 
         {"2.4837e-01", "1.8320e+00"}, 
         {"2.4985e-01", "1.8747e+00"}, 
         {"2.5135e-01", "1.9206e+00"}, 
         {"2.5287e-01", "1.9697e+00"}, 
         {"2.5441e-01", "2.0224e+00"}, 
         {"2.5597e-01", "2.0787e+00"}, 
         {"2.5755e-01", "2.1388e+00"}, 
         {"2.5914e-01", "2.2030e+00"}, 
         {"2.6076e-01", "2.2712e+00"}, 
         {"2.6239e-01", "2.3434e+00"}, 
         {"2.6405e-01", "2.4197e+00"}, 
         {"2.6573e-01", "2.4997e+00"}, 
         {"2.6743e-01", "2.5832e+00"}, 
         {"2.6915e-01", "2.6698e+00"}, 
         {"2.7089e-01", "2.7587e+00"}, 
         {"2.7266e-01", "2.8492e+00"}, 
         {"2.7445e-01", "2.9403e+00"}, 
         {"2.7626e-01", "3.0309e+00"}, 
         {"2.7810e-01", "3.1197e+00"}, 
         {"2.7996e-01", "3.2056e+00"}, 
         {"2.8185e-01", "3.2873e+00"}, 
         {"2.8376e-01", "3.3636e+00"}, 
         {"2.8570e-01", "3.4336e+00"}, 
         {"2.8766e-01", "3.4967e+00"}, 
         {"2.8966e-01", "3.5522e+00"}, 
         {"2.9168e-01", "3.6000e+00"}, 
         {"2.9372e-01", "3.6402e+00"}, 
         {"2.9580e-01", "3.6730e+00"}, 
         {"2.9791e-01", "3.6989e+00"}, 
         {"3.0005e-01", "3.7185e+00"}, 
         {"3.0222e-01", "3.7325e+00"}, 
         {"3.0442e-01", "3.7417e+00"}, 
         {"3.0665e-01", "3.7467e+00"}, 
         {"3.0891e-01", "3.7484e+00"}, 
         {"3.1121e-01", "3.7473e+00"}, 
         {"3.1354e-01", "3.7442e+00"}, 
         {"3.1591e-01", "3.7395e+00"}, 
         {"3.1832e-01", "3.7338e+00"}, 
         {"3.2076e-01", "3.7275e+00"}, 
         {"3.2324e-01", "3.7210e+00"}, 
         {"3.2576e-01", "3.7146e+00"}, 
         {"3.2831e-01", "3.7087e+00"}, 
         {"3.3091e-01", "3.7034e+00"}, 
         {"3.3355e-01", "3.6989e+00"}, 
         {"3.3623e-01", "3.6955e+00"}, 
         {"3.3896e-01", "3.6932e+00"}, 
         {"3.4173e-01", "3.6923e+00"}, 
         {"3.4454e-01", "3.6928e+00"}, 
         {"3.4741e-01", "3.6947e+00"}, 
         {"3.5032e-01", "3.6983e+00"}, 
         {"3.5328e-01", "3.7036e+00"}, 
         {"3.5629e-01", "3.7106e+00"}, 
         {"3.5935e-01", "3.7194e+00"}, 
         {"3.6246e-01", "3.7300e+00"}, 
         {"3.6563e-01", "3.7426e+00"}, 
         {"3.6886e-01", "3.7573e+00"}, 
         {"3.7214e-01", "3.7740e+00"}, 
         {"3.7548e-01", "3.7928e+00"}, 
         {"3.7888e-01", "3.8139e+00"}, 
         {"3.8235e-01", "3.8374e+00"}, 
         {"3.8588e-01", "3.8632e+00"}, 
         {"3.8947e-01", "3.8916e+00"}, 
         {"3.9313e-01", "3.9226e+00"}, 
         {"3.9686e-01", "3.9564e+00"}, 
         {"4.0066e-01", "3.9931e+00"}, 
         {"4.0454e-01", "4.0328e+00"}, 
         {"4.0849e-01", "4.0756e+00"}, 
         {"4.1252e-01", "4.1216e+00"}, 
         {"4.1663e-01", "4.1705e+00"}, 
         {"4.2082e-01", "4.2222e+00"}, 
         {"4.2510e-01", "4.2758e+00"}, 
         {"4.2947e-01", "4.3300e+00"}, 
         {"4.3392e-01", "4.3832e+00"}, 
         {"4.3847e-01", "4.4160e+00"}, 
         {"4.4312e-01", "4.4163e+00"}, 
         {"4.4786e-01", "4.4364e+00"}, 
         {"4.5271e-01", "4.4611e+00"}, 
         {"4.5767e-01", "4.4891e+00"}, 
         {"4.6273e-01", "4.5191e+00"}, 
         {"4.6791e-01", "4.5490e+00"}, 
         {"4.7320e-01", "4.5746e+00"}, 
         {"4.7862e-01", "4.5909e+00"}, 
         {"4.8416e-01", "4.7107e+00"}, 
         {"4.8983e-01", "4.6092e+00"}, 
         {"4.9564e-01", "4.5265e+00"}, 
         {"5.0158e-01", "4.4463e+00"}, 
         {"5.0767e-01", "4.3682e+00"}, 
         {"5.1391e-01", "4.2935e+00"}, 
         {"5.2030e-01", "4.2264e+00"}, 
         {"5.2686e-01", "4.1844e+00"}, 
         {"5.3358e-01", "4.1443e+00"}, 
         {"5.4048e-01", "4.1062e+00"}, 
         {"5.4756e-01", "4.0703e+00"}, 
         {"5.5482e-01", "4.0363e+00"}, 
         {"5.6228e-01", "4.0042e+00"}, 
         {"5.6994e-01", "3.9738e+00"}, 
         {"5.7782e-01", "3.9450e+00"}, 
         {"5.8591e-01", "3.9176e+00"}, 
         {"5.9424e-01", "3.8917e+00"}, 
         {"6.0281e-01", "3.8670e+00"}, 
         {"6.1162e-01", "3.8436e+00"}, 
         {"6.2070e-01", "3.8212e+00"}, 
         {"6.3005e-01", "3.7999e+00"}, 
         {"6.3969e-01", "3.7795e+00"}, 
         {"6.4963e-01", "3.7601e+00"}, 
         {"6.5988e-01", "3.7416e+00"}, 
         {"6.7046e-01", "3.7240e+00"}, 
         {"6.8138e-01", "3.7071e+00"}, 
         {"6.9267e-01", "3.6911e+00"}, 
         {"7.0433e-01", "3.6758e+00"}, 
         {"7.1640e-01", "3.6613e+00"}, 
         {"7.2889e-01", "3.6475e+00"}, 
         {"7.4182e-01", "3.6344e+00"}, 
         {"7.5521e-01", "3.6220e+00"}, 
         {"7.6910e-01", "3.6104e+00"}, 
         {"7.8351e-01", "3.5994e+00"}, 
         {"7.9847e-01", "3.5891e+00"}, 
         {"8.1402e-01", "3.5794e+00"}, 
         {"8.3018e-01", "3.5705e+00"}, 
         {"8.4699e-01", "3.5622e+00"}, 
         {"8.6450e-01", "3.5546e+00"}, 
         {"8.8275e-01", "3.5477e+00"}, 
         {"9.0179e-01", "3.5415e+00"}, 
         {"9.2166e-01", "3.5360e+00"}, 
         {"9.4243e-01", "3.5312e+00"}, 
         {"9.6416e-01", "3.5271e+00"}, 
         {"9.8691e-01", "3.5238e+00"}, 
         {"1.0108e+00", "3.5212e+00"}, 
         {"1.0358e+00", "3.5194e+00"}, 
         {"1.0621e+00", "3.5184e+00"}, 
         {"1.0898e+00", "3.5182e+00"}, 
         {"1.1190e+00", "3.5187e+00"}, 
         {"1.1497e+00", "3.5201e+00"}, 
         {"1.1822e+00", "3.5223e+00"}, 
         {"1.2166e+00", "3.5137e+00"}, 
         {"1.2531e+00", "3.5106e+00"}, 
         {"1.2918e+00", "3.5098e+00"}, 
         {"1.3329e+00", "3.5106e+00"}, 
         {"1.3768e+00", "3.5127e+00"}, 
         {"1.4237e+00", "3.5162e+00"}, 
         {"1.4739e+00", "3.5211e+00"}, 
         {"1.5277e+00", "3.5276e+00"}, 
         {"1.5857e+00", "3.5356e+00"}, 
         {"1.6482e+00", "3.5455e+00"}, 
         {"1.7158e+00", "3.5041e+00"}, 
         {"1.7892e+00", "3.4886e+00"}, 
         {"1.8692e+00", "3.4776e+00"}, 
         {"1.9566e+00", "3.4688e+00"}, 
         {"2.0527e+00", "3.4614e+00"}, 
         {"2.1586e+00", "3.4549e+00"}, 
         {"2.2761e+00", "3.4492e+00"}, 
         {"2.4071e+00", "3.4442e+00"}, 
         {"2.5541e+00", "3.4396e+00"}, 
         {"2.7203e+00", "3.4354e+00"}, 
         {"2.9095e+00", "3.4317e+00"}, 
         {"3.1271e+00", "3.4283e+00"}, 
         {"3.3798e+00", "3.4252e+00"}, 
         {"3.6770e+00", "3.4225e+00"}, 
         {"4.0315e+00", "3.4200e+00"}, 
         {"4.4616e+00", "3.4177e+00"}, 
         {"4.9945e+00", "3.4158e+00"}, 
         {"5.6719e+00", "3.4140e+00"}, 
         {"6.5619e+00", "3.4125e+00"}, 
         {"7.7832e+00", "3.4113e+00"}, 
         {"9.5631e+00", "3.4102e+00"}, 
         {"1.2398e+01", "3.4094e+00"}});
    model.component("comp1").material("mat4").propertyGroup("RefractiveIndex").func("int1")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat4").propertyGroup("RefractiveIndex").func("int1")
         .set("argunit", new String[]{"um"});
    model.component("comp1").material("mat4").propertyGroup("RefractiveIndex").func("int2").set("funcname", "ni");

    return model;
  }

  public static Model run4(Model model) {
    model.component("comp1").material("mat4").propertyGroup("RefractiveIndex").func("int2")
         .set("table", new String[][]{{"2.0664e-01", "1.7728e+00"}, 
         {"2.0767e-01", "1.7923e+00"}, 
         {"2.0870e-01", "1.8121e+00"}, 
         {"2.0975e-01", "1.8324e+00"}, 
         {"2.1081e-01", "1.8530e+00"}, 
         {"2.1188e-01", "1.8740e+00"}, 
         {"2.1295e-01", "1.8955e+00"}, 
         {"2.1404e-01", "1.9174e+00"}, 
         {"2.1515e-01", "1.9397e+00"}, 
         {"2.1626e-01", "1.9625e+00"}, 
         {"2.1738e-01", "1.9859e+00"}, 
         {"2.1852e-01", "2.0097e+00"}, 
         {"2.1967e-01", "2.0340e+00"}, 
         {"2.2083e-01", "2.0588e+00"}, 
         {"2.2200e-01", "2.0842e+00"}, 
         {"2.2318e-01", "2.1102e+00"}, 
         {"2.2438e-01", "2.1368e+00"}, 
         {"2.2559e-01", "2.1639e+00"}, 
         {"2.2681e-01", "2.1917e+00"}, 
         {"2.2805e-01", "2.2201e+00"}, 
         {"2.2930e-01", "2.2491e+00"}, 
         {"2.3057e-01", "2.2788e+00"}, 
         {"2.3184e-01", "2.3091e+00"}, 
         {"2.3314e-01", "2.3401e+00"}, 
         {"2.3444e-01", "2.3718e+00"}, 
         {"2.3577e-01", "2.4041e+00"}, 
         {"2.3710e-01", "2.4371e+00"}, 
         {"2.3845e-01", "2.4708e+00"}, 
         {"2.3982e-01", "2.5050e+00"}, 
         {"2.4120e-01", "2.5398e+00"}, 
         {"2.4260e-01", "2.5752e+00"}, 
         {"2.4402e-01", "2.6110e+00"}, 
         {"2.4545e-01", "2.6472e+00"}, 
         {"2.4690e-01", "2.6837e+00"}, 
         {"2.4837e-01", "2.7203e+00"}, 
         {"2.4985e-01", "2.7570e+00"}, 
         {"2.5135e-01", "2.7933e+00"}, 
         {"2.5287e-01", "2.8293e+00"}, 
         {"2.5441e-01", "2.8645e+00"}, 
         {"2.5597e-01", "2.8985e+00"}, 
         {"2.5755e-01", "2.9312e+00"}, 
         {"2.5914e-01", "2.9618e+00"}, 
         {"2.6076e-01", "2.9900e+00"}, 
         {"2.6239e-01", "3.0151e+00"}, 
         {"2.6405e-01", "3.0365e+00"}, 
         {"2.6573e-01", "3.0536e+00"}, 
         {"2.6743e-01", "3.0655e+00"}, 
         {"2.6915e-01", "3.0716e+00"}, 
         {"2.7089e-01", "3.0712e+00"}, 
         {"2.7266e-01", "3.0637e+00"}, 
         {"2.7445e-01", "3.0486e+00"}, 
         {"2.7626e-01", "3.0256e+00"}, 
         {"2.7810e-01", "2.9947e+00"}, 
         {"2.7996e-01", "2.9560e+00"}, 
         {"2.8185e-01", "2.9100e+00"}, 
         {"2.8376e-01", "2.8574e+00"}, 
         {"2.8570e-01", "2.7991e+00"}, 
         {"2.8766e-01", "2.7363e+00"}, 
         {"2.8966e-01", "2.6702e+00"}, 
         {"2.9168e-01", "2.6020e+00"}, 
         {"2.9372e-01", "2.5330e+00"}, 
         {"2.9580e-01", "2.4643e+00"}, 
         {"2.9791e-01", "2.3970e+00"}, 
         {"3.0005e-01", "2.3318e+00"}, 
         {"3.0222e-01", "2.2695e+00"}, 
         {"3.0442e-01", "2.2105e+00"}, 
         {"3.0665e-01", "2.1552e+00"}, 
         {"3.0891e-01", "2.1039e+00"}, 
         {"3.1121e-01", "2.0565e+00"}, 
         {"3.1354e-01", "2.0131e+00"}, 
         {"3.1591e-01", "1.9737e+00"}, 
         {"3.1832e-01", "1.9381e+00"}, 
         {"3.2076e-01", "1.9062e+00"}, 
         {"3.2324e-01", "1.8777e+00"}, 
         {"3.2576e-01", "1.8524e+00"}, 
         {"3.2831e-01", "1.8302e+00"}, 
         {"3.3091e-01", "1.8109e+00"}, 
         {"3.3355e-01", "1.7942e+00"}, 
         {"3.3623e-01", "1.7799e+00"}, 
         {"3.3896e-01", "1.7678e+00"}, 
         {"3.4173e-01", "1.7578e+00"}, 
         {"3.4454e-01", "1.7496e+00"}, 
         {"3.4741e-01", "1.7432e+00"}, 
         {"3.5032e-01", "1.7382e+00"}, 
         {"3.5328e-01", "1.7347e+00"}, 
         {"3.5629e-01", "1.7325e+00"}, 
         {"3.5935e-01", "1.7313e+00"}, 
         {"3.6246e-01", "1.7312e+00"}, 
         {"3.6563e-01", "1.7320e+00"}, 
         {"3.6886e-01", "1.7335e+00"}, 
         {"3.7214e-01", "1.7357e+00"}, 
         {"3.7548e-01", "1.7386e+00"}, 
         {"3.7888e-01", "1.7419e+00"}, 
         {"3.8235e-01", "1.7456e+00"}, 
         {"3.8588e-01", "1.7496e+00"}, 
         {"3.8947e-01", "1.7538e+00"}, 
         {"3.9313e-01", "1.7582e+00"}, 
         {"3.9686e-01", "1.7626e+00"}, 
         {"4.0066e-01", "1.7670e+00"}, 
         {"4.0454e-01", "1.7713e+00"}, 
         {"4.0849e-01", "1.7755e+00"}, 
         {"4.1252e-01", "1.7795e+00"}, 
         {"4.1663e-01", "1.7835e+00"}, 
         {"4.2082e-01", "1.7875e+00"}, 
         {"4.2510e-01", "1.7919e+00"}, 
         {"4.2947e-01", "1.7971e+00"}, 
         {"4.3392e-01", "1.8040e+00"}, 
         {"4.3847e-01", "1.7691e+00"}, 
         {"4.4312e-01", "1.6587e+00"}, 
         {"4.4786e-01", "1.6034e+00"}, 
         {"4.5271e-01", "1.5622e+00"}, 
         {"4.5767e-01", "1.5283e+00"}, 
         {"4.6273e-01", "1.4992e+00"}, 
         {"4.6791e-01", "1.4742e+00"}, 
         {"4.7320e-01", "1.4534e+00"}, 
         {"4.7862e-01", "1.4380e+00"}, 
         {"4.8416e-01", "1.7698e+00"}, 
         {"4.8983e-01", "1.5138e+00"}, 
         {"4.9564e-01", "1.3304e+00"}, 
         {"5.0158e-01", "1.1689e+00"}, 
         {"5.0767e-01", "1.0161e+00"}, 
         {"5.1391e-01", "8.6563e-01"}, 
         {"5.2030e-01", "7.3073e-01"}, 
         {"5.2686e-01", "7.2078e-01"}, 
         {"5.3358e-01", "7.1021e-01"}, 
         {"5.4048e-01", "6.9901e-01"}, 
         {"5.4756e-01", "6.8717e-01"}, 
         {"5.5482e-01", "6.7470e-01"}, 
         {"5.6228e-01", "6.6162e-01"}, 
         {"5.6994e-01", "6.4796e-01"}, 
         {"5.7782e-01", "6.3374e-01"}, 
         {"5.8591e-01", "6.1898e-01"}, 
         {"5.9424e-01", "6.0373e-01"}, 
         {"6.0281e-01", "5.8799e-01"}, 
         {"6.1162e-01", "5.7179e-01"}, 
         {"6.2070e-01", "5.5517e-01"}, 
         {"6.3005e-01", "5.3814e-01"}, 
         {"6.3969e-01", "5.2074e-01"}, 
         {"6.4963e-01", "5.0298e-01"}, 
         {"6.5988e-01", "4.8491e-01"}, 
         {"6.7046e-01", "4.6655e-01"}, 
         {"6.8138e-01", "4.4795e-01"}, 
         {"6.9267e-01", "4.2913e-01"}, 
         {"7.0433e-01", "4.1014e-01"}, 
         {"7.1640e-01", "3.9102e-01"}, 
         {"7.2889e-01", "3.7184e-01"}, 
         {"7.4182e-01", "3.5264e-01"}, 
         {"7.5521e-01", "3.3350e-01"}, 
         {"7.6910e-01", "3.1448e-01"}, 
         {"7.8351e-01", "2.9567e-01"}, 
         {"7.9847e-01", "2.7716e-01"}, 
         {"8.1402e-01", "2.5904e-01"}, 
         {"8.3018e-01", "2.4145e-01"}, 
         {"8.4699e-01", "2.2450e-01"}, 
         {"8.6450e-01", "2.0834e-01"}, 
         {"8.8275e-01", "1.9314e-01"}, 
         {"9.0179e-01", "1.7909e-01"}, 
         {"9.2166e-01", "1.6638e-01"}, 
         {"9.4243e-01", "1.5525e-01"}, 
         {"9.6416e-01", "1.4597e-01"}, 
         {"9.8691e-01", "1.3883e-01"}, 
         {"1.0108e+00", "1.3417e-01"}, 
         {"1.0358e+00", "1.3232e-01"}, 
         {"1.0621e+00", "1.3144e-01"}, 
         {"1.0898e+00", "1.2998e-01"}, 
         {"1.1190e+00", "1.2766e-01"}, 
         {"1.1497e+00", "1.2390e-01"}, 
         {"1.1822e+00", "1.1656e-01"}, 
         {"1.2166e+00", "1.0917e-01"}, 
         {"1.2531e+00", "1.0848e-01"}, 
         {"1.2918e+00", "1.0723e-01"}, 
         {"1.3329e+00", "1.0526e-01"}, 
         {"1.3768e+00", "1.0232e-01"}, 
         {"1.4237e+00", "9.8017e-02"}, 
         {"1.4739e+00", "9.1720e-02"}, 
         {"1.5277e+00", "8.2274e-02"}, 
         {"1.5857e+00", "6.6993e-02"}, 
         {"1.6482e+00", "3.0846e-02"}, 
         {"1.7158e+00", "1.6086e-02"}, 
         {"1.7892e+00", "1.5428e-02"}, 
         {"1.8692e+00", "1.4754e-02"}, 
         {"1.9566e+00", "1.4075e-02"}, 
         {"2.0527e+00", "1.3395e-02"}, 
         {"2.1586e+00", "1.2716e-02"}, 
         {"2.2761e+00", "1.2039e-02"}, 
         {"2.4071e+00", "1.1364e-02"}, 
         {"2.5541e+00", "1.0692e-02"}, 
         {"2.7203e+00", "1.0022e-02"}, 
         {"2.9095e+00", "9.3559e-03"}, 
         {"3.1271e+00", "8.6921e-03"}, 
         {"3.3798e+00", "8.0310e-03"}, 
         {"3.6770e+00", "7.3723e-03"}, 
         {"4.0315e+00", "6.7161e-03"}, 
         {"4.4616e+00", "6.0620e-03"}, 
         {"4.9945e+00", "5.4098e-03"}, 
         {"5.6719e+00", "4.7595e-03"}, 
         {"6.5619e+00", "4.1108e-03"}, 
         {"7.7832e+00", "3.4634e-03"}, 
         {"9.5631e+00", "2.8173e-03"}, 
         {"1.2398e+01", "2.1720e-03"}});
    model.component("comp1").material("mat4").propertyGroup("RefractiveIndex").func("int2")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat4").propertyGroup("RefractiveIndex").func("int2")
         .set("argunit", new String[]{"um"});
    model.component("comp1").material("mat4").propertyGroup("RefractiveIndex")
         .set("n", new String[]{"nr(c_const/freq)", "0", "0", "0", "nr(c_const/freq)", "0", "0", "0", "nr(c_const/freq)"});
    model.component("comp1").material("mat4").propertyGroup("RefractiveIndex")
         .set("ki", new String[]{"ni(c_const/freq)", "0", "0", "0", "ni(c_const/freq)", "0", "0", "0", "ni(c_const/freq)"});
    model.component("comp1").material("mat4").propertyGroup("RefractiveIndex").addInput("frequency");

//    In the Materials toolbar, click Add Material to close the Add Material window.
//    In the Settings window for Material, locate the Geometric Entity Selection section.
//    From the Selection list, select QW.

    model.component("comp1").material("mat4").selection().named("geom1_sel3");

//    Locate the Material Contents section.
//    In the table, enter the following settings:

    model.component("comp1").material("mat4").propertyGroup("def")
         .set("thermalconductivity", new String[]{"46[W/(m*K)]"});
    model.component("comp1").material("mat4").propertyGroup("def").set("density", new String[]{"5500[kg/m^3]"});
    model.component("comp1").material("mat4").propertyGroup("def").set("heatcapacity", new String[]{"330[J/(kg*K)]"});
    model.component("comp1").material("mat4").propertyGroup()
         .create("Enu", "Enu", "Young's_modulus_and_Poisson's_ratio");
    model.component("comp1").material("mat4").propertyGroup("Enu").set("E", new String[]{"85.5[GPa]"});
    model.component("comp1").material("mat4").propertyGroup("Enu").set("nu", new String[]{"0.31"});
    model.component("comp1").material("mat4").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"5.73e-6"});
    model.component("comp1").material("mat4").propertyGroup("RefractiveIndex")
         .set("ki", new String[]{"ni(c_const/freq)*del_q"});

//    Add a deforming mesh to the air domain.
//    In the Physics toolbar, click Moving Mesh and choose Free Deformation.

    model.component("comp1").common().create("free1", "DeformingDomain");
    model.component("comp1").common("free1").selection().all();

//    In the Settings window for Deforming Domain, locate the Domain Selection section.
//    Click Clear Selection.

    model.component("comp1").common("free1").selection().set();

//    Select Domain 1.

    model.component("comp1").common("free1").selection().set(1);

//    In the Model Builder window, under Study 1, click Step 1: Frequency–Stationary.
//    In the Settings window for Frequency–Stationary, locate the Study Settings section.
//    In the Frequency text field, type c_const/lda0.

    model.study("std1").feature("fstat").set("freq", "c_const/lda0");

//    In the Study toolbar, click Parametric Sweep.

    model.study("std1").create("param", "Parametric");

//    In the Settings window for Parametric Sweep, locate the Study Settings section.
//    Click Add.

    model.study("std1").feature("param").setIndex("pname", "Area_beam", 0);
    model.study("std1").feature("param").setIndex("plistarr", "", 0);
    model.study("std1").feature("param").setIndex("punit", "m^2", 0);
    model.study("std1").feature("param").setIndex("pname", "Area_beam", 0);
    model.study("std1").feature("param").setIndex("plistarr", "", 0);
    model.study("std1").feature("param").setIndex("punit", "m^2", 0);

//    In the table, enter the following settings:

    model.study("std1").feature("param").setIndex("pname", "P_ave", 0);
    model.study("std1").feature("param").setIndex("plistarr", "1 20 40 60 100 150", 0);

//    A Frequency domain study step is used to obtain initial values for the Electromagnetic Waves physics.
//    In the Study toolbar, click Frequency Domain.

    model.study("std1").create("freq", "Frequency");

//    Drag and drop below Parametric Sweep.

    model.study("std1").feature().move("freq", 1);
    model.study("std1").feature("freq").setSolveFor("/physics/solid", false);

//    In the Settings window for Frequency Domain, locate the Physics and Variables Selection section.

    model.study("std1").feature("freq").setSolveFor("/frame/spatial1", false);

//    In the Solve for column of the table, under Component 1 (comp1), clear the checkboxes for Solid Mechanics (solid), Moving Mesh.
//    Locate the Study Settings section.
//    In the Frequencies text field, type c_const/lda0.

    model.study("std1").feature("freq").set("plist", "c_const/lda0");

//    The nonlinear nature of this model requires some adjustments to the default solver settings. Namely, using a segregated solver to alternately solve for the electromagnetic problem in one step and then the structural and thermal problems in the second step.
//    In the Study toolbar, click Show Default Solver.

    model.study("std1").showAutoSequences("all");

//    In the Model Builder window, expand the Solution 1 (sol1) node.
//    In the Model Builder window, expand the Study 1 > Solver Configurations > Solution 1 (sol1) > Stationary Solver 2 node.
//    Right-click Study 1 > Solver Configurations > Solution 1 (sol1) > Stationary Solver 2 and choose Segregated.

    model.sol("sol1").feature("s2").create("se1", "Segregated");

//    In the Model Builder window, expand the Study 1 > Solver Configurations > Solution 1 (sol1) > Stationary Solver 2 > Segregated 1 node, then click Segregated Step.
//    In the Settings window for Segregated Step, locate the General section.
//    In the Variables list, select Spatial Mesh Displacement (comp1.spatial.disp), Temperature (comp1.T), Displacement Field (comp1.u).
//    Under Variables, click Delete.

    model.sol("sol1").feature("s2").feature("se1").feature("ssDef")
         .set("segvar", new String[]{"comp1_E1", "comp1_E2"});

//    In the Model Builder window, right-click Study 1 > Solver Configurations > Solution 1 (sol1) > Stationary Solver 2 > Segregated 1 and choose Segregated Step.

    model.sol("sol1").feature("s2").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 Spatial Mesh Displacement (comp1.spatial.disp), Temperature (comp1.T), Displacement Field (comp1.u) in the Variables list.
//    Click OK.

    model.sol("sol1").feature("s2").feature("se1").feature("ss1")
         .set("segvar", new String[]{"comp1_spatial_disp", "comp1_T", "comp1_u"});

//    In the Study toolbar, click Compute.

    model.study("std1").createAutoSequences("all");

    model.sol().create("sol3");
    model.sol("sol3").study("std1");
    model.sol("sol3").label("Parametric Solutions 1");

    model.batch("p1").feature("so1").set("psol", "sol3");
    model.batch("p1").run("compute");

    model.result().create("pg1", "PlotGroup2D");
    model.result("pg1").set("data", "dset3");
    model.result("pg1").setIndex("looplevel", 6, 0);
    model.result("pg1").create("surf1", "Surface");
    model.result("pg1").feature("surf1").set("expr", new String[]{"ewbe.normE1"});
    model.result("pg1").feature("surf1").label("Electric Field");
    model.result("pg1").feature("surf1").set("colortable", "RainbowLight");
    model.result("pg1").label("Electric Field, First Wave (ewbe)");
    model.result().create("pg2", "PlotGroup2D");
    model.result("pg2").set("data", "dset3");
    model.result("pg2").setIndex("looplevel", 6, 0);
    model.result("pg2").create("surf1", "Surface");
    model.result("pg2").feature("surf1").set("expr", new String[]{"ewbe.normE2"});
    model.result("pg2").feature("surf1").label("Electric Field");
    model.result("pg2").feature("surf1").set("colortable", "RainbowLight");
    model.result("pg2").label("Electric Field, Second Wave (ewbe)");
    model.result().create("pg3", "PlotGroup2D");
    model.result("pg3").label("Temperature (ht)");
    model.result("pg3").set("data", "dset3");
    model.result("pg3").setIndex("looplevel", 6, 0);
    model.result("pg3").set("smooth", "internal");
    model.result("pg3").feature().create("surf1", "Surface");
    model.result("pg3").feature("surf1").set("solutionparams", "parent");
    model.result("pg3").feature("surf1").set("expr", "T");
    model.result("pg3").feature("surf1").set("colortable", "HeatCameraLight");
    model.result("pg3").feature("surf1").set("data", "parent");
    model.result().create("pg4", "PlotGroup2D");
    model.result("pg4").set("data", "dset3");
    model.result("pg4").setIndex("looplevel", 6, 0);
    model.result("pg4").label("Stress (solid)");
    model.result("pg4").set("frametype", "spatial");
    model.result("pg4").create("surf1", "Surface");
    model.result("pg4").feature("surf1").set("expr", new String[]{"solid.misesGp"});
    model.result("pg4").feature("surf1").set("threshold", "manual");
    model.result("pg4").feature("surf1").set("thresholdvalue", 0.2);
    model.result("pg4").feature("surf1").set("colortable", "Rainbow");
    model.result("pg4").feature("surf1").set("colortabletrans", "none");
    model.result("pg4").feature("surf1").set("colorscalemode", "linear");
    model.result("pg4").feature("surf1").set("resolution", "normal");
    model.result("pg4").feature("surf1").set("refine", 2);
    model.result("pg4").feature("surf1").set("colortable", "Prism");
    model.result("pg4").feature("surf1").create("def", "Deform");
    model.result("pg4").feature("surf1").feature("def").set("expr", new String[]{"u", "v"});
    model.result("pg4").feature("surf1").feature("def").set("descr", "Displacement field");
    model.result().create("pg5", "PlotGroup2D");
    model.result("pg5").set("data", "dset3");
    model.result("pg5").setIndex("looplevel", 6, 0);
    model.result("pg5").label("Moving Mesh");
    model.result("pg5").create("mesh1", "Mesh");
    model.result("pg5").feature("mesh1").set("meshdomain", "surface");
    model.result("pg5").feature("mesh1").set("colortable", "TrafficFlow");
    model.result("pg5").feature("mesh1").set("colortabletrans", "nonlinear");
    model.result("pg5").feature("mesh1").set("nonlinearcolortablerev", true);
    model.result("pg5").feature("mesh1").create("sel1", "MeshSelection");
    model.result("pg5").feature("mesh1").feature("sel1").selection()
         .set(1, 2, 3, 4, 5, 6, 7, 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);
    model.result("pg5").feature("mesh1").set("qualmeasure", "custom");
    model.result("pg5").feature("mesh1").set("qualexpr", "comp1.spatial.relVol");
    model.result("pg5").feature("mesh1").set("colorrangeunitinterval", false);
    model.result("pg1").run();

//    Add two cut lines for evaluating behavior at different points in the model.
//    In the Model Builder window, expand the Results > Datasets node.
//    Right-click Results > Datasets and choose Cut Line 2D.

    model.result().dataset().create("cln1", "CutLine2D");

//    In the Settings window for Cut Line 2D, locate the Data section.
//    From the Dataset list, select Study 1/Parametric Solutions 1 (sol3).

    model.result().dataset("cln1").set("data", "dset3");

//    Locate the Line Data section.
//    In row Point 2, set x to thickness.

    model.result().dataset("cln1").setIndex("genpoints", "thickness", 1, 0);

//    Click Plot.
//    In the Model Builder window, right-click Results > Datasets > Study 1/Parametric Solutions 1 (sol3) and choose Duplicate.

    model.result().dataset().duplicate("dset4", "dset3");

//    In the Settings window for Solution, locate the Solution section.
//    From the Frame list, select Material (X, Y, Z).

    model.result().dataset("dset4").set("frametype", "material");

//    In the Results toolbar, click Cut Line 2D.

    model.result().dataset().create("cln2", "CutLine2D");

//    In the Settings window for Cut Line 2D, locate the Data section.
//    From the Dataset list, select Study 1/Parametric Solutions 1 (4) (sol3).

    model.result().dataset("cln2").set("data", "dset4");

//    Locate the Line Data section.
//    In row Point 1, set X to thickness_GaAs-thickness_QW/2.

    model.result().dataset("cln2").setIndex("genpoints", "thickness_GaAs-thickness_QW/2", 0, 0);

//    In row Point 1, set Y to -height/2.

    model.result().dataset("cln2").setIndex("genpoints", "-height/2", 0, 1);

//    In row Point 2, set Y to height/2.

    model.result().dataset("cln2").setIndex("genpoints", "height/2", 1, 1);

//    In row Point 2, set X to thickness_GaAs-thickness_QW/2.

    model.result().dataset("cln2").setIndex("genpoints", "thickness_GaAs-thickness_QW/2", 1, 0);

//    Click Plot.
//    The reflectivity can be evaluated by using the outcoupling efficiency on the Scattering Boundary Condition with the input wave.
//    In the Results toolbar, click Global Evaluation.

    model.result().numerical().create("gev1", "EvalGlobal");

//    In the Settings window for Global Evaluation, locate the Data section.
//    From the Dataset list, select Study 1/Parametric Solutions 1 (3) (sol3).

    model.result().numerical("gev1").set("data", "dset3");

//    Locate the Expressions section.
//    In the table, enter the following settings:

    model.result().numerical("gev1").setIndex("expr", "ewbe.sctr1.etaOut", 0);

//    Click Evaluate.

    model.result().table().create("tbl1", "Table");
    model.result().table("tbl1").comments("Global Evaluation 1");
    model.result().numerical("gev1").set("table", "tbl1");
    model.result().numerical("gev1").setResult();
    model.result("pg1").run();

//    In the Model Builder window, under Results, click Electric Field, First Wave (ewbe).
//    The electric field is evaluated only in the air and SESAM domains.

    model.result("pg3").run();

//    In the Model Builder window, click Temperature (ht).
//    The temperature increase is centered at the overlap between the laser beam and the SESAM, and extends into both the substrate and surrounding air.
//    In the Results toolbar, click 2D Plot Group.

    model.result().create("pg6", "PlotGroup2D");
    model.result("pg6").run();

//    In the Settings window for 2D Plot Group, type Displacement in the Label text field.

    model.result("pg6").label("Displacement");

//    Right-click Displacement and choose Surface.

    model.result("pg6").create("surf1", "Surface");
    model.result("pg6").feature("surf1").set("evaluationsettings", "parent");

//    In the Settings window for Surface, locate the Expression section.
//    In the Expression text field, type solid.disp.

    model.result("pg6").feature("surf1").set("expr", "solid.disp");

//    In the Displacement toolbar, click Plot.

    model.result("pg6").run();

//    Right-click Surface 1 and choose Deformation.

    model.result("pg6").feature("surf1").create("def1", "Deform");
    model.result("pg6").run();

//    The resulting displacement is maximum at the highest temperature.

    model.result("pg2").run();

//    In the Model Builder window, expand the Results > Electric Field, Second Wave (ewbe) node, then click Electric Field.
//    In the Settings window for Surface, locate the Expression section.
//    In the Expression text field, type ewbe.E2z.

    model.result("pg2").feature("surf1").set("expr", "ewbe.E2z");

//    In the Electric Field, Second Wave (ewbe) toolbar, click Plot.

    model.result("pg2").run();

//    The E2z component shows the change in wavefront curvature of the reflected beam.
//    Next, the Cut Line data sets can be used to see more detailed behavior of the E-field within the SESAM.
//    In the Results toolbar, click 1D Plot Group.

    model.result().create("pg7", "PlotGroup1D");
    model.result("pg7").run();

//    In the Settings window for 1D Plot Group, type E-Field in SESAM in the Label text field.

    model.result("pg7").label("E-Field in SESAM");

//    Locate the Data section.
//    From the Dataset list, select Cut Line 2D 1.

    model.result("pg7").set("data", "cln1");

//    Locate the Plot Settings section.
//    Select the Two y-axes checkbox.

    model.result("pg7").set("twoyaxes", true);

//    In the E-Field in SESAM toolbar, click Line Graph.

    model.result("pg7").create("lngr1", "LineGraph");
    model.result("pg7").feature("lngr1").set("markerpos", "datapoints");
    model.result("pg7").feature("lngr1").set("linewidth", "preference");
    model.result("pg7").feature("lngr1").set("evaluationsettings", "parent");

//    In the Settings window for Line Graph, click to expand the Legends section.
//    Select the Show legends checkbox.

    model.result("pg7").feature("lngr1").set("legend", true);

//    Locate the x-Axis Data section.
//    From the Parameter list, select Expression.

    model.result("pg7").feature("lngr1").set("xdata", "expr");

//    In the Expression text field, type x.

    model.result("pg7").feature("lngr1").set("xdataexpr", "x");

//    In the E-Field in SESAM toolbar, click Line Graph.

    model.result("pg7").create("lngr2", "LineGraph");
    model.result("pg7").feature("lngr2").set("markerpos", "datapoints");
    model.result("pg7").feature("lngr2").set("linewidth", "preference");
    model.result("pg7").feature("lngr2").set("evaluationsettings", "parent");

//    In the Settings window for Line Graph, locate the Data section.
//    From the Dataset list, select Cut Line 2D 1.

    model.result("pg7").feature("lngr2").set("data", "cln1");

//    From the Parameter selection (P_ave) list, select First.

    model.result("pg7").feature("lngr2").setIndex("looplevelinput", "first", 0);

//    Locate the y-Axis Data section.
//    In the Expression text field, type ewbe.n_iso.

    model.result("pg7").feature("lngr2").set("expr", "ewbe.n_iso");

//    Locate the Legends section.
//    Select the Show legends checkbox.

    model.result("pg7").feature("lngr2").set("legend", true);

//    Locate the x-Axis Data section.
//    From the Parameter list, select Expression.

    model.result("pg7").feature("lngr2").set("xdata", "expr");

//    In the Expression text field, type x.

    model.result("pg7").feature("lngr2").set("xdataexpr", "x");
    model.result("pg7").run();

//    In the Model Builder window, click E-Field in SESAM.
//    In the Settings window for 1D Plot Group, locate the Plot Settings section.
//    In the table, enter the following settings:

    model.result("pg7").setIndex("plotonsecyaxis", true, 1, 1);

//    In the E-Field in SESAM toolbar, click Plot.

    model.result("pg7").run();

//    The E-field of the antiresonant SESAM showing negligible amplitude at the surface but peak amplitude in the quantum wells. The refractive index plot highlights the layers of the quantum wells and the layers of the Bragg reflector. The field clearly shows a reduction in amplitude with each layer until it is minimal. You can experiment with different numbers of layers to achieve different reflectivities.
//    In the Home toolbar, click Add Plot Group and choose 1D Plot Group.

    model.result().create("pg8", "PlotGroup1D");
    model.result("pg8").run();

//    In the Settings window for 1D Plot Group, type Absorption in QW, y Direction in the Label text field.

    model.result("pg8").label("Absorption in QW, y Direction");

//    Locate the Data section.
//    From the Dataset list, select Cut Line 2D 2.

    model.result("pg8").set("data", "cln2");

//    In the Absorption in QW, y Direction toolbar, click Line Graph.

    model.result("pg8").create("lngr1", "LineGraph");
    model.result("pg8").feature("lngr1").set("markerpos", "datapoints");
    model.result("pg8").feature("lngr1").set("linewidth", "preference");
    model.result("pg8").feature("lngr1").set("evaluationsettings", "parent");

//    In the Settings window for Line Graph, locate the y-Axis Data section.
//    In the Expression text field, type ewbe.ki_iso.

    model.result("pg8").feature("lngr1").set("expr", "ewbe.ki_iso");

//    Locate the Legends section.
//    Select the Show legends checkbox.

    model.result("pg8").feature("lngr1").set("legend", true);

//    Locate the x-Axis Data section.
//    From the Parameter list, select Expression.

    model.result("pg8").feature("lngr1").set("xdata", "expr");

//    In the Expression text field, type y.

    model.result("pg8").feature("lngr1").set("xdataexpr", "y");

//    In the Absorption in QW, y Direction toolbar, click Plot.

    model.result("pg8").run();

//    The absorption in the quantum well is saturated at the point of highest intensity on the incident laser beam.
//    In the Results toolbar, click 1D Plot Group.

    model.result().create("pg9", "PlotGroup1D");
    model.result("pg9").run();

//    In the Settings window for 1D Plot Group, type Temperature with Laser Power in the Label text field.

    model.result("pg9").label("Temperature with Laser Power");

//    Locate the Data section.
//    From the Dataset list, select Study 1/Parametric Solutions 1 (3) (sol3).

    model.result("pg9").set("data", "dset3");

//    In the Temperature with Laser Power toolbar, click Global.

    model.result("pg9").create("glob1", "Global");
    model.result("pg9").feature("glob1").set("markerpos", "datapoints");
    model.result("pg9").feature("glob1").set("linewidth", "preference");

//    In the Settings window for Global, locate the y-Axis Data section.
//    In the table, enter the following settings:

    model.result("pg9").feature("glob1").setIndex("expr", "maxop1(T)-maxop1(ht.Tinit)", 0);
    model.result("pg9").feature("glob1").setIndex("descr", "Temperature change", 0);

//    In the Temperature with Laser Power toolbar, click Plot.

    model.result("pg9").run();

//    The peak temperature compared to the ambient initial temperature.
//    In the Home toolbar, click Add Plot Group and choose 1D Plot Group.

    model.result().create("pg10", "PlotGroup1D");
    model.result("pg10").run();

//    In the Settings window for 1D Plot Group, locate the Data section.
//    From the Dataset list, select Study 1/Parametric Solutions 1 (3) (sol3).

    model.result("pg10").set("data", "dset3");

//    In the Label text field, type Reflectivity with Laser Power.

    model.result("pg10").label("Reflectivity with Laser Power");

//    In the Reflectivity with Laser Power toolbar, click Global.

    model.result("pg10").create("glob1", "Global");
    model.result("pg10").feature("glob1").set("markerpos", "datapoints");
    model.result("pg10").feature("glob1").set("linewidth", "preference");

//    In the Settings window for Global, locate the y-Axis Data section.
//    In the table, enter the following settings:

    model.result("pg10").feature("glob1").setIndex("expr", "intop2(abs(ewbe.nPoav2))/intop2(abs(ewbe.nPoav1))", 0);
    model.result("pg10").feature("glob1").setIndex("unit", "%", 0);
    model.result("pg10").feature("glob1").setIndex("descr", "Reflectivity", 0);

//    In the Reflectivity with Laser Power toolbar, click Plot.

    model.result("pg10").run();

//    The reflectivity increases with incident power.
//    In the Results toolbar, click 1D Plot Group.

    model.result().create("pg11", "PlotGroup1D");
    model.result("pg11").run();

//    In the Settings window for 1D Plot Group, locate the Data section.
//    From the Dataset list, select Study 1/Parametric Solutions 1 (3) (sol3).

    model.result("pg11").set("data", "dset3");

//    In the Label text field, type SESAM Curvature.

    model.result("pg11").label("SESAM Curvature");

//    Locate the Plot Settings section.
//    Select the Two y-axes checkbox.

    model.result("pg11").set("twoyaxes", true);

//    In the SESAM Curvature toolbar, click Line Graph.

    model.result("pg11").create("lngr1", "LineGraph");
    model.result("pg11").feature("lngr1").set("markerpos", "datapoints");

    return model;
  }

  public static Model run5(Model model) {
    model.result("pg11").feature("lngr1").set("linewidth", "preference");
    model.result("pg11").feature("lngr1").set("evaluationsettings", "parent");

//    In the Settings window for Line Graph, type Surface Curvature in the Label text field.

    model.result("pg11").feature("lngr1").label("Surface Curvature");

//    Locate the Selection section.
//    From the Selection list, select SESAM Surface.

    model.result("pg11").feature("lngr1").selection().named("geom1_sel5");

//    Locate the y-Axis Data section.
//    In the Expression text field, type solid.disp.

    model.result("pg11").feature("lngr1").set("expr", "solid.disp");

//    Locate the Legends section.
//    Select the Show legends checkbox.

    model.result("pg11").feature("lngr1").set("legend", true);

//    Locate the x-Axis Data section.
//    From the Parameter list, select Expression.

    model.result("pg11").feature("lngr1").set("xdata", "expr");

//    In the Expression text field, type y.

    model.result("pg11").feature("lngr1").set("xdataexpr", "y");

//    In the SESAM Curvature toolbar, click Line Graph.

    model.result("pg11").create("lngr2", "LineGraph");
    model.result("pg11").feature("lngr2").set("markerpos", "datapoints");
    model.result("pg11").feature("lngr2").set("linewidth", "preference");
    model.result("pg11").feature("lngr2").set("evaluationsettings", "parent");

//    In the Settings window for Line Graph, type E-Field: z-Component in the Label text field.

    model.result("pg11").feature("lngr2").label("E-Field: z-Component");

//    Locate the Selection section.
//    From the Selection list, select SESAM Surface.

    model.result("pg11").feature("lngr2").selection().named("geom1_sel5");

//    Locate the y-Axis section.
//    Select the Plot on secondary y-axis checkbox.

    model.result("pg11").feature("lngr2").set("plotonsecyaxis", true);

//    Locate the y-Axis Data section.
//    In the Expression text field, type abs(E2z).

    model.result("pg11").feature("lngr2").set("expr", "abs(E2z)");

//    Locate the x-Axis Data section.
//    From the Parameter list, select Expression.

    model.result("pg11").feature("lngr2").set("xdata", "expr");

//    In the Expression text field, type y.

    model.result("pg11").feature("lngr2").set("xdataexpr", "y");

//    Click to expand the Coloring and Style section.
//    From the Color list, select Cycle (reset).

    model.result("pg11").feature("lngr2").set("linecolor", "cyclereset");

//    Find the Line style subsection.
//    From the Line list, select Dashed.

    model.result("pg11").feature("lngr2").set("linestyle", "dashed");

//    Locate the Legends section.
//    Select the Show legends checkbox.

    model.result("pg11").feature("lngr2").set("legend", true);

//    In the SESAM Curvature toolbar, click Plot.

    model.result("pg11").run();
    model.result("pg6").run();

//    Next, add a Global ODEs and DAEs interface and a separate stationary study to fit a parabolic curve to the curvature of the SESAM surface.
//    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", "Radius", 0, 0);
    model.component("comp1").physics("ge").feature("ge1").setIndex("equation", "d(Para_fit, Radius)", 0, 0);
    model.component("comp1").physics("ge").feature("ge1").setIndex("initialValueU", "1 [m]", 0, 0);
    model.component("comp1").physics("ge").feature("ge1").setIndex("name", "Peak", 1, 0);
    model.component("comp1").physics("ge").feature("ge1").setIndex("equation", "", 1, 0);
    model.component("comp1").physics("ge").feature("ge1").setIndex("initialValueU", 0, 1, 0);
    model.component("comp1").physics("ge").feature("ge1").setIndex("initialValueUt", 0, 1, 0);
    model.component("comp1").physics("ge").feature("ge1").setIndex("description", "", 1, 0);
    model.component("comp1").physics("ge").feature("ge1").setIndex("equation", "d(Para_fit, Peak)", 1, 0);
    model.component("comp1").physics("ge").feature("ge1").setIndex("initialValueU", "1 [um]", 1, 0);

//    Locate the Units section.
//    Click Select Dependent Variable Quantity.
//    In the Physical Quantity dialog, type leng in the text field.
//    In the tree, select General > Length (m).
//    Click OK.

    model.component("comp1").physics("ge").feature("ge1").set("DependentVariableQuantity", "length");

//    In the Settings window for Global Equations, locate the Units section.
//    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", "m^2", 0, 0);

//    Disable the ODE interface in the first study so it does not affect future runs of this study.

    model.study("std1").feature("freq").setSolveFor("/physics/ge", false);

//    In the Model Builder window, under Study 1, click Step 1: Frequency Domain.
//    In the Settings window for Frequency Domain, locate the Physics and Variables Selection section.
//    In the Solve for column of the table, under Component 1 (comp1), clear the checkbox for Global ODEs and DAEs (ge).

    model.study("std1").feature("fstat").setSolveFor("/physics/ge", false);

//    In the Model Builder window, click Step 2: Frequency–Stationary.
//    In the Settings window for Frequency–Stationary, locate the Physics and Variables Selection section.
//    In the Solve for column of the table, under Component 1 (comp1), clear the checkbox for Global ODEs and DAEs (ge).
//    In the Study toolbar, click Add Study to open the Add Study window.
//    Find the Studies subsection.
//    In the Select Study tree, select Preset Studies for Some Physics Interfaces > Stationary.
//    Click Add Study in the window toolbar.

    model.study().create("std2");
    model.study("std2").create("stat", "Stationary");

//    In the Study toolbar, click Add Study to close the Add Study window.
//    In the Settings window for Study, locate the Study Settings section.
//    Clear the Generate default plots checkbox.

    model.study("std2").setGenPlots(false);

//    In the Study toolbar, click Parametric Sweep.

    model.study("std2").create("param", "Parametric");

//    In the Settings window for Parametric Sweep, locate the Study Settings section.
//    Click Add.

    model.study("std2").feature("param").setIndex("pname", "Area_beam", 0);
    model.study("std2").feature("param").setIndex("plistarr", "", 0);
    model.study("std2").feature("param").setIndex("punit", "m^2", 0);
    model.study("std2").feature("param").setIndex("pname", "Area_beam", 0);
    model.study("std2").feature("param").setIndex("plistarr", "", 0);
    model.study("std2").feature("param").setIndex("punit", "m^2", 0);

//    In the table, enter the following settings:

    model.study("std2").feature("param").setIndex("pname", "P_ind", 0);
    model.study("std2").feature("param").setIndex("plistarr", "1 20 40 60 100 150", 0);
    model.study("std2").feature("stat").setSolveFor("/physics/solid", false);

//    In the Model Builder window, click Step 1: Stationary.
//    In the Settings window for Stationary, locate the Physics and Variables Selection section.

    model.study("std2").feature("stat").setSolveFor("/physics/ht", false);
    model.study("std2").feature("stat").setSolveFor("/multiphysics/emh1", false);
    model.study("std2").feature("stat").setSolveFor("/multiphysics/te1", false);
    model.study("std2").feature("stat").setSolveFor("/frame/spatial1", false);

//    In the Solve for column of the table, under Component 1 (comp1), clear the checkboxes for Solid Mechanics (solid), Heat Transfer in Solids (ht).
//    In the Solve for column of the table, under Component 1 (comp1) > Multiphysics, clear the checkboxes for Electromagnetic Heating 1 (emh1), Thermal Expansion 1 (te1).
//    In the Solve for column of the table, under Component 1 (comp1), clear the checkbox for Moving Mesh.
//    The purpose of this study is only to evaluate the Global ODEs and DAEs interface.
//    In the Study toolbar, click Show Default Solver.

    model.study("std2").showAutoSequences("all");

//    In the Model Builder window, expand the Study 2 > Solver Configurations > Solution 10 (sol10) node.
//    In the Model Builder window, expand the Study 2 > Solver Configurations > Solution 10 (sol10) > Stationary Solver 1 node, then click Fully Coupled 1.
//    In the Settings window for Fully Coupled, click to expand the Method and Termination section.
//    From the Nonlinear method list, select Constant (Newton).

    model.sol("sol10").feature("s1").feature("fc1").set("dtech", "const");

//    The Constant (Newton) method is more suited to this study.
//    In the Study toolbar, click Compute.

    model.study("std2").createAutoSequences("all");

    model.sol("sol10").runAll();

    model.result("pg11").run();

//    The fitted curve can be added to the previous plot for comparison.
//    In the Model Builder window, under Results, click SESAM Curvature.
//    In the SESAM Curvature toolbar, click Line Graph.

    model.result("pg11").create("lngr3", "LineGraph");
    model.result("pg11").feature("lngr3").set("markerpos", "datapoints");
    model.result("pg11").feature("lngr3").set("linewidth", "preference");
    model.result("pg11").feature("lngr3").set("evaluationsettings", "parent");

//    In the Settings window for Line Graph, type Fitted curve: z-Component in the Label text field.

    model.result("pg11").feature("lngr3").label("Fitted curve: z-Component");

//    Locate the Data section.
//    From the Dataset list, select Study 2/Solution 10 (sol10).

    model.result("pg11").feature("lngr3").set("data", "dset5");

//    Locate the Selection section.
//    From the Selection list, select SESAM Surface.

    model.result("pg11").feature("lngr3").selection().named("geom1_sel5");

//    Locate the y-Axis Data section.
//    In the Expression text field, type delx_para.

    model.result("pg11").feature("lngr3").set("expr", "delx_para");

//    Locate the x-Axis Data section.
//    From the Parameter list, select Expression.

    model.result("pg11").feature("lngr3").set("xdata", "expr");

//    In the Expression text field, type y.

    model.result("pg11").feature("lngr3").set("xdataexpr", "y");

//    Locate the Coloring and Style section.
//    From the Color list, select Cycle (reset).

    model.result("pg11").feature("lngr3").set("linecolor", "cyclereset");

//    Find the Line style subsection.
//    From the Line list, select Dotted.

    model.result("pg11").feature("lngr3").set("linestyle", "dotted");

//    Locate the Legends section.
//    Select the Show legends checkbox.

    model.result("pg11").feature("lngr3").set("legend", true);

//    In the SESAM Curvature toolbar, click Plot.

    model.result("pg11").run();

//    The dotted lines show the parabolic approximation of the thermal expansion.
//    In the Results toolbar, click 1D Plot Group.

    model.result().create("pg12", "PlotGroup1D");
    model.result("pg12").run();

//    In the Settings window for 1D Plot Group, type Curvature with Laser Power in the Label text field.

    model.result("pg12").label("Curvature with Laser Power");

//    Locate the Data section.
//    From the Dataset list, select Study 2/Solution 10 (sol10).

    model.result("pg12").set("data", "dset5");

//    In the Curvature with Laser Power toolbar, click Global.

    model.result("pg12").create("glob1", "Global");
    model.result("pg12").feature("glob1").set("markerpos", "datapoints");
    model.result("pg12").feature("glob1").set("linewidth", "preference");

//    In the Settings window for Global, locate the y-Axis Data section.
//    Click Clear Table.

    model.result("pg12").feature("glob1").set("expr", new String[]{});
    model.result("pg12").feature("glob1").set("descr", new String[]{});

//    In the table, enter the following settings:

    model.result("pg12").feature("glob1").setIndex("expr", "Radius", 0);
    model.result("pg12").feature("glob1").setIndex("unit", "km", 0);
    model.result("pg12").feature("glob1").setIndex("descr", "Curvature", 0);

//    In the Curvature with Laser Power toolbar, click Plot.

    model.result("pg12").run();

//    The radius of curvature is seen to decrease with the incident laser power.

    model.result().create("pg13", "PlotGroup2D");
    model.result("pg13").run();
    model.result("pg13").label("Thumbnail");
    model.result("pg13").create("surf1", "Surface");
    model.result("pg13").feature("surf1").set("evaluationsettings", "parent");
    model.result("pg13").feature("surf1").set("expr", "ewbe.normE2^2");
    model.result("pg13").feature("surf1").set("colortable", "Inferno");
    model.result("pg13").run();
    model.result("pg13").create("surf2", "Surface");
    model.result("pg13").feature("surf2").set("evaluationsettings", "parent");
    model.result("pg13").feature("surf2").set("expr", "T");
    model.result("pg13").feature("surf2").create("def1", "Deform");
    model.result("pg13").run();
    model.result("pg13").run();
    model.result("pg13").feature("surf2").set("colortable", "Plasma");
    model.result("pg13").feature("surf2").create("sel1", "Selection");
    model.result("pg13").feature("surf2").feature("sel1").selection().set(63);
    model.result("pg13").run();
    model.result("pg13").set("edges", false);
    model.result("pg13").set("titletype", "none");

    model.component("comp1").view("view1").set("showgrid", false);

    model.result("pg13").set("showlegends", false);
    model.result("pg13").create("line1", "Line");
    model.result("pg13").feature("line1").set("evaluationsettings", "parent");
    model.result("pg13").feature("line1").set("expr", "solid.disp");
    model.result("pg13").feature("line1").create("def1", "Deform");
    model.result("pg13").run();
    model.result("pg13").run();

    model.title("Thermal Heating of a Semiconductor Saturable Absorber Mirror (SESAM)");

    model
         .description("The thermal effects of a laser beam incident on a Semiconductor Saturable Absorber Mirror (SESAM) are simulated under a range of incident beam powers. \n\nThis is done in two steps. The first study simulates the multiphysics combination of the saturated absorption of the beam on a SESAM, the resultant thermal heating, the structural deformation of the SESAM surface, and the effect this has on the reflected beam. \n\nThe second study applies curve fitting to the results from the first study to determine the change in curvature as a function of incident power.");

    return model;
  }

  public static void main(String[] args) {
    Model model = run();
    model = run2(model);
    model = run3(model);
    model = run4(model);
    run5(model);
  }

}
