/*
 * truss_tower_buckling.java
 */

import com.comsol.model.*;
import com.comsol.model.util.*;

/** Model exported on May 15 2026, 09:36 by COMSOL 6.4.0.421. */
public class truss_tower_buckling {

  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 3D.
//    In the Select Physics tree, select Structural Mechanics > Truss (truss).
//    Click Add.
//    Click Study.
//    In the Select Study tree, select Preset Studies for Selected Physics Interfaces > Linear Buckling.
//    Click Done.

    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("truss", "Truss", "geom1");

    model.study().create("std1");
    model.study("std1").create("stat", "Stationary");
    model.study("std1").feature("stat").set("solnum", "auto");
    model.study("std1").feature("stat").set("notsolnum", "auto");
    model.study("std1").feature("stat").set("outputmap", new String[]{});
    model.study("std1").feature("stat").set("ngenAUX", "1");
    model.study("std1").feature("stat").set("goalngenAUX", "1");
    model.study("std1").feature("stat").set("ngenAUX", "1");
    model.study("std1").feature("stat").set("goalngenAUX", "1");
    model.study("std1").create("buckling", "LinearBuckling");
    model.study("std1").feature("buckling").set("neigsactive", true);
    model.study("std1").feature("buckling").set("solnum", "auto");
    model.study("std1").feature("buckling").set("notsolnum", "auto");
    model.study("std1").feature("buckling").set("outputmap", new String[]{});
    model.study("std1").feature("buckling").set("ngenAUX", "1");
    model.study("std1").feature("buckling").set("goalngenAUX", "1");
    model.study("std1").feature("buckling").set("ngenAUX", "1");
    model.study("std1").feature("buckling").set("goalngenAUX", "1");

//    In the Model Builder window, under Global Definitions, click Parameters 1.
//    In the Settings window for Parameters, type Geometric Parameters in the Label text field.

    model.param().label("Geometric Parameters");

//    Locate the Parameters section.
//    Click Load from File.
//    Browse to the model's Application Library folder and double-click the file truss_tower_buckling_geometric_parameters.txt.
//    To import content from file, use:
//    model.param().loadFile("FILENAME");
    model.param().set("depth", "0.4[m]", "Depth of the tower");
    model.param().set("width", "0.45[m]", "Width of the tower");
    model.param().set("height", "1[m]", "Height of the tower");
    model.param().set("n", "10", "Number of sections");
    model.param().set("L", "height*(2*n-1)", "Total height of the tower");
    model.param().set("do1", "3[cm]", "Outer diameter tube 1");
    model.param().set("di1", "2[cm]", "Inner diameter tube 1");
    model.param().set("do2", "2[cm]", "Outer diameter tube 2");
    model.param().set("di2", "1.4[cm]", "Inner diameter tube 2");
    model.param().set("A1", "pi/4*(do1^2-di1^2)", "Area tube 1");
    model.param().set("A2", "pi/4*(do2^2-di2^2)", "Area tube 2");

//    In the Home toolbar, click Parameters and choose Add > Parameters.

    model.param().create("par2");

//    In the Settings window for Parameters, type Loads in the Label text field.

    model.param("par2").label("Loads");

//    Locate the Parameters section.
//    In the table, enter the following settings:

    model.param("par2").set("I1", "4*A1*(depth/2)^2");
    model.param("par2").descr("I1", "Area moment of inertia weak direction");
    model.param("par2").set("Fc1", "pi^2*200e9[Pa]*I1/(2*L)^2");
    model.param("par2").descr("Fc1", "First critical buckling load");
    model.param("par2").set("I2", "4*A1*(width/2)^2");
    model.param("par2").descr("I2", "Area moment of inertia stiffer direction");
    model.param("par2").set("Fc2", "pi^2*200e9[Pa]*I2/(2*L)^2");
    model.param("par2").descr("Fc2", "Second critical buckling load");
    model.param("par2").set("load", "1[N]");
    model.param("par2").descr("load", "Applied load");

//    In the Geometry toolbar, click Block.

    model.component("comp1").geom("geom1").create("blk1", "Block");

//    In the Settings window for Block, locate the Size and Shape section.
//    In the Width text field, type width.

