/*
 * bracket_general_periodic.java
 */

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

/** Model exported on May 13 2026, 10:00 by COMSOL 6.4.0.419. */
public class bracket_general_periodic {

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

//    From the File menu, choose Application Libraries.
//    In the Application Libraries window, select Structural Mechanics Module > Tutorials > bracket_basic in the tree.
//    Click Open.

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

    model.component("comp1").geom().create("geom1", 3);
    model.component("comp1").geom("geom1").geomRep("comsol");

    model.component("comp1").mesh().create("mesh1");
    model.component("comp1").mesh("mesh1").contribute("geom/detail", true);

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

    model.component("comp1").geom("geom1").create("imp1", "Import");
    model.component("comp1").geom("geom1").feature("imp1").set("type", "native");
    model.component("comp1").geom("geom1").feature("imp1").set("filename", "bracket.mphbin");
    model.component("comp1").geom("geom1").feature("imp1").importData();

    model.param().set("Fh", "800[N]");
    model.param().descr("Fh", "Force per hole");
    model.param().set("dHole", "50[mm]");
    model.param().descr("dHole", "Hole diameter");
    model.param().set("tArm", "8[mm]");
    model.param().descr("tArm", "Thickness of arm");
    model.param().set("p0", "Fh/(dHole*tArm*pi/4)");
    model.param().descr("p0", "Peak load intensity");
    model.param().set("elSize", "6[mm]");
    model.param().descr("elSize", "Element size");
    model.param()
         .comments("The expression for the peak load intensity is obtained by integrating the projection of the pressure distribution in the hole into a total force.\n\n<eqv>F</eqv><sub>h</sub> = <symbol>\u00f2</symbol><eqv>t</eqv> <eqv>p</eqv><sub>0</sub> cos<sup>2</sup> \\philetter <eqv>R</eqv> d\\philetter = \\pi /2 <eqv>p</eqv><sub>0</sub> <eqv>t R </eqv>\n\nHere, <eqv>R</eqv> is the hole radius, and <eqv>t</eqv> is the thickness of the arm. The integral is taken from -\\pi /2 to \\pi /2.");

    model.component("comp1").geom("geom1").create("blk1", "Block");
    model.component("comp1").geom("geom1").selection().create("csel1", "CumulativeSelection");
    model.component("comp1").geom("geom1").selection("csel1").label("Partition block");
    model.component("comp1").geom("geom1").feature("blk1").set("contributeto", "csel1");
    model.component("comp1").geom("geom1").feature("blk1").set("size", new double[]{0.025, 0.13, 0.04});
    model.component("comp1").geom("geom1").feature("blk1").set("pos", new double[]{-0.11, -0.12, 0.025});
    model.component("comp1").geom("geom1").run("blk1");
    model.component("comp1").geom("geom1").create("mir1", "Mirror");
    model.component("comp1").geom("geom1").feature("mir1").selection("input").named("csel1");
    model.component("comp1").geom("geom1").feature("mir1").set("keep", true);
    model.component("comp1").geom("geom1").feature("mir1").set("contributeto", "csel1");
    model.component("comp1").geom("geom1").run("mir1");
    model.component("comp1").geom("geom1").create("mir2", "Mirror");
    model.component("comp1").geom("geom1").feature("mir2").selection("input").named("csel1");
    model.component("comp1").geom("geom1").feature("mir2").set("keep", true);
    model.component("comp1").geom("geom1").feature("mir2").set("axis", new double[]{1, 0, 0});
    model.component("comp1").geom("geom1").feature("mir2").set("contributeto", "csel1");
    model.component("comp1").geom("geom1").run("mir2");
    model.component("comp1").geom("geom1").create("par1", "Partition");
    model.component("comp1").geom("geom1").feature("par1").selection("input").set("imp1");
    model.component("comp1").geom("geom1").feature("par1").selection("tool").named("csel1");
    model.component("comp1").geom("geom1").run("par1");
    model.component("comp1").geom("geom1").run("fin");
    model.component("comp1").geom("geom1").run("par1");
    model.component("comp1").geom("geom1").create("cm1", "CentroidMeasurement");
    model.component("comp1").geom("geom1").feature("cm1").selection("ent").set("par1", 2, 5);
    model.component("comp1").geom("geom1").run("cm1");
    model.component("comp1").geom("geom1").feature("cm1").setIndex("parname", "PinHoleX", 0);
    model.component("comp1").geom("geom1").feature("cm1").setIndex("parname", "PinHoleY", 1);
    model.component("comp1").geom("geom1").feature("cm1").setIndex("parname", "PinHoleZ", 2);

    model.component("comp1").coordSystem().create("sys2", "Cylindrical");

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

    model.component("comp1").coordSystem("sys2").setIndex("origin", "PinHoleY", 1);
    model.component("comp1").coordSystem("sys2").setIndex("origin", "PinHoleZ", 2);
    model.component("comp1").coordSystem("sys2").setIndex("axis", 1, 0);
    model.component("comp1").coordSystem("sys2").setIndex("axis", 0, 2);
    model.component("comp1").coordSystem("sys2").setIndex("radialbasevector", 0, 0);
    model.component("comp1").coordSystem("sys2").setIndex("radialbasevector", "sign(X)", 2);
    model.component("comp1").coordSystem("sys2").set("frametype", "material");
    model.component("comp1").coordSystem("sys1").set("frametype", "material");

    model.component("comp1").selection().create("sel1", "Explicit");
    model.component("comp1").selection("sel1").label("Bolt 1");
    model.component("comp1").selection("sel1").geom(2);
    model.component("comp1").selection("sel1").set(41);
    model.component("comp1").selection("sel1").set("groupcontang", true);
    model.component("comp1").selection().create("sel2", "Explicit");
    model.component("comp1").selection("sel2").label("Bolt 2");
    model.component("comp1").selection("sel2").geom(2);
    model.component("comp1").selection("sel2").set(43);
    model.component("comp1").selection("sel2").set("groupcontang", true);
    model.component("comp1").selection().create("sel3", "Explicit");
    model.component("comp1").selection("sel3").label("Bolt 3");
    model.component("comp1").selection("sel3").geom(2);
    model.component("comp1").selection("sel3").set(55);
    model.component("comp1").selection("sel3").set("groupcontang", true);
    model.component("comp1").selection().create("sel4", "Explicit");
    model.component("comp1").selection("sel4").label("Bolt 4");
    model.component("comp1").selection("sel4").geom(2);
    model.component("comp1").selection("sel4").set(57);
    model.component("comp1").selection("sel4").set("groupcontang", true);
    model.component("comp1").selection().create("uni1", "Union");
    model.component("comp1").selection("uni1").label("Bolt Holes");
    model.component("comp1").selection("uni1").set("entitydim", 2);
    model.component("comp1").selection("uni1").set("input", new String[]{"sel1", "sel2", "sel3", "sel4"});
    model.component("comp1").selection().create("sel5", "Explicit");
    model.component("comp1").selection("sel5").label("Left Pin Hole");
    model.component("comp1").selection("sel5").geom(2);
    model.component("comp1").selection("sel5").set(4);
    model.component("comp1").selection("sel5").set("groupcontang", true);
    model.component("comp1").selection().create("sel6", "Explicit");
    model.component("comp1").selection("sel6").label("Right Pin Hole");
    model.component("comp1").selection("sel6").geom(2);
    model.component("comp1").selection("sel6").set(75);
    model.component("comp1").selection("sel6").set("groupcontang", true);
    model.component("comp1").selection().create("uni2", "Union");
    model.component("comp1").selection("uni2").label("Pin Holes");
    model.component("comp1").selection("uni2").set("entitydim", 2);
    model.component("comp1").selection("uni2").set("input", new String[]{"sel5", "sel6"});
    model.component("comp1").selection().create("adj1", "Adjacent");
    model.component("comp1").selection("adj1").label("Bolt Hole Edges");
    model.component("comp1").selection("adj1").set("entitydim", 2);
    model.component("comp1").selection("adj1").set("outputdim", 1);
    model.component("comp1").selection("adj1").set("input", new String[]{"uni1"});