    model.component("comp1").geom("geom1").feature("blk1").set("size", new String[]{"width", "1", "1"});

//    In the Depth text field, type depth.

    model.component("comp1").geom("geom1").feature("blk1").set("size", new String[]{"width", "depth", "1"});

//    In the Height text field, type height.

    model.component("comp1").geom("geom1").feature("blk1").set("size", new String[]{"width", "depth", "height"});

//    In the Geometry toolbar, click Conversions and choose Convert to Curve.

    model.component("comp1").geom("geom1").run("blk1");
    model.component("comp1").geom("geom1").create("ccur1", "ConvertToCurve");

//    Select the object blk1.

    model.component("comp1").geom("geom1").feature("ccur1").selection("input").set("blk1");

//    In the Geometry toolbar, click More Primitives and choose Polygon.

    model.component("comp1").geom("geom1").run("ccur1");
    model.component("comp1").geom("geom1").create("pol1", "Polygon");
    model.component("comp1").geom("geom1").feature("pol1").set("source", "table");

//    In the Settings window for Polygon, locate the Object Type section.
//    From the Type list, select Closed curve.

    model.component("comp1").geom("geom1").feature("pol1").set("type", "closed");

//    Locate the Coordinates section.
//    In the table, enter the following settings:

    model.component("comp1").geom("geom1").feature("pol1").setIndex("table", 0, 0, 0);
    model.component("comp1").geom("geom1").feature("pol1").setIndex("table", "depth", 0, 1);
    model.component("comp1").geom("geom1").feature("pol1").setIndex("table", 0, 0, 2);
    model.component("comp1").geom("geom1").feature("pol1").setIndex("table", 0, 1, 0);
    model.component("comp1").geom("geom1").feature("pol1").setIndex("table", 0, 1, 1);
    model.component("comp1").geom("geom1").feature("pol1").setIndex("table", "height", 1, 2);
    model.component("comp1").geom("geom1").feature("pol1").setIndex("table", "width", 2, 0);
    model.component("comp1").geom("geom1").feature("pol1").setIndex("table", 0, 2, 1);
    model.component("comp1").geom("geom1").feature("pol1").setIndex("table", 0, 2, 2);
    model.component("comp1").geom("geom1").feature("pol1").setIndex("table", "width", 3, 0);
    model.component("comp1").geom("geom1").feature("pol1").setIndex("table", "depth", 3, 1);
    model.component("comp1").geom("geom1").feature("pol1").setIndex("table", "height", 3, 2);

//    In the Geometry toolbar, click More Primitives and choose Line Segment.

    model.component("comp1").geom("geom1").run("pol1");
    model.component("comp1").geom("geom1").create("ls1", "LineSegment");

//    In the Settings window for Line Segment, locate the Starting Point section.
//    From the Specify list, select Coordinates.

    model.component("comp1").geom("geom1").feature("ls1").set("specify1", "coord");

//    Locate the Endpoint section.
//    From the Specify list, select Coordinates.

    model.component("comp1").geom("geom1").feature("ls1").set("specify2", "coord");

//    Locate the Starting Point section.
//    In the y text field, type depth.

    model.component("comp1").geom("geom1").feature("ls1").set("coord1", new String[]{"0", "depth", "0"});

//    Locate the Endpoint section.
//    In the x text field, type width.

    model.component("comp1").geom("geom1").feature("ls1").set("coord2", new String[]{"width", "0", "0"});

//    In the Geometry toolbar, click More Primitives and choose Line Segment.

    model.component("comp1").geom("geom1").run("ls1");
    model.component("comp1").geom("geom1").create("ls2", "LineSegment");

//    In the Settings window for Line Segment, locate the Starting Point section.
//    From the Specify list, select Coordinates.

    model.component("comp1").geom("geom1").feature("ls2").set("specify1", "coord");

//    Locate the Endpoint section.
//    From the Specify list, select Coordinates.

    model.component("comp1").geom("geom1").feature("ls2").set("specify2", "coord");

//    Locate the Starting Point section.
//    In the z text field, type height.

    model.component("comp1").geom("geom1").feature("ls2").set("coord1", new String[]{"0", "0", "height"});

//    Locate the Endpoint section.
//    In the x text field, type width.

    model.component("comp1").geom("geom1").feature("ls2").set("coord2", new String[]{"width", "0", "0"});

//    , <l>y</l> to <c>depth</c>, and <l>z</l> to <c>height</c>.

    model.component("comp1").geom("geom1").feature("ls2").set("coord2", new String[]{"width", "depth", "height"});

//    In the Geometry toolbar, click Build All.

    model.component("comp1").geom("geom1").run("fin");

//    In the Geometry toolbar, click Transforms and choose Mirror.

    model.component("comp1").geom("geom1").run("ls2");
    model.component("comp1").geom("geom1").create("mir1", "Mirror");

//    Click the Select All button in the Graphics toolbar.

    model.component("comp1").geom("geom1").feature("mir1").selection("input").set("ccur1", "ls1", "ls2", "pol1");

//    In the Settings window for Mirror, locate the Input section.
//    Select the Keep input objects checkbox.

    model.component("comp1").geom("geom1").feature("mir1").set("keep", true);

//    Locate the Point on Plane of Reflection section.
//    In the z text field, type height.

    model.component("comp1").geom("geom1").feature("mir1").set("pos", new String[]{"0", "0", "height"});

//    In the Geometry toolbar, click Build All.

    model.component("comp1").geom("geom1").run("fin");

//    In the Geometry toolbar, click Transforms and choose Array.

    model.component("comp1").geom("geom1").run("mir1");
    model.component("comp1").geom("geom1").create("arr1", "Array");

//    Select the objects ccur1, ls1, ls2, pol1.

    model.component("comp1").geom("geom1").feature("arr1").selection("input").set("ccur1", "ls1", "ls2", "pol1");

//    In the Settings window for Array, locate the Size section.
//    In the z size text field, type n.

    model.component("comp1").geom("geom1").feature("arr1").set("fullsize", new String[]{"1", "1", "n"});

//    Locate the Displacement section.
//    In the z text field, type 2*height.

    model.component("comp1").geom("geom1").feature("arr1").set("displ", new String[]{"0", "0", "2*height"});

//    In the Geometry toolbar, click Transforms and choose Array.

    model.component("comp1").geom("geom1").run("arr1");
    model.component("comp1").geom("geom1").create("arr2", "Array");

//    Select the objects mir1(1), mir1(2), mir1(4).

    model.component("comp1").geom("geom1").feature("arr2").selection("input").set("mir1(1)", "mir1(2)", "mir1(4)");

//    In the Settings window for Array, locate the Size section.
//    In the z size text field, type n-1.

    model.component("comp1").geom("geom1").feature("arr2").set("fullsize", new String[]{"1", "1", "n-1"});

//    Locate the Displacement section.
//    In the z text field, type 2*height.

    model.component("comp1").geom("geom1").feature("arr2").set("displ", new String[]{"0", "0", "2*height"});

//    In the Geometry toolbar, click Build All.

    model.component("comp1").geom("geom1").run("fin");

//    Click the Go to Default View button in the Graphics toolbar.
//    Create selections for vertical and transversal edges to make further modeling easier.
//    In the Definitions toolbar, click Explicit.

    model.component("comp1").selection().create("sel1", "Explicit");

//    In the Settings window for Explicit, type Vertical Edges in the Label text field.

    model.component("comp1").selection("sel1").label("Vertical Edges");

//    Locate the Input Entities section.
//    From the Geometric entity level list, select Edge.

    model.component("comp1").selection("sel1").geom(1);

//    Select Edges 1, 108, 176, 234.

    model.component("comp1").selection("sel1").set(1, 108, 176, 234);

//    Select the Group by continuous tangent checkbox.

    model.component("comp1").selection("sel1").set("groupcontang", true);

//    In the Definitions toolbar, click Complement.

    model.component("comp1").selection().create("com1", "Complement");

//    In the Settings window for Complement, type Transversal Edges in the Label text field.

    model.component("comp1").selection("com1").label("Transversal Edges");

//    Locate the Geometric Entity Level section.
//    From the Level list, select Edge.

    model.component("comp1").selection("com1").set("entitydim", 1);

//    Locate the Input Entities section.
//    Under Selections to invert, click Add.
//    In the Add dialog, select Vertical Edges in the Selections to invert list.
//    Click OK.