    model.component("comp1").material().create("mat1", "Common");
    model.component("comp1").material("mat1").propertyGroup()
         .create("Enu", "Enu", "Young's modulus and Poisson's ratio");
    model.component("comp1").material("mat1").propertyGroup("Enu").func().create("int1", "Interpolation");
    model.component("comp1").material("mat1").propertyGroup("Enu").func().create("int2", "Interpolation");
    model.component("comp1").material("mat1").propertyGroup().create("Murnaghan", "Murnaghan", "Murnaghan");
    model.component("comp1").material("mat1").propertyGroup()
         .create("ElastoplasticModel", "ElastoplasticModel", "Elastoplastic material model");
    model.component("comp1").material("mat1").propertyGroup("ElastoplasticModel").func()
         .create("int1", "Interpolation");
    model.component("comp1").material("mat1").propertyGroup().create("Ludwik", "Ludwik", "Ludwik");
    model.component("comp1").material("mat1").propertyGroup("Ludwik").func().create("int1", "Interpolation");
    model.component("comp1").material("mat1").propertyGroup().create("JohnsonCook", "JohnsonCook", "Johnson-Cook");
    model.component("comp1").material("mat1").propertyGroup().create("Swift", "Swift", "Swift");
    model.component("comp1").material("mat1").propertyGroup().create("Voce", "Voce", "Voce");
    model.component("comp1").material("mat1").propertyGroup("Voce").func().create("int1", "Interpolation");
    model.component("comp1").material("mat1").propertyGroup()
         .create("HockettSherby", "HockettSherby", "Hockett-Sherby");
    model.component("comp1").material("mat1").propertyGroup("HockettSherby").func().create("int1", "Interpolation");
    model.component("comp1").material("mat1").propertyGroup()
         .create("ArmstrongFrederick", "ArmstrongFrederick", "Armstrong-Frederick");
    model.component("comp1").material("mat1").propertyGroup("ArmstrongFrederick").func()
         .create("int1", "Interpolation");
    model.component("comp1").material("mat1").propertyGroup().create("Norton", "Norton", "Norton");
    model.component("comp1").material("mat1").propertyGroup()
         .create("Garofalo", "Garofalo", "Garofalo (hyperbolic sine)");
    model.component("comp1").material("mat1").propertyGroup()
         .create("ChabocheViscoplasticity", "ChabocheViscoplasticity", "Chaboche viscoplasticity");
    model.component("comp1").material("mat1").label("Structural steel");
    model.component("comp1").material("mat1").set("family", "custom");
    model.component("comp1").material("mat1")
         .set("customspecular", new double[]{0.7843137254901961, 0.7843137254901961, 0.7843137254901961});
    model.component("comp1").material("mat1").set("diffuse", "custom");
    model.component("comp1").material("mat1")
         .set("customdiffuse", new double[]{0.6666666666666666, 0.6666666666666666, 0.6666666666666666});
    model.component("comp1").material("mat1").set("ambient", "custom");
    model.component("comp1").material("mat1")
         .set("customambient", new double[]{0.6666666666666666, 0.6666666666666666, 0.6666666666666666});
    model.component("comp1").material("mat1").set("noise", true);
    model.component("comp1").material("mat1").set("fresnel", 0.9);
    model.component("comp1").material("mat1").set("roughness", 0.3);
    model.component("comp1").material("mat1").set("diffusewrap", 0);
    model.component("comp1").material("mat1").set("reflectance", 0);
    model.component("comp1").material("mat1").propertyGroup("def").set("lossfactor", "0.02");
    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("heatcapacity", "475[J/(kg*K)]");
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("thermalconductivity", new String[]{"44.5[W/(m*K)]", "0", "0", "0", "44.5[W/(m*K)]", "0", "0", "0", "44.5[W/(m*K)]"});
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("electricconductivity", new String[]{"4.032e6[S/m]", "0", "0", "0", "4.032e6[S/m]", "0", "0", "0", "4.032e6[S/m]"});
    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("thermalexpansioncoefficient", new String[]{"12.3e-6[1/K]", "0", "0", "0", "12.3e-6[1/K]", "0", "0", "0", "12.3e-6[1/K]"});
    model.component("comp1").material("mat1").propertyGroup("def").set("density", "7850[kg/m^3]");
    model.component("comp1").material("mat1").propertyGroup("Enu").func("int1").set("funcname", "E");
    model.component("comp1").material("mat1").propertyGroup("Enu").func("int1")
         .set("table", new String[][]{{"293.15", "200e9"}, {"793.15", "166.6e9"}});
    model.component("comp1").material("mat1").propertyGroup("Enu").func("int1").set("extrap", "linear");
    model.component("comp1").material("mat1").propertyGroup("Enu").func("int1").set("fununit", new String[]{"Pa"});
    model.component("comp1").material("mat1").propertyGroup("Enu").func("int1").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("Enu").func("int2").set("funcname", "nu");
    model.component("comp1").material("mat1").propertyGroup("Enu").func("int2")
         .set("table", new String[][]{{"293.15", "0.30"}, {"793.15", "0.315"}});
    model.component("comp1").material("mat1").propertyGroup("Enu").func("int2").set("extrap", "linear");
    model.component("comp1").material("mat1").propertyGroup("Enu").func("int2").set("fununit", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("Enu").func("int2").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("Enu").set("E", "E(T)");
    model.component("comp1").material("mat1").propertyGroup("Enu").set("nu", "nu(T)");
    model.component("comp1").material("mat1").propertyGroup("Enu").addInput("temperature");
    model.component("comp1").material("mat1").propertyGroup("Murnaghan").set("l", "-3.0e11[Pa]");
    model.component("comp1").material("mat1").propertyGroup("Murnaghan").set("m", "-6.2e11[Pa]");
    model.component("comp1").material("mat1").propertyGroup("Murnaghan").set("n", "-7.2e11[Pa]");
    model.component("comp1").material("mat1").propertyGroup("ElastoplasticModel").func("int1").set("funcname", "a");
    model.component("comp1").material("mat1").propertyGroup("ElastoplasticModel").func("int1")
         .set("table", new String[][]{{"600", "1"}, {"1100", "0.1"}, {"1643", "0"}});
    model.component("comp1").material("mat1").propertyGroup("ElastoplasticModel").func("int1")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("ElastoplasticModel").func("int1")
         .set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("ElastoplasticModel").set("sigmags", "350[MPa]*a(T)");
    model.component("comp1").material("mat1").propertyGroup("ElastoplasticModel").set("Et", "1.045[GPa]*a(T)");
    model.component("comp1").material("mat1").propertyGroup("ElastoplasticModel").set("Ek", "1.045[GPa]*a(T)");
    model.component("comp1").material("mat1").propertyGroup("ElastoplasticModel")
         .set("sigmagh", "1.050[GPa]*epe*a(T)");
    model.component("comp1").material("mat1").propertyGroup("ElastoplasticModel")
         .set("Hillcoefficients", new String[]{"0[m^2*s^4/kg^2]", "0[m^2*s^4/kg^2]", "0[m^2*s^4/kg^2]", "0[m^2*s^4/kg^2]", "0[m^2*s^4/kg^2]", "0[m^2*s^4/kg^2]"});
    model.component("comp1").material("mat1").propertyGroup("ElastoplasticModel")
         .set("ys", new String[]{"0[N/m^2]", "0[N/m^2]", "0[N/m^2]", "0[N/m^2]", "0[N/m^2]", "0[N/m^2]"});
    model.component("comp1").material("mat1").propertyGroup("ElastoplasticModel").addInput("temperature");
    model.component("comp1").material("mat1").propertyGroup("ElastoplasticModel").addInput("effectiveplasticstrain");
    model.component("comp1").material("mat1").propertyGroup("Ludwik").func("int1").set("funcname", "a");
    model.component("comp1").material("mat1").propertyGroup("Ludwik").func("int1")
         .set("table", new String[][]{{"600", "1"}, {"1100", "0.1"}, {"1643", "0"}});
    model.component("comp1").material("mat1").propertyGroup("Ludwik").func("int1").set("fununit", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("Ludwik").func("int1").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("Ludwik").set("k_lud", "560[MPa]*a(T)");
    model.component("comp1").material("mat1").propertyGroup("Ludwik").set("n_lud", "0.61");
    model.component("comp1").material("mat1").propertyGroup("Ludwik").addInput("temperature");
    model.component("comp1").material("mat1").propertyGroup("JohnsonCook").label("Johnson-Cook");
    model.component("comp1").material("mat1").propertyGroup("JohnsonCook").set("k_jcook", "560[MPa]");
    model.component("comp1").material("mat1").propertyGroup("JohnsonCook").set("n_jcook", "0.61");
    model.component("comp1").material("mat1").propertyGroup("JohnsonCook").set("C_jcook", "0.12");
    model.component("comp1").material("mat1").propertyGroup("JohnsonCook").set("epet0_jcook", "1[1/s]");
    model.component("comp1").material("mat1").propertyGroup("JohnsonCook").set("m_jcook", "0.6");
    model.component("comp1").material("mat1").propertyGroup("Swift").set("e0_swi", "0.021");
    model.component("comp1").material("mat1").propertyGroup("Swift").set("n_swi", "0.2");
    model.component("comp1").material("mat1").propertyGroup("Voce").func("int1").set("funcname", "a");
    model.component("comp1").material("mat1").propertyGroup("Voce").func("int1")
         .set("table", new String[][]{{"600", "1"}, {"1100", "0.1"}, {"1643", "0"}});
    model.component("comp1").material("mat1").propertyGroup("Voce").func("int1").set("fununit", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("Voce").func("int1").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("Voce").set("sigma_voc", "249[MPa]*a(T)");
    model.component("comp1").material("mat1").propertyGroup("Voce").set("beta_voc", "9.3");
    model.component("comp1").material("mat1").propertyGroup("Voce").addInput("temperature");
    model.component("comp1").material("mat1").propertyGroup("HockettSherby").label("Hockett-Sherby");
    model.component("comp1").material("mat1").propertyGroup("HockettSherby").func("int1").set("funcname", "a");
    model.component("comp1").material("mat1").propertyGroup("HockettSherby").func("int1")
         .set("table", new String[][]{{"600", "1"}, {"1100", "0.1"}, {"1643", "0"}});
    model.component("comp1").material("mat1").propertyGroup("HockettSherby").func("int1")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("HockettSherby").func("int1")
         .set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("HockettSherby").set("sigma_hoc", "684[MPa]*a(T)");
    model.component("comp1").material("mat1").propertyGroup("HockettSherby").set("m_hoc", "3.9");
    model.component("comp1").material("mat1").propertyGroup("HockettSherby").set("n_hoc", "0.85");
    model.component("comp1").material("mat1").propertyGroup("HockettSherby").addInput("temperature");
    model.component("comp1").material("mat1").propertyGroup("ArmstrongFrederick").label("Armstrong-Frederick");
    model.component("comp1").material("mat1").propertyGroup("ArmstrongFrederick").func("int1").set("funcname", "a");
    model.component("comp1").material("mat1").propertyGroup("ArmstrongFrederick").func("int1")
         .set("table", new String[][]{{"600", "1"}, {"1100", "0.1"}, {"1643", "0"}});
    model.component("comp1").material("mat1").propertyGroup("ArmstrongFrederick").func("int1")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("ArmstrongFrederick").func("int1")
         .set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("ArmstrongFrederick").set("Ck", "2.070[GPa]*a(T)");
    model.component("comp1").material("mat1").propertyGroup("ArmstrongFrederick").set("gammak", "8.0");
    model.component("comp1").material("mat1").propertyGroup("ArmstrongFrederick").addInput("temperature");
    model.component("comp1").material("mat1").propertyGroup("Norton").set("A_nor", "1.2e-15[1/s]");
    model.component("comp1").material("mat1").propertyGroup("Norton").set("sigRef_nor", "1[MPa]");
    model.component("comp1").material("mat1").propertyGroup("Norton").set("n_nor", "4.5");
    model.component("comp1").material("mat1").propertyGroup("Garofalo").set("A_gar", "1e-6[1/s]");
    model.component("comp1").material("mat1").propertyGroup("Garofalo").set("sigRef_gar", "100[MPa]");
    model.component("comp1").material("mat1").propertyGroup("Garofalo").set("n_gar", "4.6");
    model.component("comp1").material("mat1").propertyGroup("ChabocheViscoplasticity").set("A_cha", "1[1/s]");
    model.component("comp1").material("mat1").propertyGroup("ChabocheViscoplasticity").set("sigRef_cha", "490[MPa]");
    model.component("comp1").material("mat1").propertyGroup("ChabocheViscoplasticity").set("n_cha", "9");

    model.component("comp1").physics("solid").create("fix1", "Fixed", 2);
    model.component("comp1").physics("solid").feature("fix1").selection().named("uni1");

    model.component("comp1").mesh("mesh1").create("edg1", "Edge");
    model.component("comp1").mesh("mesh1").feature("edg1").selection().named("adj1");
    model.component("comp1").mesh("mesh1").feature("edg1").create("dis1", "Distribution");
    model.component("comp1").mesh("mesh1").feature("edg1").feature("dis1").set("numelem", 8);
    model.component("comp1").mesh("mesh1").create("swe1", "Sweep");
    model.component("comp1").mesh("mesh1").feature("swe1").selection().geom("geom1", 3);
    model.component("comp1").mesh("mesh1").feature("swe1").selection().set(1, 4, 5, 6, 9);
    model.component("comp1").mesh("mesh1").feature("swe1").create("size1", "Size");
    model.component("comp1").mesh("mesh1").feature("swe1").feature("size1").set("custom", true);
    model.component("comp1").mesh("mesh1").feature("swe1").feature("size1").set("hmaxactive", true);
    model.component("comp1").mesh("mesh1").feature("swe1").feature("size1").set("hmax", "elSize");
    model.component("comp1").mesh("mesh1").feature("size").set("hauto", 4);
    model.component("comp1").mesh("mesh1").create("ftet1", "FreeTet");
    model.component("comp1").mesh("mesh1").feature("ftet1").create("size1", "Size");
    model.component("comp1").mesh("mesh1").feature("ftet1").feature("size1").set("custom", true);
    model.component("comp1").mesh("mesh1").feature("ftet1").feature("size1").set("hmaxactive", true);
    model.component("comp1").mesh("mesh1").feature("ftet1").feature("size1").set("hmax", "elSize");
    model.component("comp1").mesh("mesh1").feature("ftet1").create("size2", "Size");
    model.component("comp1").mesh("mesh1").feature("ftet1").feature("size2").selection().geom("geom1", 2);
    model.component("comp1").mesh("mesh1").feature("ftet1").feature("size2").selection().set(24, 28, 63, 70);
    model.component("comp1").mesh("mesh1").feature("ftet1").feature("size2").set("hauto", 1);
    model.component("comp1").mesh("mesh1").feature("ftet1").feature("size2").set("custom", true);
    model.component("comp1").mesh("mesh1").feature("ftet1").feature("size2").set("hminactive", true);
    model.component("comp1").mesh("mesh1").feature("ftet1").feature("size2").set("hcurveactive", true);
    model.component("comp1").mesh("mesh1").run();

    model.result().configuration().create("prfu1", "PreferredUnits");
    model.result().configuration("prfu1")
         .setIndex("quantityunits", new String[]{"displacement", "Displacement", "m", "m"}, 0);
    model.result().configuration("prfu1").setIndex("quantityunits", "mm", 0, 3);
    model.result().configuration("prfu1")
         .setIndex("quantityunits", new String[]{"stress", "Stress tensor", "N/m^2", "N/m^2"}, 1);
    model.result().configuration("prfu1").setIndex("quantityunits", "MPa", 1, 3);
    model.result().configuration("prfu1").apply();

    model.title("Bracket Geometry");

    model.description("This is a base for all bracket tutorials, which contains the bracket geometry.");

    model.label("bracket_basic.mph");

//    Describe the periodic load using interpolation and analytical functions.
//    In the Model Builder window, under Global Definitions, click Parameters 1.
//    In the Settings window for Parameters, locate the Parameters section.
//    In the table, enter the following settings:

    model.param().set("A0", "750[N]");
    model.param().descr("A0", "Peak load intensity");
    model.param().set("M0", "0[N]");
    model.param().descr("M0", "Mean load intensity");
    model.param().set("f0", "40[Hz]");
    model.param().descr("f0", "Fundamental frequency");
    model.param().set("T0", "1/f0");
    model.param().descr("T0", "Base period");

//    In the Home toolbar, click Functions and choose Global > Interpolation.

    model.func().create("int1", "Interpolation");

//    In the Settings window for Interpolation, locate the Definition section.
//    In the table, enter the following settings:

    model.func("int1").setIndex("table", 0, 0, 0);
    model.func("int1").setIndex("table", "M0", 0, 1);
    model.func("int1").setIndex("table", "T0/4", 1, 0);
    model.func("int1").setIndex("table", "M0+A0", 1, 1);
    model.func("int1").setIndex("table", "3/4*T0", 2, 0);
    model.func("int1").setIndex("table", "M0-A0", 2, 1);
    model.func("int1").setIndex("table", "T0", 3, 0);
    model.func("int1").setIndex("table", "M0", 3, 1);
    model.func("int1").setIndex("argunit", "s", 0);

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

    model.func("int1").setIndex("fununit", "N", 0);

//    In the Function table, enter the following settings:
//    In the Home toolbar, click Functions and choose Global > Analytic.

    model.func().create("an1", "Analytic");

//    In the Settings window for Analytic, type loadHistory in the Function name text field.

    model.func("an1").set("funcname", "loadHistory");

//    Locate the Definition section.
//    In the Expression text field, type int1(x).

    model.func("an1").set("expr", "int1(x)");

//    Click to expand the Periodic Extension section.
//    Select the Make periodic checkbox.

    model.func("an1").set("periodic", true);

//    In the Upper limit text field, type T0.

    model.func("an1").set("periodicupper", "T0");

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

    model.func("an1").setIndex("argunit", "s", 0);

//    In the Function text field, type N.

    model.func("an1").set("fununit", "N");

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

    model.func("an1").setIndex("plotargs", "5*T0", 0, 2);

//    Click Plot.
//    Right-click Analytic 1 (loadHistory) and choose Duplicate.

    model.func().duplicate("an2", "an1");

//    In the Settings window for Analytic, type Periodic in the Function name text field.

    model.func("an2").set("funcname", "Periodic");

//    Locate the Definition section.
//    In the Expression text field, type int1(x)/A0.

    model.func("an2").set("expr", "int1(x)/A0");

//    Locate the Units section.
//    In the Function text field, type 1.

    model.func("an2").set("fununit", "1");

//    In order to find the Fourier series coefficients of the periodic function, add a zero-dimensional component with a Global ODEs and DAEs mathematical interface.
//    In the Model Builder window, right-click the root node and choose Add Component > 0D.

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

//    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 2 in the window toolbar.

    model.component("comp2").physics().create("ge", "GlobalEquations");
    model.component("comp2").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("comp2").physics("ge").feature("ge1").setIndex("name", "P", 0, 0);
    model.component("comp2").physics("ge").feature("ge1").setIndex("equation", "P-loadHistory(t)", 0, 0);
    model.component("comp2").physics("ge").feature("ge1").setIndex("initialValueU", "loadHistory(0)", 0, 0);

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

    model.component("comp2").physics("ge").feature("ge1").set("DependentVariableQuantity", "force");

//    In the Settings window for Global Equations, locate the Units section.
//    Click Select Source Term Quantity.
//    In the Physical Quantity dialog, select General > Force (N) in the tree.
//    Click OK.

    model.component("comp2").physics("ge").feature("ge1").set("SourceTermQuantity", "force");

//    Add <l>Time Dependent</l> and <l>Time to Frequency FFT</l> study steps to generate Fourier coefficients.
//    In the Home toolbar, click Add Study to open the Add Study window.
//    Find the Studies subsection.
//    In the Select Study tree, select General Studies > Time Dependent.
//    Right-click and choose Add Study.

    model.study().create("std1");
    model.study("std1").create("time", "Transient");

//    In the Home toolbar, click Add Study to close the Add Study window.
//    In the Settings window for Study, type Study 1: Fourier Coefficient Generation in the Label text field.

    model.study("std1").label("Study 1: Fourier Coefficient Generation");

//    Locate the Study Settings section.
//    Clear the Generate default plots checkbox.

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

//    In the Model Builder window, under Study 1: Fourier Coefficient Generation, click Step 1: Time Dependent.
//    In the Settings window for Time Dependent, locate the Study Settings section.
//    In the Output times text field, type range(0,T0/1000,T0).

    model.study("std1").feature("time").set("tlist", "range(0,T0/1000,T0)");
    model.study("std1").feature("time").setSolveFor("/physics/solid", false);

//    Locate the Physics and Variables Selection section.
//    In the Solve for column of the table, under Component 1 (comp1), clear the checkbox for Solid Mechanics (solid).
//    In the Study toolbar, click More Study Steps and choose Frequency Domain > Time to Frequency FFT.

    model.study("std1").create("tffft", "TimeToFreqFFT");

//    In the Settings window for Time to Frequency FFT, locate the Study Settings section.
//    In the End time text field, type T0.

    model.study("std1").feature("tffft").set("fftendtime", "T0");

//    By setting a high upper frequency, the accuracy of the Fourier coefficients for the lower frequencies will be improved.
//    In the Maximum output frequency text field, type 10000.

    model.study("std1").feature("tffft").set("fftmaxfreq", 10000);
    model.study("std1").feature("tffft").setSolveFor("/physics/solid", false);

//    Locate the Physics and Variables Selection section.
//    In the Solve for column of the table, under Component 1 (comp1), clear the checkbox for Solid Mechanics (solid).
//    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, under Study 1: Fourier Coefficient Generation > Solver Configurations > Solution 1 (sol1), click Time-Dependent Solver 1.
//    In the Settings window for Time-Dependent Solver, click to expand the Time Stepping section.
//    From the Steps taken by solver list, select Strict.

    return model;
  }

  public static Model run2(Model model) {

    model.sol("sol1").feature("t1").set("tstepsbdf", "strict");

//    Find the Algebraic variable settings subsection.
//    From the Consistent initialization list, select Off.

    model.sol("sol1").feature("t1").set("consistent", false);

//    In the Study toolbar, click Compute.

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

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

//    In the Results toolbar, click 1D Plot Group.

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

//    In the Settings window for 1D Plot Group, type Fourier Coefficients, Computed vs. Analytical in the Label text field.

    model.result("pg1").label("Fourier Coefficients, Computed vs. Analytical");

//    Locate the Data section.
//    From the Parameter selection (freq) list, select Manual.

    model.result("pg1").setIndex("looplevelinput", "manualindices", 0);

//    In the Parameter indices (1-251) text field, type range(1,1,100).

    model.result("pg1").setIndex("looplevelindices", "range(1,1,100)", 0);

//    Click to expand the Title section.
//    From the Title type list, select Label.

    model.result("pg1").set("titletype", "label");

//    Locate the Plot Settings section.
//    Select the x-axis label checkbox.

    model.result("pg1").set("xlabelactive", true);

//    In the associated text field, type freq (Hz).

    model.result("pg1").set("xlabel", "freq (Hz)");

//    Select the y-axis label checkbox.

    model.result("pg1").set("ylabelactive", true);

//    In the associated text field, type Fourier Coefficients (N).

    model.result("pg1").set("ylabel", "Fourier Coefficients (N)");

//    Locate the Axis section.
//    Select the y-axis log scale checkbox.

    model.result("pg1").set("ylog", true);

//    Right-click Fourier Coefficients, Computed vs. Analytical and choose Global.

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

//    In the Settings window for Global, type Global: Computed in the Label text field.

    model.result("pg1").feature("glob1").label("Global: Computed");

//    Locate the y-Axis Data section.
//    In the table, enter the following settings:

    model.result("pg1").feature("glob1").setIndex("expr", "abs(comp2.P)", 0);
    model.result("pg1").feature("glob1").setIndex("unit", "N", 0);
    model.result("pg1").feature("glob1").setIndex("descr", "", 0);

//    Click to expand the Coloring and Style section.
//    Find the Line style subsection.
//    From the Line list, select None.

    model.result("pg1").feature("glob1").set("linestyle", "none");

//    Find the Line markers subsection.
//    From the Marker list, select Circle.

    model.result("pg1").feature("glob1").set("linemarker", "circle");

//    From the Width list, select 3.

    model.result("pg1").feature("glob1").set("linewidth", 3);

//    Click to expand the Legends section.
//    From the Legends list, select Manual.

    model.result("pg1").feature("glob1").set("legendmethod", "manual");

//    In the table, enter the following settings:

    model.result("pg1").feature("glob1").setIndex("legends", "Computed", 0);

//    Right-click Global: Computed and choose Duplicate.

    model.result("pg1").feature().duplicate("glob2", "glob1");
    model.result("pg1").run();

//    In the Settings window for Global, type Global: Analytical in the Label text field.

    model.result("pg1").feature("glob2").label("Global: Analytical");

//    Locate the y-Axis Data section.
//    In the table, enter the following settings:

    model.result("pg1").feature("glob2").setIndex("expr", "8*A0/(pi^2*(freq/f0)^2)", 0);
    model.result("pg1").feature("glob2").setIndex("unit", "N", 0);
    model.result("pg1").feature("glob2").setIndex("descr", "", 0);

//    Locate the Data section.
//    From the Dataset list, select Study 1: Fourier Coefficient Generation/Solution 1 (1) (sol1).

    model.result("pg1").feature("glob2").set("data", "dset1");

//    From the Parameter selection (freq) list, select Manual.

    model.result("pg1").feature("glob2").setIndex("looplevelinput", "manualindices", 0);

//    In the Parameter indices (1-251) text field, type range(2,2,100).

    model.result("pg1").feature("glob2").setIndex("looplevelindices", "range(2,2,100)", 0);

//    Locate the Coloring and Style section.
//    Find the Line markers subsection.
//    From the Marker list, select Plus sign.

    model.result("pg1").feature("glob2").set("linemarker", "plus");

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

    model.result("pg1").feature("glob2").setIndex("legends", "Analytical", 0);

//    In the Fourier Coefficients, Computed vs. Analytical toolbar, click Plot.

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

//    In the Results toolbar, click 1D Plot Group.

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

//    In the Settings window for 1D Plot Group, type Fourier Coefficients; Real and Imaginary in the Label text field.

    model.result("pg2").label("Fourier Coefficients; Real and Imaginary");

//    Locate the Title section.
//    From the Title type list, select Label.

    model.result("pg2").set("titletype", "label");

//    Locate the Data section.
//    From the Parameter selection (freq) list, select Manual.

    model.result("pg2").setIndex("looplevelinput", "manualindices", 0);

//    In the Parameter indices (1-251) text field, type range(2,2,100).

    model.result("pg2").setIndex("looplevelindices", "range(2,2,100)", 0);

//    Locate the Axis section.
//    Select the x-axis log scale checkbox.

    model.result("pg2").set("xlog", true);

//    Select the y-axis log scale checkbox.

    model.result("pg2").set("ylog", true);

//    Locate the Plot Settings section.
//    Select the x-axis label checkbox.

    model.result("pg2").set("xlabelactive", true);

//    In the associated text field, type freq (Hz).

    model.result("pg2").set("xlabel", "freq (Hz)");

//    Select the y-axis label checkbox.

    model.result("pg2").set("ylabelactive", true);

//    In the associated text field, type Fourier Coefficients (N).

    model.result("pg2").set("ylabel", "Fourier Coefficients (N)");

//    Right-click Fourier Coefficients; Real and Imaginary and choose Global.

    model.result("pg2").create("glob1", "Global");
    model.result("pg2").feature("glob1").set("markerpos", "datapoints");
    model.result("pg2").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("pg2").feature("glob1").setIndex("expr", "abs(real(comp2.P))", 0);
    model.result("pg2").feature("glob1").setIndex("unit", "N", 0);
    model.result("pg2").feature("glob1").setIndex("descr", "", 0);
    model.result("pg2").feature("glob1").setIndex("expr", "abs(imag(comp2.P))", 1);
    model.result("pg2").feature("glob1").setIndex("unit", "N", 1);
    model.result("pg2").feature("glob1").setIndex("descr", "", 1);

//    Locate the Coloring and Style section.
//    Find the Line style subsection.
//    From the Line list, select None.

    model.result("pg2").feature("glob1").set("linestyle", "none");

//    Find the Line markers subsection.
//    From the Marker list, select Circle.

    model.result("pg2").feature("glob1").set("linemarker", "circle");

//    From the Width list, select 3.

    model.result("pg2").feature("glob1").set("linewidth", 3);

//    Locate the Legends section.
//    From the Legends list, select Manual.

    model.result("pg2").feature("glob1").set("legendmethod", "manual");

//    In the table, enter the following settings:

    model.result("pg2").feature("glob1").setIndex("legends", "Real", 0);
    model.result("pg2").feature("glob1").setIndex("legends", "Imaginary", 1);

//    In the Fourier Coefficients; Real and Imaginary toolbar, click Plot.

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

//    Now, set up the Solid Mechanics interface in order to find the response of the bracket to the periodic load.
//    In the Model Builder window, expand the Component 1 (comp1) > Definitions node.
//    In the Model Builder window, expand the Component 1 (comp1) > Definitions > Selections node.
//    In the Model Builder window, expand the Component 1 (comp1) > Solid Mechanics (solid) node, then click Linear Elastic Material 1.
//    In the Physics toolbar, click Attributes and choose Damping.

    model.component("comp1").physics("solid").feature("lemm1").create("dmp1", "Damping", 3);

//    Rayleigh damping is used for this example since it is applicable both in frequency and time domain analysis.
//    In the Settings window for Damping, locate the Damping Settings section.
//    From the Input parameters list, select Damping ratios.

    model.component("comp1").physics("solid").feature("lemm1").feature("dmp1")
         .set("InputParameters", "DampingRatios");

//    In the \[f_{1}\] text field, type 100.

    model.component("comp1").physics("solid").feature("lemm1").feature("dmp1").set("f1", 100);

//    In the \[\zeta_{1}\] text field, type 0.03.

    model.component("comp1").physics("solid").feature("lemm1").feature("dmp1").set("zeta1", 0.03);

//    In the \[f_{2}\] text field, type 300.

    model.component("comp1").physics("solid").feature("lemm1").feature("dmp1").set("f2", 300);

//    In the \[\zeta_{2}\] text field, type 0.03.

    model.component("comp1").physics("solid").feature("lemm1").feature("dmp1").set("zeta2", 0.03);

//    In order to visualize the damping ratio curve, create the <l>Damping Ratio</l> plot through an action button from the <l>Damping Settings</l> section.
//    Click Damping Ratio Preview in the upper-right corner of the Damping Settings section.
//    From the menu, choose Create Damping Ratio Plot.

    model.result().table().create("tbl1", "Table");
    model.result().table("tbl1")
         .setTableData(new double[][]{{17.320508075688775, 0.13120284867334248}, {20.438199529312755, 0.11162084002204235}, {23.555890982936734, 0.09728419959406275}, {26.673582436560714, 0.08635364242797958}, {29.791273890184694, 0.07775981680203466}, {32.908965343808674, 0.07083859901534659}, {36.02665679743265, 0.065155754340416}, {39.14434825105663, 0.06041538831691147}, {42.2620397046806, 0.0564089196039436}, {45.37973115830458, 0.0529850869237682}, {48.497422611928556, 0.05003152475577529}, {51.61511406555253, 0.047463016295743905}, {54.73280551917651, 0.04521376122649072}, {57.850496972800485, 0.04323214373034502}, {60.96818842642446, 0.04147710577052327}, {64.08587988004844, 0.03991557898226468}, {67.20357133367241, 0.03852063139839292}, {70.32126278729639, 0.037270107164137346}, {73.43895424092037, 0.03614561273968834}, {76.55664569454434, 0.035131750817965456}, {79.67433714816832, 0.03421553410517042}, {82.7920286017923, 0.0333859315525959}, {85.90972005541627, 0.03263351339279854}, {89.02741150904025, 0.03195017075961107}, {92.14510296266423, 0.031328892227400165}, {95.2627944162882, 0.03076358422988814}, {98.38048586991218, 0.03024892562469163}, {101.49817732353615, 0.029780249061665535}, {104.61586877716013, 0.02935344356352971}, {107.73356023078411, 0.028964874021756702}, {110.85125168440808, 0.028611314277528402}, {113.96894313803206, 0.02828989118636546}, {117.08663459165604, 0.02799803761917685}, {120.20432604528001, 0.027733452777267166}, {123.32201749890399, 0.027494068526977618}, {126.43970895252797, 0.02727802071495547}, {129.55740040615194, 0.027083624625069136}, {132.67509185977593, 0.026909353895705895}, {135.79278331339992, 0.026753822341319518}, {138.9104747670239, 0.026615768221948968}, {142.0281662206479, 0.026494040584556622}, {145.1458576742719, 0.026387587364671325}, {148.26354912789589, 0.02629544498922605}, {151.38124058151988, 0.02621672926417072}, {154.49893203514387, 0.02615062736537859}, {157.61662348876786, 0.0260963907800824}, {160.73431494239185, 0.026053329069781306}, {163.85200639601584, 0.02602080434520497}, {166.96969784963983, 0.02599822636026508}, {170.08738930326382, 0.025985048145572256}, {173.2050807568878, 0.02598076211353316}, {204.3819952931276, 0.026337447152718955}, {235.5589098293674, 0.0272186690142368}, {266.7358243656072, 0.02844049920194429}, {297.912738901847, 0.029896002543665604}, {329.08965343808677, 0.0315187666693126}, {360.26656797432656, 0.03326536810613535}, {391.44348251056635, 0.0351062174081007}, {422.62039704680615, 0.03702045644111971}, {453.79731158304594, 0.03899295907741798}, {484.97422611928573, 0.04101248876493449}, {516.1511406555255, 0.04307052382324716}, {547.3280551917653, 0.04516048422063765}, {578.5049697280051, 0.04727720837533888}, {609.6818842642449, 0.049416590483672515}, {640.8587988004847, 0.05157532370916245}, {672.0357133367245, 0.05375071485509108}, {703.2126278729643, 0.05594054833598133}, {734.3895424092041, 0.05814298479785223}, {765.5664569454439, 0.060356484509995756}, {796.7433714816837, 0.06257974874303206}, {827.9202860179234, 0.0648116743920904}, {859.0972005541632, 0.06705131848042648}, {890.274115090403, 0.06929787012142354}, {921.4510296266428, 0.07155062817251824}, {952.6279441628826, 0.07380898327708284}, {983.8048586991224, 0.076072403320879}, {1014.9817732353622, 0.07834042156889219}, {1046.158687771602, 0.08061262692339442}, {1077.3356023078418, 0.08288865587353292}, {1108.5125168440816, 0.08516818580342589}, {1139.6894313803214, 0.08745092939862541}, {1170.8663459165612, 0.08973662994622235}, {1202.043260452801, 0.0920250573663472}, {1233.2201749890407, 0.09431600484563403}, {1264.3970895252805, 0.09660928596874761}, {1295.5740040615203, 0.0989047322640748}, {1326.7509185977601, 0.10120219109545428}, {1357.927833134, 0.10350152384433145}, {1389.1047476702397, 0.1058026043367102}, {1420.2816622064795, 0.10810531747728677}, {1451.4585767427193, 0.11040955805961405}, {1482.635491278959, 0.1127152297263853}, {1513.8124058151989, 0.11502224405819558}, {1544.9893203514387, 0.11733051977263216}, {1576.1662348876785, 0.11963998201841836}, {1607.3431494239182, 0.12195056175170406}, {1638.520063960158, 0.12426219518356224}, {1669.6969784963978, 0.12657482328938405}, {1700.8738930326376, 0.12888839137223057}, {1732.0508075688774, 0.13120284867334248}});
    model.result().table("tbl1").label("Damping Ratio Plot");
    model.result().table("tbl1")
         .setColumnHeaders(new String[]{"freq", "\\[ \\zeta (f) = \\frac{1}{2} \\; \\left( \\frac{\\alpha_{\\mathrm{d}M}}{2 \\pi f}  + 2 \\pi f \\beta_{\\mathrm{d} K} \\right) \\]"});
    model.result().create("pg3", "PlotGroup1D");
    model.result("pg3").label("Damping Ratio Plot");
    model.result("pg3").create("tblp11", "Table");
    model.result("pg3").feature("tblp11").set("markerpos", "datapoints");
    model.result("pg3").feature("tblp11").set("table", "tbl1");
    model.result("pg3").feature("tblp11").label("Damping 1");
    model.result("pg3").feature("tblp11").set("legend", true);
    model.result("pg3").set("xlabel", "Frequency (Hz)");
    model.result("pg3").set("ylabel", "Damping ratio");
    model.result("pg3").set("legendpos", "uppermiddle");
    model.result("pg3").run();
    model.result("pg3").run();

//    In the Model Builder window, under Results, click Damping Ratio Plot.
//    In the Damping Ratio Plot toolbar, click Plot.

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

//    You can now apply an external harmonic load in terms of the Fourier Series coefficients to the bracket arms.
//    In the Physics toolbar, click Boundaries and choose Boundary Load.

    model.component("comp1").physics("solid").create("bndl1", "BoundaryLoad", 2);

//    In the Settings window for Boundary Load, type Boundary Load, Harmonic in the Label text field.

    model.component("comp1").physics("solid").feature("bndl1").label("Boundary Load, Harmonic");

//    Locate the Boundary Selection section.
//    From the Selection list, select Pin Holes.

    model.component("comp1").physics("solid").feature("bndl1").selection().named("uni2");

//    Locate the Force section.
//    From the Load type list, select Total force.

    model.component("comp1").physics("solid").feature("bndl1").set("forceType", "TotalForce");

//    Specify the \[\mathbf{F}_{\mathrm{tot}}\] vector as

    model.component("comp1").physics("solid").feature("bndl1")
         .set("force", new String[]{"withsol('sol1',comp2.P,setval(freq,freq))", "0", "0"});

//    To define a harmonic load in the frequency domain modal analysis, you need to mark the load as being a harmonic perturbation.
//    Right-click Boundary Load, Harmonic and choose Harmonic Perturbation.

    model.component("comp1").physics("solid").feature("bndl1").set("harmonicPerturbation", true);

//    Add the <l>Frequency Domain, Modal</l> study along with the <l>Time to Frequency FFT</l> study step.
//    In the Home toolbar, click Add Study to open the Add Study window.
//    Find the Studies subsection.
//    In the Select Study tree, select Preset Studies for Selected Physics Interfaces > Solid Mechanics > Frequency Domain, Modal.
//    Right-click and choose Add Study.

    model.study().create("std2");
    model.study("std2").create("eig", "Eigenfrequency");
    model.study("std2").feature("eig").set("storefact", false);
    model.study("std2").feature("eig").set("plotgrouparr", new String[]{"Default"});
    model.study("std2").feature("eig").set("outputmap", new String[]{});
    model.study("std2").feature("eig").set("ngenAUX", "1");
    model.study("std2").feature("eig").set("goalngenAUX", "1");
    model.study("std2").feature("eig").set("ngenAUX", "1");
    model.study("std2").feature("eig").set("goalngenAUX", "1");
    model.study("std2").create("frmod", "Frequencymodal");
    model.study("std2").feature("frmod").set("outputmap", new String[]{});

//    In the Home toolbar, click Add Study to close the Add Study window.
//    In the Settings window for Study, type Study 2: Frequency Domain Modal + FFT in the Label text field.

    model.study("std2").label("Study 2: Frequency Domain Modal + FFT");

//    In the Model Builder window, under Study 2: Frequency Domain Modal + FFT, click Step 1: Eigenfrequency.
//    In the Settings window for Eigenfrequency, locate the Study Settings section.
//    Select the Desired number of eigenfrequencies checkbox.

    model.study("std2").feature("eig").set("neigsactive", true);

//    In the associated text field, type 12.

    model.study("std2").feature("eig").set("neigs", 12);

//    Locate the Physics and Variables Selection section.
//    Select the Modify model configuration for study step checkbox.

    model.study("std2").feature("eig").set("useadvanceddisable", true);

//    In the tree, select Component 1 (comp1) > Solid Mechanics (solid) > Linear Elastic Material 1 > Damping 1.
//    Right-click and choose Disable.

    model.study("std2").feature("eig").set("disabledphysics", new String[]{"solid/lemm1/dmp1"});

//    In the tree, select Component 2 (comp2) > Global ODEs and DAEs (ge).
//    Right-click and choose Disable in Solvers.

    model.study("std2").feature("eig").setSolveFor("/physics/ge", false);

//    In the Model Builder window, click Step 2: Frequency Domain, Modal.
//    In the Settings window for Frequency Domain, Modal, locate the Study Settings section.
//    In the Frequencies text field, type range(f0,f0,40*f0).

    model.study("std2").feature("frmod").set("plist", "range(f0,f0,40*f0)");

//    Locate the Physics and Variables Selection section.
//    Select the Modify model configuration for study step checkbox.

    model.study("std2").feature("frmod").set("useadvanceddisable", true);

//    In the tree, select Component 2 (comp2) > Global ODEs and DAEs (ge).
//    Right-click and choose Disable in Solvers.

    model.study("std2").feature("frmod").setSolveFor("/physics/ge", false);

//    In the Study toolbar, click More Study Steps and choose Time Dependent > Frequency to Time FFT.

    model.study("std2").create("ftfft", "FreqToTimeFFT");

//    In the Settings window for Frequency to Time FFT, locate the Study Settings section.
//    In the Times text field, type range(0,T0/100,T0).

    model.study("std2").feature("ftfft").set("fftouttrange", "range(0,T0/100,T0)");

//    The purpose of the inverse FFT study step is just to superimpose the results from the different harmonics, so the unscaled discrete FFT is suitable.
//    From the Scaling list, select Discrete Fourier transform.

    model.study("std2").feature("ftfft").set("fftscaling", "discrete");

//    Locate the Physics and Variables Selection section.
//    Select the Modify model configuration for study step checkbox.

    model.study("std2").feature("ftfft").set("useadvanceddisable", true);

//    In the tree, select Component 2 (comp2) > Global ODEs and DAEs (ge).
//    Right-click and choose Disable in Solvers.

    model.study("std2").feature("ftfft").setSolveFor("/physics/ge", false);

//    In the Study toolbar, click Compute.

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

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

    model.result().create("pg4", "PlotGroup3D");
    model.result("pg4").set("data", "dset5");
    model.result("pg4").label("Stress (solid)");
    model.result("pg4").set("frametype", "spatial");
    model.result("pg4").create("vol1", "Volume");
    model.result("pg4").feature("vol1").set("expr", new String[]{"solid.misesGp"});
    model.result("pg4").feature("vol1").set("threshold", "manual");
    model.result("pg4").feature("vol1").set("thresholdvalue", 0.2);
    model.result("pg4").feature("vol1").set("colortable", "Rainbow");
    model.result("pg4").feature("vol1").set("colortabletrans", "none");
    model.result("pg4").feature("vol1").set("colorscalemode", "linear");
    model.result("pg4").feature("vol1").set("resolution", "custom");
    model.result("pg4").feature("vol1").set("refine", 2);
    model.result("pg4").feature("vol1").set("colortable", "Prism");
    model.result("pg4").feature("vol1").create("def", "Deform");
    model.result("pg4").feature("vol1").feature("def").set("expr", new String[]{"u", "v", "w"});
    model.result("pg4").feature("vol1").feature("def").set("descr", "Displacement field");
    model.result("pg4").run();

//    In the Settings window for 3D Plot Group, locate the Data section.
//    From the Time (s) list, select 0.022.

    model.result("pg4").setIndex("looplevel", 89, 0);

//    Locate the Color Legend section.
//    Select the Show maximum and minimum values checkbox.

    model.result("pg4").set("showlegendsmaxmin", true);

//    In the Label text field, type Stress: Frequency Domain Modal + FFT.

    model.result("pg4").label("Stress: Frequency Domain Modal + FFT");
    model.result("pg4").run();

//    In the Model Builder window, expand the Stress: Frequency Domain Modal + FFT node, then click Volume 1.
//    In the Stress: Frequency Domain Modal + FFT toolbar, click Plot.

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

//    Click the Show Grid button in the Graphics toolbar.

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

//    In the Results toolbar, click 1D Plot Group.

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

//    In the Settings window for 1D Plot Group, type Displacement Amplitude [Frequency Response] in the Label text field.

    model.result("pg5").label("Displacement Amplitude [Frequency Response]");

//    Locate the Title section.
//    From the Title type list, select Label.

    model.result("pg5").set("titletype", "label");

//    Locate the Data section.
//    From the Dataset list, select Study 2: Frequency Domain Modal + FFT/Solution Store 3 (9) (sol5).

    model.result("pg5").set("data", "dset9");

//    From the Parameter selection (freq) list, select Manual.

    model.result("pg5").setIndex("looplevelinput", "manualindices", 0);

//    In the Parameter indices (1-40) text field, type range(1,1,10).

    model.result("pg5").setIndex("looplevelindices", "range(1,1,10)", 0);

//    Right-click Displacement Amplitude [Frequency Response] and choose Point Graph.

    model.result("pg5").create("ptgr1", "PointGraph");
    model.result("pg5").feature("ptgr1").set("markerpos", "datapoints");
    model.result("pg5").feature("ptgr1").set("linewidth", "preference");

//    Select Point 1.

    model.result("pg5").feature("ptgr1").selection().set(1);

//    In the Settings window for Point Graph, click Replace Expression in the upper-right corner of the y-Axis Data section.
//    From the menu, choose Component 1 (comp1) > Solid Mechanics > Displacement > Displacement amplitude (material and geometry frames) - m > solid.uAmpX - Displacement amplitude, X-component.

    model.result("pg5").feature("ptgr1").set("expr", "solid.uAmpX");
    model.result("pg5").feature("ptgr1").set("descr", "Displacement amplitude, X-component");

//    Click to expand the Coloring and Style section.
//    Find the Line style subsection.
//    From the Line list, select None.

    model.result("pg5").feature("ptgr1").set("linestyle", "none");

//    Find the Line markers subsection.
//    From the Marker list, select Diamond.

    model.result("pg5").feature("ptgr1").set("linemarker", "diamond");

//    In the Displacement Amplitude [Frequency Response] toolbar, click Plot.

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

//    For verification, solve the problem also in time domain. To provide the time-domain load, enter its amplitude in a <l>Boundary Load</l> node, and its time dependency in the solver settings for the <l>Time Dependent, Modal</l> study step.
//    In the Physics toolbar, click Boundaries and choose Boundary Load.

    model.component("comp1").physics("solid").create("bndl2", "BoundaryLoad", 2);

//    In the Settings window for Boundary Load, type Boundary Load, Time Domain Amplitude in the Label text field.

    model.component("comp1").physics("solid").feature("bndl2").label("Boundary Load, Time Domain Amplitude");

//    Locate the Boundary Selection section.
//    From the Selection list, select Pin Holes.

    model.component("comp1").physics("solid").feature("bndl2").selection().named("uni2");

//    Locate the Force section.
//    From the Load type list, select Total force.

    model.component("comp1").physics("solid").feature("bndl2").set("forceType", "TotalForce");

//    Specify the \[\mathbf{F}_{\mathrm{tot}}\] vector as

    model.component("comp1").physics("solid").feature("bndl2").set("force", new String[]{"A0", "0", "0"});

//    Disable the transient boundary load in the second study. While not necessary, since it is a harmonic perturbation load, it makes the modeling easier to follow.
//    In the Model Builder window, under Study 2: Frequency Domain Modal + FFT, click Step 2: Frequency Domain, Modal.
//    In the Settings window for Frequency Domain, Modal, locate the Physics and Variables Selection section.
//    In the tree, select Component 1 (comp1) > Solid Mechanics (solid) > Boundary Load, Time Domain Amplitude.
//    Right-click and choose Disable.

    model.study("std2").feature("frmod").set("disabledphysics", new String[]{"solid/bndl2"});

//    In the Model Builder window, click Step 3: Frequency to Time FFT.
//    In the Settings window for Frequency to Time FFT, locate the Physics and Variables Selection section.
//    In the tree, select Component 1 (comp1) > Solid Mechanics (solid) > Boundary Load, Time Domain Amplitude.
//    Right-click and choose Disable.

    model.study("std2").feature("ftfft").set("disabledphysics", new String[]{"solid/bndl2"});

//    Add the <l>Time-Dependent, Modal</l> study.
//    In the Home toolbar, click Add Study to open the Add Study window.
//    Find the Studies subsection.
//    In the Select Study tree, select Preset Studies for Selected Physics Interfaces > Solid Mechanics > Time Dependent, Modal.
//    Right-click and choose Add Study.

    model.study().create("std3");
    model.study("std3").create("eig", "Eigenfrequency");
    model.study("std3").feature("eig").set("storefact", false);
    model.study("std3").feature("eig").set("plotgrouparr", new String[]{"Default"});
    model.study("std3").feature("eig").set("outputmap", new String[]{});
    model.study("std3").feature("eig").set("ngenAUX", "1");
    model.study("std3").feature("eig").set("goalngenAUX", "1");
    model.study("std3").feature("eig").set("ngenAUX", "1");
    model.study("std3").feature("eig").set("goalngenAUX", "1");
    model.study("std3").create("timod", "Transientmodal");
    model.study("std3").feature("timod").set("initialtime", "0");
    model.study("std3").feature("timod").set("linpsolnum", "auto");
    model.study("std3").feature("timod").set("outputmap", new String[]{});

//    In the Home toolbar, click Add Study to close the Add Study window.
//    In the Settings window for Study, type Study 3: Time-Dependent Modal [Verification] in the Label text field.

    model.study("std3").label("Study 3: Time-Dependent Modal [Verification]");

//    Since the eigenfrequencies are already computed in a previous study, it is possible to remove the eigenfrequency study step here.
//    In the Model Builder window, right-click Study 3: Time-Dependent Modal [Verification] > Step 1: Eigenfrequency and choose Delete.

    model.study("std3").feature().remove("eig");

//    In order for any startup transients to fade away, a significant number of cycles need to be analyzed, but only the results from the last cycle need to be stored. Here, 20 periods will pass before results are stored.
//    In the Settings window for Time Dependent, Modal, locate the Study Settings section.
//    In the Output times text field, type -20*T0 range(0,T0/100,T0).

    model.study("std3").feature("timod").set("tlist", "-20*T0 range(0,T0/100,T0)");

//    For a <l>Time Dependent, Modal</l> study step, the time-dependent part of the load needs to be entered in the study settings.
//    In the Load factor text field, type Periodic(t).

    model.study("std3").feature("timod").set("loadfact", "Periodic(t)");

//    Locate the Physics and Variables Selection section.
//    Select the Modify model configuration for study step checkbox.

    model.study("std3").feature("timod").set("useadvanceddisable", true);

//    In the tree, select Component 1 (comp1) > Solid Mechanics (solid) > Boundary Load, Harmonic.
//    Right-click and choose Disable.

    model.study("std3").feature("timod").set("disabledphysics", new String[]{"solid/bndl1"});

//    In the tree, select Component 2 (comp2) > Global ODEs and DAEs (ge).
//    Right-click and choose Disable in Solvers.

    model.study("std3").feature("timod").setSolveFor("/physics/ge", false);

//    In the Study toolbar, click Show Default Solver.

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

//    Enforce small time steps.
//    In the Model Builder window, expand the Solution 6 (sol6) node, then click Modal Solver 1.
//    In the Settings window for Modal Solver, locate the General section.
//    From the Maximum step constraint list, select Constant.

    model.sol("sol6").feature("mo1").set("maxstepconstraintbdf", "const");

//    In the Maximum step text field, type 5e-5.

    model.sol("sol6").feature("mo1").set("maxstepbdf", "5e-5");

//    Since the eigenfrequency study step has been removed from this study, it is necessary to point to the study step that provides the eigenvalue solution.
//    Locate the Eigenpairs section.
//    From the Solution list, select Solution 3 (sol3).

    model.sol("sol6").feature("mo1").set("eigsol", "sol3");

//    From the Use list, select Solution Store 2 (sol4).

    model.sol("sol6").feature("mo1").set("eigsoluse", "sol4");

//    In the Study toolbar, click Compute.

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

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

    model.result().create("pg6", "PlotGroup3D");
    model.result("pg6").set("data", "dset11");
    model.result("pg6").label("Stress (solid)");
    model.result("pg6").set("frametype", "spatial");
    model.result("pg6").create("vol1", "Volume");
    model.result("pg6").feature("vol1").set("expr", new String[]{"solid.misesGp"});

    return model;
  }

  public static Model run3(Model model) {
    model.result("pg6").feature("vol1").set("threshold", "manual");
    model.result("pg6").feature("vol1").set("thresholdvalue", 0.2);
    model.result("pg6").feature("vol1").set("colortable", "Rainbow");
    model.result("pg6").feature("vol1").set("colortabletrans", "none");
    model.result("pg6").feature("vol1").set("colorscalemode", "linear");
    model.result("pg6").feature("vol1").set("resolution", "custom");
    model.result("pg6").feature("vol1").set("refine", 2);
    model.result("pg6").feature("vol1").set("colortable", "Prism");
    model.result("pg6").feature("vol1").create("def", "Deform");
    model.result("pg6").feature("vol1").feature("def").set("expr", new String[]{"u", "v", "w"});
    model.result("pg6").feature("vol1").feature("def").set("descr", "Displacement field");
    model.result("pg6").run();

//    In the Settings window for 3D Plot Group, locate the Data section.
//    From the Time (s) list, select 0.022.

    model.result("pg6").setIndex("looplevel", 90, 0);

//    Locate the Color Legend section.
//    Select the Show maximum and minimum values checkbox.

    model.result("pg6").set("showlegendsmaxmin", true);

//    In the Label text field, type Stress: Time-Dependent Modal.

    model.result("pg6").label("Stress: Time-Dependent Modal");
    model.result("pg6").run();

//    In the Model Builder window, expand the Stress: Time-Dependent Modal node, then click Volume 1.
//    In the Stress: Time-Dependent Modal toolbar, click Plot.

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

//    In the Results toolbar, click Result Templates to open the Result Templates window.
//    In the tree, select Study 3: Time-Dependent Modal [Verification]/Solution 6 (11) (sol6) > Solid Mechanics > Applied Loads (solid) > Boundary Loads (solid).
//    Click Add Result Template in the window toolbar.

    model.result().create("pg7", "PlotGroup3D");
    model.result("pg7").set("data", "dset11");
    model.result("pg7").label("Boundary Loads (solid)");
    model.result("pg7").set("showlegends", true);
    model.result("pg7").set("titletype", "label");
    model.result("pg7").set("frametype", "spatial");
    model.result("pg7").set("showlegendsunit", true);
    model.result("pg7").create("surf1", "Surface");
    model.result("pg7").feature("surf1").set("expr", new String[]{"1"});
    model.result("pg7").feature("surf1").label("Gray Surfaces");
    model.result("pg7").feature("surf1").set("coloring", "uniform");
    model.result("pg7").feature("surf1").set("color", "gray");
    model.result("pg7").feature("surf1").set("inheritcolor", false);
    model.result("pg7").feature("surf1").set("inheritrange", false);
    model.result("pg7").feature("surf1").set("inherittransparency", false);
    model.result("pg7").feature("surf1").create("def", "Deform");
    model.result("pg7").feature("surf1").feature("def").set("expr", new String[]{"u", "v", "w"});
    model.result("pg7").feature("surf1").feature("def").set("descr", "Displacement field");
    model.result("pg7").feature("surf1").feature("def").set("scaleactive", true);
    model.result("pg7").feature("surf1").feature("def").set("scale", 0);
    model.result("pg7").feature("surf1").create("sel1", "Selection");
    model.result("pg7").feature("surf1").feature("sel1").selection().geom("geom1", 2);
    model.result("pg7").feature("surf1").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, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88);
    model.result("pg7").feature("surf1").create("tran1", "Transparency");
    model.result("pg7").feature("surf1").feature("tran1").set("transparency", 0.8);
    model.result("pg7").create("arws1", "ArrowSurface");
    model.result("pg7").feature("arws1")
         .set("expr", new String[]{"solid.bndl2.fax", "solid.bndl2.fay", "solid.bndl2.faz"});
    model.result("pg7").feature("arws1").set("placement", "gausspoints");
    model.result("pg7").feature("arws1").set("arrowbase", "tail");
    model.result("pg7").feature("arws1").label("Boundary Load, Time Domain Amplitude");
    model.result("pg7").feature("arws1").set("inheritplot", "none");
    model.result("pg7").feature("arws1").create("col", "Color");
    model.result("pg7").feature("arws1").feature("col").set("colortable", "Rainbow");
    model.result("pg7").feature("arws1").feature("col").set("colortabletrans", "none");
    model.result("pg7").feature("arws1").feature("col").set("colorscalemode", "linear");
    model.result("pg7").feature("arws1").feature("col").set("colordata", "arrowlength");
    model.result("pg7").feature("arws1").feature("col").set("coloring", "gradient");
    model.result("pg7").feature("arws1").feature("col").set("topcolor", "red");
    model.result("pg7").feature("arws1").feature("col").set("bottomcolor", "custom");
    model.result("pg7").feature("arws1").feature("col")
         .set("custombottomcolor", new double[]{0.5882353186607361, 0.5137255191802979, 0.5176470875740051});
    model.result("pg7").feature("arws1").set("color", "red");
    model.result("pg7").feature("arws1").create("def", "Deform");
    model.result("pg7").feature("arws1").feature("def").set("expr", new String[]{"u", "v", "w"});
    model.result("pg7").feature("arws1").feature("def").set("descr", "Displacement field");
    model.result("pg7").feature("arws1").feature("def").set("scaleactive", true);
    model.result("pg7").feature("arws1").feature("def").set("scale", 0);
    model.result("pg7").feature().move("surf1", 1);
    model.result("pg7").label("Boundary Loads (solid)");
    model.result("pg7").run();

//    In the Results toolbar, click Result Templates to close the Result Templates window.
//    In the Boundary Loads (solid) toolbar, click Plot.

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

//    The maximum displacement occurs at the tip of the bracket, and the maximum stress occurs in the fillet near the bolt holes. Generate 1D plots of displacement and stress in order to visualize the transient response of the bracket. Plot the response from <l>Study 3</l> along with <l>Study 2</l> in order to validate the results.
//    In the Results toolbar, click 1D Plot Group.

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

//    In the Settings window for 1D Plot Group, locate the Data section.
//    From the Dataset list, select Study 2: Frequency Domain Modal + FFT/Solution 3 (5) (sol3).

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

//    In the Label text field, type Tip Displacement.

    model.result("pg8").label("Tip Displacement");

//    Locate the Title section.
//    From the Title type list, select None.

    model.result("pg8").set("titletype", "none");

//    Right-click Tip Displacement and choose Point Graph.

    model.result("pg8").create("ptgr1", "PointGraph");
    model.result("pg8").feature("ptgr1").set("markerpos", "datapoints");
    model.result("pg8").feature("ptgr1").set("linewidth", "preference");

//    Select Point 1.

    model.result("pg8").feature("ptgr1").selection().set(1);

//    In the Settings window for Point Graph, locate the y-Axis Data section.
//    In the Expression text field, type u.

    model.result("pg8").feature("ptgr1").set("expr", "u");

//    In the Tip Displacement toolbar, click Plot.

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

//    Click to expand the Legends section.
//    Select the Show legends checkbox.

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

//    From the Legends list, select Manual.

    model.result("pg8").feature("ptgr1").set("legendmethod", "manual");

//    In the table, enter the following settings:

    model.result("pg8").feature("ptgr1").setIndex("legends", "Frequency Domain Modal + FFT", 0);

//    Right-click Point Graph 1 and choose Duplicate.

    model.result("pg8").feature().duplicate("ptgr2", "ptgr1");
    model.result("pg8").run();

//    In the Settings window for Point Graph, locate the Data section.
//    From the Dataset list, select Study 3: Time-Dependent Modal [Verification]/Solution 6 (11) (sol6).

    model.result("pg8").feature("ptgr2").set("data", "dset11");

//    From the Time selection list, select Manual.

    model.result("pg8").feature("ptgr2").setIndex("looplevelinput", "manualindices", 0);

//    In the Time indices (1-102) text field, type range(2,102).

    model.result("pg8").feature("ptgr2").setIndex("looplevelindices", "range(2,102)", 0);

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

    model.result("pg8").feature("ptgr2").setIndex("legends", "Time-Dependent Modal", 0);

//    In the Tip Displacement toolbar, click Plot.

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

//    In the Model Builder window, right-click Tip Displacement and choose Duplicate.

    model.result().duplicate("pg9", "pg8");
    model.result("pg9").run();

//    In the Settings window for 1D Plot Group, type Fillet Stress in the Label text field.

    model.result("pg9").label("Fillet Stress");
    model.result("pg9").run();

//    In the Model Builder window, expand the Fillet Stress node, then click Point Graph 1.
//    In the Settings window for Point Graph, locate the Selection section.
//    Select the Activate Selection toggle button.
//    Click Clear Selection.

    model.result("pg9").feature("ptgr1").selection().set();

//    Select Point 34.

    model.result("pg9").feature("ptgr1").selection().set(34);

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

    model.result("pg9").feature("ptgr1").set("expr", "solid.sx");
    model.result("pg9").run();

//    In the Model Builder window, click Point Graph 2.
//    In the Settings window for Point Graph, locate the Selection section.
//    Select the Activate Selection toggle button.
//    Click Clear Selection.

    model.result("pg9").feature("ptgr2").selection().set();

//    Select Point 34.

    model.result("pg9").feature("ptgr2").selection().set(34);

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

    model.result("pg9").feature("ptgr2").set("expr", "solid.sx");

//    In the Fillet Stress toolbar, click Plot.

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

    model.title("Bracket \u2014 General Periodic Dynamic Analysis");

    model
         .description("In this example, a bracket is subjected to a periodic, but not harmonic, loading. The loading function is initially decomposed into a Fourier series using a Time to Frequency FFT study step. The response to the series of harmonics is computed using a standard frequency sweep, and then an inverse FFT study is performed to transform the results back into time domain. Finally, a Time-dependent Modal study is used to validate the results.");

    return model;
  }

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

}