    model.component("comp1").selection("com1").set("input", new String[]{"sel1"});

//    In the Materials toolbar, click Add Material to open the Add Material window.
//    In the tree, select Built-in > Structural steel.
//    Click Add to Component in the window toolbar.

    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");

//    In the Materials toolbar, click Add Material to close the Add Material window.
//    In the Settings window for Cross-Section Data, locate the Cross-Section Definition section.
//    From the Section type list, select Pipe.

    model.component("comp1").physics("truss").feature("csd1").set("SectionType", "PipeSection");

//    In the \[d_\textrm{o}\] text field, type do1.

    model.component("comp1").physics("truss").feature("csd1").set("do_pipe", "do1");

//    In the \[d_\textrm{i}\] text field, type di1.

    model.component("comp1").physics("truss").feature("csd1").set("di_pipe", "di1");

//    In the Physics toolbar, click Edges and choose Cross-Section Data.

    model.component("comp1").physics("truss").create("csd2", "CrossSectionTruss", 1);

//    In the Settings window for Cross-Section Data, locate the Edge Selection section.
//    From the Selection list, select Transversal Edges.

    model.component("comp1").physics("truss").feature("csd2").selection().named("com1");

//    Locate the Cross-Section Definition section.
//    From the Section type list, select Pipe.

    model.component("comp1").physics("truss").feature("csd2").set("SectionType", "PipeSection");

//    In the \[d_\textrm{o}\] text field, type do2.

    model.component("comp1").physics("truss").feature("csd2").set("do_pipe", "do2");

//    In the \[d_\textrm{i}\] text field, type di2.

    model.component("comp1").physics("truss").feature("csd2").set("di_pipe", "di2");

//    In the Physics toolbar, click Points and choose Pinned.

    model.component("comp1").physics("truss").create("pin1", "Pinned", 0);

//    In the Settings window for Pinned, locate the Point Selection section.
//    Click Paste Selection.
//    In the Paste Selection dialog, type 1 21 41 61 in the Selection text field.
//    Click OK.

    model.component("comp1").physics("truss").feature("pin1").selection().set(1, 21, 41, 61);

//    In the Physics toolbar, click Points and choose Point Load.

    model.component("comp1").physics("truss").create("pl1", "PointLoad", 0);

//    In the Settings window for Point Load, locate the Point Selection section.
//    Click Paste Selection.
//    In the Paste Selection dialog, type 20 40 60 80 in the Selection text field.
//    Click OK.

    model.component("comp1").physics("truss").feature("pl1").selection().set(20, 40, 60, 80);

//    In the Settings window for Point Load, locate the Force section.
//    From the Load type list, select Total force.

    model.component("comp1").physics("truss").feature("pl1").set("forceType", "TotalForce");

//    Specify the \[\mathbf{F}_{\mathrm{tot}}\] vector as

    model.component("comp1").physics("truss").feature("pl1").set("force", new String[]{"0", "0", "-load"});

//    In the Model Builder window, under Study 1, click Step 2: Linear Buckling.
//    In the Settings window for Linear Buckling, locate the Study Settings section.
//    In the Desired number of buckling modes text field, type 2.

    model.study("std1").feature("buckling").set("neigs", 2);

//    In the Study toolbar, click Compute.

    model.study("std1").createAutoSequences("all");

    model.sol("sol1").runAll();

    model.result().dataset("dset1").set("frametype", "spatial");
    model.result().create("pg1", "PlotGroup3D");
    model.result("pg1").set("data", "dset1");
    model.result("pg1").setIndex("looplevel", 1, 0);
    model.result("pg1").set("frametype", "spatial");
    model.result("pg1").set("showlegends", false);
    model.result("pg1").create("line1", "Line");
    model.result("pg1").feature("line1").set("expr", new String[]{"truss.disp"});
    model.result("pg1").feature("line1").set("threshold", "manual");
    model.result("pg1").feature("line1").set("thresholdvalue", 0.2);
    model.result("pg1").feature("line1").set("colortable", "Rainbow");
    model.result("pg1").feature("line1").set("colortabletrans", "none");
    model.result("pg1").feature("line1").set("colorscalemode", "linear");
    model.result("pg1").label("Mode Shape (truss)");
    model.result("pg1").feature("line1").set("colortable", "AuroraBorealis");
    model.result("pg1").feature("line1").set("linetype", "tube");
    model.result("pg1").feature("line1").set("radiusexpr", "truss.re");
    model.result("pg1").feature("line1").set("resolution", "extrafine");
    model.result("pg1").feature("line1").set("smooth", "internal");
    model.result("pg1").feature("line1").set("tuberadiusscaleactive", true);
    model.result("pg1").feature("line1").set("tuberadiusscale", 1);
    model.result("pg1").feature("line1").set("tubeendcaps", false);
    model.result("pg1").feature("line1").create("def", "Deform");
    model.result("pg1").feature("line1").feature("def").set("expr", new String[]{"u", "v", "w"});
    model.result("pg1").feature("line1").feature("def").set("descr", "Displacement field");
    model.result("pg1").run();
    model.result("pg1").run();

//    In the Model Builder window, expand the Mode Shape (truss) node, then click Line 1.
//    In the Settings window for Line, click to expand the Title section.
//    From the Title type list, select None.

    model.result("pg1").feature("line1").set("titletype", "none");

//    Locate the Coloring and Style section.
//    In the Radius scale factor text field, type 4.

    return model;
  }

  public static Model run2(Model model) {

    model.result("pg1").feature("line1").set("tuberadiusscale", 4);

//    Click the Show Grid button in the Graphics toolbar.

    model.component("comp1").view("view1").set("showgrid", false);

//    In the Mode Shape (truss) toolbar, click Plot.

    model.result("pg1").run();

//    Create a new plot to check that local buckling of truss members occurs at higher load than the global buckling.
//    In the Results toolbar, click 3D Plot Group.

    model.result().create("pg2", "PlotGroup3D");
    model.result("pg2").run();

//    In the Settings window for 3D Plot Group, type Local Buckling in the Label text field.

    model.result("pg2").label("Local Buckling");

//    Locate the Data section.
//    From the Dataset list, select Study 1/Solution Store 1 (sol2).

    model.result("pg2").set("data", "dset2");

//    Right-click Local Buckling and choose Line.

    model.result("pg2").create("line1", "Line");
    model.result("pg2").feature("line1").set("evaluationsettings", "parent");

//    In the Settings window for Line, click Replace Expression in the upper-right corner of the Expression section.
//    From the menu, choose Component 1 (comp1) > Truss > Safety > Local buckling > truss.lbf_i - Local buckling failure index - 1.

    model.result("pg2").feature("line1").set("expr", "truss.lbf_i");
    model.result("pg2").feature("line1").set("descr", "Local buckling failure index");

//    Locate the Coloring and Style section.
//    Clear the Color legend checkbox.

    model.result("pg2").feature("line1").set("colorlegend", false);

//    Click to expand the Quality section.
//    From the Evaluation settings list, select Manual.

    model.result("pg2").feature("line1").set("evaluationsettings", "manual");

//    From the Smoothing list, select None.

    model.result("pg2").feature("line1").set("smooth", "none");

//    Locate the Coloring and Style section.
//    From the Line type list, select Tube.

    model.result("pg2").feature("line1").set("linetype", "tube");

//    In the Tube radius expression text field, type truss.re.

    model.result("pg2").feature("line1").set("radiusexpr", "truss.re");

//    Select the Radius scale factor checkbox.

    model.result("pg2").feature("line1").set("tuberadiusscaleactive", true);

//    In the associated text field, type 2.

    model.result("pg2").feature("line1").set("tuberadiusscale", 2);
    model.result("pg2").run();

//    In the Model Builder window, click Local Buckling.
//    In the Local Buckling toolbar, click More Plots and choose Max/Min Line.

    model.result("pg2").create("mml1", "MaxMinLine");

//    In the Settings window for Max/Min Line, click Replace Expression in the upper-right corner of the Expression section.
//    From the menu, choose Component 1 (comp1) > Truss > Safety > Local buckling > truss.lbs_f - Local buckling safety factor - 1.

    model.result("pg2").feature("mml1").set("expr", "truss.lbs_f");
    model.result("pg2").feature("mml1").set("descr", "Local buckling safety factor");

//    Locate the Display section.
//    From the Display list, select Min.

    model.result("pg2").feature("mml1").set("display", "min");

//    Locate the Text Format section.
//    In the Prefix text field, type Safety factor .

    model.result("pg2").feature("mml1").set("labelprefix", "Safety factor ");

//    In the Local Buckling toolbar, click Plot.

    model.result("pg2").run();

//    Now prescribe a deformation to the geometry from the calculated buckling mode to perform a postbuckling study.
//    In the Definitions toolbar, click Physics Utilities and choose Buckling Imperfection.

    model.component("comp1").common().create("bcki1", "BucklingImperfection");

//    In the Settings window for Buckling Imperfection, locate the Deformed Geometry section.
//    Find the Mode selection subsection.
//    In the table, enter the following settings:

    model.component("comp1").common("bcki1").setIndex("ModesScales", "1e3", 0, 1);

//    Click Configure in the upper-right corner of the Deformed Geometry section.

    model.component("comp1").common().create("pres_truss", "PrescribedDeformationDeformedGeometry");
    model.component("comp1").common("pres_truss").label("Prescribed Deformation, Truss");
    model.component("comp1").common("pres_truss").selection().geom(1);
    model.component("comp1").common("pres_truss").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, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252);
    model.component("comp1").common("pres_truss")
         .set("prescribedDeformation", new String[]{"bcki1.dtrussX", "bcki1.dtrussY", "bcki1.dtrussZ"});

    model.study("std1").feature("stat").set("useadvanceddisable", true);
    model.study("std1").feature("stat").set("disabledcommon", new String[]{"pres_truss"});
    model.study("std1").feature("buckling").set("useadvanceddisable", true);
    model.study("std1").feature("buckling").set("disabledcommon", new String[]{"pres_truss"});

//    This button creates a <l>Prescribed Deformation</l> node with the requested deformation settings. The newly created <l>Prescribed Deformation</l> is automatically disabled in the existing study steps to enable further computation without changes in the results.
//    Locate the Nonlinear Buckling Study section.
//    From the Load parameter list, select load.
//    Click Configure in the upper-right corner of the Nonlinear Buckling Study section.

    model.study().create("std2");
    model.study("std2").create("stat1", "Stationary");
    model.study("std2").feature("stat1").set("geometricNonlinearity", true);
    model.study("std2").feature("stat1").set("useparam", true);
    model.study("std2").feature("stat1").set("pname", new String[]{});
    model.study("std2").feature("stat1").set("plistarr", new int[]{});
    model.study("std2").feature("stat1").set("punit", new String[]{});
    model.study("std2").feature("stat1").setIndex("pname", "load", 0);
    model.study("std2").feature("stat1").setIndex("plistarr", "84820.20304008543*log(range(1,1,20))/log(15)", 0);
    model.study("std2").feature("stat1").setIndex("punit", "N", 0);

    model.component("comp1").common("bcki1").set("NonlinearBucklingStudy", "std2");

//    This button creates a new study with stationary step, activates geometric nonlinearities and applies an auxiliary sweep for the postbuckling study.
//    In the Model Builder window, expand the Component 1 (comp1) > Deformed Geometry node.
//    Right-click Study 2 and choose Show Default Solver.

    model.study("std2").showAutoSequences("all");

//    In the Model Builder window, expand the Solution 3 (sol3) node.
//    In the Model Builder window, expand the Study 2 > Solver Configurations > Solution 3 (sol3) > 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("sol3").feature("s1").feature("fc1").set("dtech", "const");

//    In the Study toolbar, click Compute.

    model.study("std2").createAutoSequences("all");

    model.sol("sol3").runAll();

    model.result().create("pg3", "PlotGroup3D");
    model.result("pg3").set("data", "dset3");
    model.result("pg3").setIndex("looplevel", 20, 0);
    model.result("pg3").set("frametype", "spatial");
    model.result("pg3").create("line1", "Line");
    model.result("pg3").feature("line1").set("expr", new String[]{"truss.misesGp"});
    model.result("pg3").feature("line1").set("threshold", "manual");
    model.result("pg3").feature("line1").set("thresholdvalue", 0.2);
    model.result("pg3").feature("line1").set("colortable", "Rainbow");
    model.result("pg3").feature("line1").set("colortabletrans", "none");
    model.result("pg3").feature("line1").set("colorscalemode", "linear");
    model.result("pg3").label("Stress (truss)");
    model.result("pg3").feature("line1").set("colortable", "Rainbow");
    model.result("pg3").feature("line1").set("linetype", "tube");
    model.result("pg3").feature("line1").set("radiusexpr", "truss.re");
    model.result("pg3").feature("line1").set("resolution", "extrafine");
    model.result("pg3").feature("line1").set("smooth", "internal");
    model.result("pg3").feature("line1").set("tuberadiusscaleactive", true);
    model.result("pg3").feature("line1").set("tuberadiusscale", 1);
    model.result("pg3").feature("line1").set("tubeendcaps", false);
    model.result("pg3").feature("line1").create("def", "Deform");
    model.result("pg3").feature("line1").feature("def").set("scaleactive", true);
    model.result("pg3").feature("line1").feature("def").set("scale", "1");
    model.result("pg3").feature("line1").feature("def").set("expr", new String[]{"u", "v", "w"});
    model.result("pg3").feature("line1").feature("def").set("descr", "Displacement field");
    model.result().create("pg4", "PlotGroup3D");
    model.result("pg4").set("data", "dset3");
    model.result("pg4").setIndex("looplevel", 20, 0);
    model.result("pg4").label("Deformed Geometry");
    model.result("pg4").create("mesh1", "Mesh");
    model.result("pg4").feature("mesh1").set("meshdomain", "line");
    model.result("pg4").feature("mesh1").set("colortable", "TrafficFlow");
    model.result("pg4").feature("mesh1").set("colortabletrans", "nonlinear");
    model.result("pg4").feature("mesh1").set("nonlinearcolortablerev", true);
    model.result("pg4").feature("mesh1").create("sel1", "MeshSelection");
    model.result("pg4").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, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252);
    model.result("pg4").feature("mesh1").set("qualmeasure", "custom");
    model.result("pg4").feature("mesh1").set("qualexpr", "comp1.material.relVol");
    model.result("pg4").feature("mesh1").set("colorrangeunitinterval", false);
    model.result("pg3").run();

//    In the Settings window for 3D Plot Group, locate the Data section.
//    From the Parameter value (load (N)) list, select 84820.

    model.result("pg3").setIndex("looplevel", 15, 0);
    model.result("pg3").run();

//    In the Model Builder window, expand the Stress (truss) node, then click Line 1.
//    In the Settings window for Line, locate the Expression section.
//    From the Unit list, select MPa.

    model.result("pg3").feature("line1").set("unit", "MPa");

//    Locate the Coloring and Style section.
//    In the Radius scale factor text field, type 4.

    model.result("pg3").feature("line1").set("tuberadiusscale", 4);

//    In the Stress (truss) toolbar, click Plot.

    model.result("pg3").run();

//    In the Results toolbar, click Result Templates to open the Result Templates window.
//    In the tree, select Study 2/Solution 3 (sol3) > Truss > Force (truss).
//    Click Add Result Template in the window toolbar.

    model.result().create("pg5", "PlotGroup3D");
    model.result("pg5").set("data", "dset3");
    model.result("pg5").setIndex("looplevel", 20, 0);
    model.result("pg5").set("frametype", "spatial");
    model.result("pg5").create("line1", "Line");
    model.result("pg5").feature("line1").set("expr", new String[]{"truss.Nxl"});
    model.result("pg5").feature("line1").set("threshold", "manual");
    model.result("pg5").feature("line1").set("thresholdvalue", 0.2);
    model.result("pg5").feature("line1").set("colortable", "Wave");
    model.result("pg5").feature("line1").set("colortabletrans", "none");
    model.result("pg5").feature("line1").set("colorscalemode", "linearsymmetric");
    model.result("pg5").feature("line1").set("linetype", "tube");
    model.result("pg5").feature("line1").set("radiusexpr", "truss.re");
    model.result("pg5").feature("line1").set("resolution", "extrafine");
    model.result("pg5").feature("line1").set("smooth", "internal");
    model.result("pg5").feature("line1").set("tuberadiusscaleactive", true);
    model.result("pg5").feature("line1").set("tuberadiusscale", 1);
    model.result("pg5").feature("line1").set("tubeendcaps", false);
    model.result("pg5").feature("line1").create("def", "Deform");
    model.result("pg5").feature("line1").feature("def").set("scaleactive", true);
    model.result("pg5").feature("line1").feature("def").set("scale", "1");
    model.result("pg5").feature("line1").feature("def").set("expr", new String[]{"u", "v", "w"});
    model.result("pg5").feature("line1").feature("def").set("descr", "Displacement field");
    model.result("pg5").label("Force (truss)");
    model.result("pg5").label("Force (truss)");
    model.result("pg5").run();

//    In the Results toolbar, click Result Templates to close the Result Templates window.
//    In the Settings window for 3D Plot Group, locate the Data section.
//    From the Parameter value (load (N)) list, select 84820.

    model.result("pg5").setIndex("looplevel", 15, 0);
    model.result("pg5").run();

//    In the Model Builder window, expand the Force (truss) node, then click Line 1.
//    In the Settings window for Line, locate the Coloring and Style section.
//    In the Radius scale factor text field, type 4.

    model.result("pg5").feature("line1").set("tuberadiusscale", 4);

//    In the Force (truss) toolbar, click Plot.

    model.result("pg5").run();

//    Create a new plot to show the displacement with respect to applied load.
//    In the Results toolbar, click 1D Plot Group.

    model.result().create("pg6", "PlotGroup1D");
    model.result("pg6").run();

//    In the Settings window for 1D Plot Group, locate the Data section.
//    From the Dataset list, select Study 2/Solution 3 (sol3).

    model.result("pg6").set("data", "dset3");

//    In the Label text field, type Post Buckling Displacement.

    model.result("pg6").label("Post Buckling Displacement");

//    Right-click Post Buckling Displacement and choose Point Graph.

    model.result("pg6").create("ptgr1", "PointGraph");
    model.result("pg6").feature("ptgr1").set("markerpos", "datapoints");
    model.result("pg6").feature("ptgr1").set("linewidth", "preference");

//    Select Point 20.

    model.result("pg6").feature("ptgr1").selection().set(20);

//    In the Settings window for Point Graph, locate the y-Axis Data section.
//    In the Expression text field, type v.

    model.result("pg6").feature("ptgr1").set("expr", "v");

//    Click to expand the Coloring and Style section.
//    Find the Line markers subsection.
//    From the Marker list, select Point.

    model.result("pg6").feature("ptgr1").set("linemarker", "point");

//    In the Post Buckling Displacement toolbar, click Plot.

    model.result("pg6").run();
    model.result("pg6").run();

//    In the Model Builder window, right-click Post Buckling Displacement and choose Duplicate.

    model.result().duplicate("pg7", "pg6");
    model.result("pg7").run();

//    In the Settings window for 1D Plot Group, type Post Buckling Stress in the Label text field.

    model.result("pg7").label("Post Buckling Stress");
    model.result("pg7").run();

//    In the Model Builder window, expand the Post Buckling Stress node, then click Point Graph 1.
//    In the Settings window for Point Graph, locate the Selection section.
//    Click Clear Selection.

    model.result("pg7").feature("ptgr1").selection().set();

//    Select Point 1.

    model.result("pg7").feature("ptgr1").selection().set(1);

//    Click Replace Expression in the upper-right corner of the y-Axis Data section.
//    From the menu, choose Component 1 (comp1) > Truss > Stress > truss.misesGp - von Mises stress - N/m².

    model.result("pg7").feature("ptgr1").set("expr", "truss.misesGp");
    model.result("pg7").feature("ptgr1").set("descr", "von Mises stress");

//    Locate the y-Axis Data section.
//    From the Unit list, select MPa.

    model.result("pg7").feature("ptgr1").set("unit", "MPa");

//    In the Post Buckling Stress toolbar, click Plot.

    model.result("pg7").run();
    model.result("pg1").run();
    model.result("pg1").stepNext(0);
    model.result("pg1").run();

    model.title("Buckling Analysis of a Truss Tower");

    model
         .description("This example first shows how to compute the critical buckling load of a truss tower using a linear buckling analysis. The Truss interface is used to model the tower. The solution is compared with an analytical estimate of the critical load obtained from Euler buckling.\n\nIn a second step, a nonlinear buckling analysis based on geometry imperfections from the previous study is performed.");

    return model;
  }

  public static void main(String[] args) {
    Model model = run();
    run2(model);
  }

}
