/*
 * falling_magnet.java
 */

import com.comsol.model.*;
import com.comsol.model.util.*;

/** Model exported on May 15 2026, 13:29 by COMSOL 6.4.0.421. */
public class falling_magnet {

  public static Model run() {
    Model model = ModelUtil.create("Model");

//    From the File menu, choose New.
//    In the New window, click Model Wizard.
//    In the Model Wizard window, click 2D Axisymmetric.
//    In the Select Physics tree, select AC/DC > Electromagnetic Fields > Magnetic Fields (mf).
//    Click Add.
//    In the Select Physics tree, select Mathematics > ODE and DAE Interfaces > Global ODEs and DAEs (ge).
//    Click Add.
//    Click Study.
//    In the Select Study tree, select General Studies > Stationary.
//    Click Done.

    model.component().create("comp1", true);

    model.component("comp1").geom().create("geom1", 2);
    model.component("comp1").geom("geom1").axisymmetric(true);

    model.component("comp1").mesh().create("mesh1");

    model.component("comp1").physics().create("mf", "InductionCurrents", "geom1");
    model.component("comp1").physics().create("ge", "GlobalEquations", "geom1");
    model.component("comp1").physics("ge").prop("EquationForm").set("form", "Automatic");

    model.study().create("std1");
    model.study("std1").create("stat", "Stationary");

//    Define all the required parameters.
//    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("mr", "5[mm]");
    model.param().descr("mr", "Magnet radius");
    model.param().set("mh", "10[mm]");
    model.param().descr("mh", "Magnet height");
    model.param().set("r_i", "6[mm]");
    model.param().descr("r_i", "Tube inner radius");
    model.param().set("r_o", "8[mm]");
    model.param().descr("r_o", "Tube outer radius");
    model.param().set("dm", "7.4[g/(cm)^3]");
    model.param().descr("dm", "Density of magnet");

//    In the Model Builder window, under Component 1 (comp1), click Geometry 1.
//    In the Settings window for Geometry, locate the Units section.
//    From the Length unit list, select mm.

    model.component("comp1").geom("geom1").lengthUnit("mm");

//    Use the following instructions to construct the model geometry. First, create the magnet.
//    In the Geometry toolbar, click Rectangle.

    model.component("comp1").geom("geom1").create("r1", "Rectangle");

//    In the Settings window for Rectangle, locate the Size and Shape section.
//    In the Width text field, type mr.

    model.component("comp1").geom("geom1").feature("r1").set("size", new String[]{"mr", "1"});

//    In the Height text field, type mh.

    model.component("comp1").geom("geom1").feature("r1").set("size", new String[]{"mr", "mh"});

//    Locate the Position section.
//    In the z text field, type -mh/2.

    model.component("comp1").geom("geom1").feature("r1").set("pos", new String[]{"0", "-mh/2"});

//    Click Build Selected.

    model.component("comp1").geom("geom1").run("r1");

//    In the Geometry toolbar, click Fillet.

    model.component("comp1").geom("geom1").create("fil1", "Fillet");

//    On the object r1, select Points 2, 3.

    model.component("comp1").geom("geom1").feature("fil1").selection("pointinsketch").set("r1", 2, 3);

//    In the Settings window for Fillet, locate the Radius section.
//    In the Radius text field, type 1.

    model.component("comp1").geom("geom1").feature("fil1").set("radius", 1);

//    Click Build Selected.

    model.component("comp1").geom("geom1").run("fil1");

//    Create the geometry of the copper tube.
//    In the Geometry toolbar, click Rectangle.

    model.component("comp1").geom("geom1").create("r2", "Rectangle");

//    In the Settings window for Rectangle, locate the Size and Shape section.
//    In the Width text field, type r_o-r_i.

    model.component("comp1").geom("geom1").feature("r2").set("size", new String[]{"r_o-r_i", "1"});

//    In the Height text field, type 100.

    model.component("comp1").geom("geom1").feature("r2").set("size", new String[]{"r_o-r_i", "100"});

//    Locate the Position section.
//    In the r text field, type r_i.

    model.component("comp1").geom("geom1").feature("r2").set("pos", new String[]{"r_i", "0"});

//    In the z text field, type -50.

    model.component("comp1").geom("geom1").feature("r2").set("pos", new String[]{"r_i", "-50"});

//    Click Build Selected.

    model.component("comp1").geom("geom1").run("r2");

//    Click the Zoom Extents button in the Graphics toolbar.
//    In the Geometry toolbar, click Rectangle.

    model.component("comp1").geom("geom1").create("r3", "Rectangle");

//    In the Settings window for Rectangle, locate the Size and Shape section.
//    In the Width text field, type r_o-r_i.

    model.component("comp1").geom("geom1").feature("r3").set("size", new String[]{"r_o-r_i", "1"});

//    In the Height text field, type 40.

    model.component("comp1").geom("geom1").feature("r3").set("size", new String[]{"r_o-r_i", "40"});

//    Locate the Position section.
//    In the r text field, type r_i.

    model.component("comp1").geom("geom1").feature("r3").set("pos", new String[]{"r_i", "0"});

//    In the z text field, type -20.

    model.component("comp1").geom("geom1").feature("r3").set("pos", new String[]{"r_i", "-20"});

//    Click Build Selected.

    model.component("comp1").geom("geom1").run("r3");

//    Finish the geometry by creating the outer boundary.
//    In the Geometry toolbar, click Rectangle.

    model.component("comp1").geom("geom1").create("r4", "Rectangle");

//    In the Settings window for Rectangle, locate the Size and Shape section.
//    In the Width text field, type 30.

    model.component("comp1").geom("geom1").feature("r4").set("size", new double[]{30, 1});

//    In the Height text field, type 100.

    model.component("comp1").geom("geom1").feature("r4").set("size", new double[]{30, 100});

//    Locate the Position section.
//    In the z text field, type -50.

    model.component("comp1").geom("geom1").feature("r4").set("pos", new double[]{0, -50});

//    Click to expand the Layers section.
//    Select the Layers to the right checkbox.

    model.component("comp1").geom("geom1").feature("r4").set("layerright", true);

//    Clear the Layers on bottom checkbox.

    model.component("comp1").geom("geom1").feature("r4").set("layerbottom", false);

//    In the table, enter the following settings:

    model.component("comp1").geom("geom1").feature("r4").setIndex("layer", 10, 0);

//    Click Build Selected.

    model.component("comp1").geom("geom1").run("r4");

//    In the Model Builder window, click Form Union (fin).
//    In the Settings window for Form Union/Assembly, click Build Selected.

    model.component("comp1").geom("geom1").run("fin");

//    Define domain selections for the magnet and the copper tube before setting up the physics. First, create a selection for the magnet domain.
//    In the Definitions toolbar, click Explicit.

    model.component("comp1").selection().create("sel1", "Explicit");

//    Select Domain 2.

    model.component("comp1").selection("sel1").set(2);

//    In the Settings window for Explicit, type Magnet in the Label text field.

    model.component("comp1").selection("sel1").label("Magnet");

//    Add a selection for the copper tube domain.
//    In the Definitions toolbar, click Explicit.

    model.component("comp1").selection().create("sel2", "Explicit");

//    Select Domains 3, 4, 5.

    model.component("comp1").selection("sel2").set(3, 4, 5);

//    In the Settings window for Explicit, type Copper Tube in the Label text field.

    model.component("comp1").selection("sel2").label("Copper Tube");

//    Define an integration variable for the magnet domain.
//    In the Definitions toolbar, click Nonlocal Couplings and choose Integration.

    model.component("comp1").cpl().create("intop1", "Integration");
    model.component("comp1").cpl("intop1").set("axisym", true);

//    In the Settings window for Integration, type intmag in the Operator name text field.

    model.component("comp1").cpl("intop1").set("opname", "intmag");

//    Locate the Source Selection section.
//    From the Selection list, select Magnet.

    model.component("comp1").cpl("intop1").selection().named("sel1");

//    Locate the Advanced section.
//    Clear the Compute integral in revolved geometry checkbox.

    model.component("comp1").cpl("intop1").set("axisym", false);

//    In the Label text field, type Integration over Magnet.

    model.component("comp1").cpl("intop1").label("Integration over Magnet");

//    Add variables for the mass and the gravitational force of the magnet.
//    In the Definitions toolbar, click Local Variables.

    model.component("comp1").variable().create("var1");

//    In the Settings window for Variables, locate the Variables section.
//    In the table, enter the following settings:

    model.component("comp1").variable("var1").set("m", "intmag(2*pi*r*dm)");
    model.component("comp1").variable("var1").descr("m", "Mass of the magnet");
    model.component("comp1").variable("var1").set("Fg", "m*g_const");
    model.component("comp1").variable("var1").descr("Fg", "Gravitational force on the magnet");

//    Here, <c>g_const</c> is a predefined constant for the acceleration of gravity near the surface of the Earth.
//    Add a nonlocal integration coupling to integrate on the tube domain.
//    In the Definitions toolbar, click Nonlocal Couplings and choose Integration.

    model.component("comp1").cpl().create("intop2", "Integration");
    model.component("comp1").cpl("intop2").set("axisym", true);

//    In the Settings window for Integration, type inttube in the Operator name text field.

    model.component("comp1").cpl("intop2").set("opname", "inttube");

//    Locate the Source Selection section.
//    From the Selection list, select Copper Tube.

    model.component("comp1").cpl("intop2").selection().named("sel2");

//    Locate the Advanced section.
//    Clear the Compute integral in revolved geometry checkbox.

    model.component("comp1").cpl("intop2").set("axisym", false);

//    In the Label text field, type Integration over Tube.

    model.component("comp1").cpl("intop2").label("Integration over Tube");

//    Define a variable for the Lorentz force and acceleration of the magnet.
//    In the Definitions toolbar, click Local Variables.

    model.component("comp1").variable().create("var2");

//    In the Settings window for Variables, locate the Variables section.
//    In the table, enter the following settings:

    model.component("comp1").variable("var2").set("Fz", "inttube(-mf.FLtzz*2*pi*r)");
    model.component("comp1").variable("var2").descr("Fz", "Lorentz force in z direction");
    model.component("comp1").variable("var2").set("a", "(Fg-Fz)/m");
    model.component("comp1").variable("var2").descr("a", "Magnet acceleration");

//    Here, the <c>mf.</c> prefix identifies variables defined by the <l>Magnetic Fields</l> interface.
//    In the Definitions toolbar, click Infinite Element Domain.

    model.component("comp1").coordSystem().create("ie1", "InfiniteElement");

//    Select Domain 7.

    model.component("comp1").coordSystem("ie1").selection().set(7);

//    In the Settings window for Infinite Element Domain, locate the Geometry section.
//    From the Type list, select Cylindrical.

    model.component("comp1").coordSystem("ie1").set("ScalingType", "Cylindrical");

//    In the Model Builder window, under Component 1 (comp1) > Global ODEs and DAEs (ge), click Global Equations 1 (ODE1).
//    In the Settings window for Global Equations, locate the Global Equations section.
//    In the table, enter the following settings:

    model.component("comp1").physics("ge").feature("ge1").setIndex("name", "v", 0, 0);
    model.component("comp1").physics("ge").feature("ge1").setIndex("equation", "d(v,t)-(Fg-Fz)/m", 0, 0);
    model.component("comp1").physics("ge").feature("ge1").setIndex("description", "Magnet velocity", 0, 0);

//    Locate the Units section.
//    Click Select Dependent Variable Quantity.
//    In the Physical Quantity dialog, type velocity in the text field.
//    In the tree, select General > Velocity (m/s).
//    Click OK.

    model.component("comp1").physics("ge").feature("ge1").set("DependentVariableQuantity", "velocity");

//    In the Settings window for Global Equations, locate the Units section.
//    Click Select Source Term Quantity.
//    In the Physical Quantity dialog, type acceleration in the text field.
//    In the tree, select General > Acceleration (m/s^2).
//    Click OK.

    model.component("comp1").physics("ge").feature("ge1").set("SourceTermQuantity", "acceleration");

//    Now, set up the physics for the magnetic field. Apply <l>Ampère's Law</l> in the magnet and copper tube.
//    In the Model Builder window, under Component 1 (comp1), click Magnetic Fields (mf).
//    In the Physics toolbar, click Domains and choose Ampère's Law in Solids.

    model.component("comp1").physics("mf").create("als1", "AmperesLawSolid", 2);

//    In the Settings window for Ampère's Law in Solids, type Ampère's Law - Magnet in the Label text field.

    model.component("comp1").physics("mf").feature("als1").label("Amp\u00e8re's Law - Magnet");

//    Locate the Domain Selection section.
//    From the Selection list, select Magnet.

    model.component("comp1").physics("mf").feature("als1").selection().named("sel1");

//    Locate the Constitutive Relation B-H section.
//    From the Magnetization model list, select Remanent flux density.

    model.component("comp1").physics("mf").feature("als1").set("ConstitutiveRelationBH", "RemanentFluxDensity");

//    Specify the \[\mathbf{e}\] vector as

    model.component("comp1").physics("mf").feature("als1").set("e_crel_BH_RemanentFluxDensity", new int[]{0, 0, 1});

//    In the Physics toolbar, click Domains and choose Ampère's Law in Solids.

    model.component("comp1").physics("mf").create("als2", "AmperesLawSolid", 2);

//    In the Settings window for Ampère's Law in Solids, type Ampère's Law - Copper Tube in the Label text field.

    model.component("comp1").physics("mf").feature("als2").label("Amp\u00e8re's Law - Copper Tube");

//    Locate the Domain Selection section.
//    From the Selection list, select Copper Tube.

    model.component("comp1").physics("mf").feature("als2").selection().named("sel2");

//    Specify the velocity for the copper tube domain using a Lorentz term.
//    In the Physics toolbar, click Domains and choose Velocity (Lorentz Term).

    model.component("comp1").physics("mf").create("vlt1", "Velocity", 2);

//    In the Settings window for Velocity (Lorentz Term), locate the Domain Selection section.
//    From the Selection list, select Copper Tube.

    model.component("comp1").physics("mf").feature("vlt1").selection().named("sel2");

//    Locate the Velocity (Lorentz Term) section.
//    Specify the \[\mathbf{v}\] vector as

    model.component("comp1").physics("mf").feature("vlt1").set("v", new String[]{"0", "0", "v"});

//    In the Physics toolbar, click Boundaries and choose Perfect Magnetic Conductor.

    model.component("comp1").physics("mf").create("pmc1", "PerfectMagneticConductor", 1);

//    Select Boundaries 2, 7, 10, 15, 17, 20, 22, 23, 24.

    model.component("comp1").physics("mf").feature("pmc1").selection().set(2, 7, 10, 15, 17, 20, 22, 23, 24);

//    Next, set the materials for the magnet and the copper tube.
//    In the Materials toolbar, click Add Material to open the Add Material window.
//    In the tree, select AC/DC > Copper.
//    Right-click and choose Add to Component 1 (comp1).

    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().create("linzRes", "linzRes", "Linearized resistivity");
    model.component("comp1").material("mat1").label("Copper");
    model.component("comp1").material("mat1").set("family", "copper");
    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("electricconductivity", new String[]{"5.998e7[S/m]", "0", "0", "0", "5.998e7[S/m]", "0", "0", "0", "5.998e7[S/m]"});
    model.component("comp1").material("mat1").propertyGroup("def").set("heatcapacity", "385[J/(kg*K)]");
    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("emissivity", "0.5");
    model.component("comp1").material("mat1").propertyGroup("def").set("density", "8940[kg/m^3]");
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("thermalconductivity", new String[]{"400[W/(m*K)]", "0", "0", "0", "400[W/(m*K)]", "0", "0", "0", "400[W/(m*K)]"});
    model.component("comp1").material("mat1").propertyGroup("Enu").set("E", "126e9[Pa]");
    model.component("comp1").material("mat1").propertyGroup("Enu").set("nu", "0.34");
    model.component("comp1").material("mat1").propertyGroup("linzRes").set("rho0", "1.667e-8[ohm*m]");
    model.component("comp1").material("mat1").propertyGroup("linzRes").set("alpha", "3.862e-3[1/K]");
    model.component("comp1").material("mat1").propertyGroup("linzRes").set("Tref", "293.15[K]");
    model.component("comp1").material("mat1").propertyGroup("linzRes").addInput("temperature");

//    In the tree, select AC/DC > Hard Magnetic Materials > Sintered NdFeB Grades (Chinese Standard) > N50 (Sintered NdFeB).
//    Right-click and choose Add to Component 1 (comp1).

    model.component("comp1").material().create("mat2", "Common");
    model.component("comp1").material("mat2").propertyGroup()
         .create("RemanentFluxDensity", "RemanentFluxDensity", "Remanent flux density");
    model.component("comp1").material("mat2").label("N50 (Sintered NdFeB)");
    model.component("comp1").material("mat2").set("family", "chrome");
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("electricconductivity", new String[]{"1/1.4[uohm*m]", "0", "0", "0", "1/1.4[uohm*m]", "0", "0", "0", "1/1.4[uohm*m]"});
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("relpermittivity", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"});
    model.component("comp1").material("mat2").propertyGroup("RemanentFluxDensity")
         .set("murec", new String[]{"1.05", "0", "0", "0", "1.05", "0", "0", "0", "1.05"});
    model.component("comp1").material("mat2").propertyGroup("RemanentFluxDensity").set("normBr", "1.41[T]");

//    In the Materials toolbar, click Add Material to close the Add Material window.
//    In the Settings window for Material, locate the Geometric Entity Selection section.
//    From the Selection list, select Copper Tube.

    model.component("comp1").material("mat1").selection().named("sel2");

//    In the Model Builder window, click N50 (Sintered NdFeB) (mat2).
//    In the Settings window for Material, locate the Geometric Entity Selection section.
//    From the Selection list, select Magnet.

    model.component("comp1").material("mat2").selection().named("sel1");

//    Let <l>Physics-Controlled Mesh</l> generate a proper mesh which should look like the figure below.
//    In the Model Builder window, right-click Component 1 (comp1) > Mesh 1 and choose Build All.

    model.component("comp1").mesh("mesh1").run();

//    First, set up the <l>Stationary</l> step that computes the vector potential field before the permanent magnet is dropped.
//    In the Model Builder window, click Study 1.
//    In the Settings window for Study, locate the Study Settings section.
//    Clear the Generate default plots checkbox.

    model.study("std1").setGenPlots(false);
    model.study("std1").feature("stat").setSolveFor("/physics/ge", false);

//    In the Model Builder window, under Study 1, click Step 1: Stationary.
//    In the Settings window for Stationary, locate the Physics and Variables Selection section.
//    In the Solve for column of the table, under Component 1 (comp1), clear the checkbox for Global ODEs and DAEs (ge).
//    Now, add a <l>Time Dependent</l> study step and solve the problem in time domain from 0 to 50 milliseconds. The <l>Time Dependent</l> study will automatically use the stationary solution as the initial condition for the vector potential.
//    In the Study toolbar, click Time Dependent.

    model.study("std1").create("time", "Transient");

//    In the Settings window for Time Dependent, locate the Study Settings section.
//    In the Output times text field, type range(0,0.001,0.05).

    model.study("std1").feature("time").set("tlist", "range(0,0.001,0.05)");

//    From the Tolerance list, select User controlled.

    model.study("std1").feature("time").set("usertol", true);

//    In the Relative tolerance text field, type 0.001.

    model.study("std1").feature("time").set("rtol", 0.001);

//    In the Study toolbar, click Compute.

    model.study("std1").createAutoSequences("all");

    model.sol("sol1").runAll();

//    In the Results toolbar, click 2D Plot Group.

    model.result().create("pg1", "PlotGroup2D");
    model.result("pg1").run();

//    In the Settings window for 2D Plot Group, type Magnetic Flux Density in the Label text field.

    model.result("pg1").label("Magnetic Flux Density");

//    Right-click Magnetic Flux Density and choose Surface.

    model.result("pg1").create("surf1", "Surface");
    model.result("pg1").feature("surf1").set("evaluationsettings", "parent");

//    In the Settings window for Surface, locate the Coloring and Style section.
//    From the Color table list, select Prism.

    model.result("pg1").feature("surf1").set("colortable", "Prism");

//    In the Magnetic Flux Density toolbar, click Plot.

    model.result("pg1").run();

//    In the Results toolbar, click 2D Plot Group.

    model.result().create("pg2", "PlotGroup2D");
    model.result("pg2").run();

//    In the Settings window for 2D Plot Group, type Current Density in the Label text field.

    model.result("pg2").label("Current Density");

//    Right-click Current Density and choose Surface.

    model.result("pg2").create("surf1", "Surface");
    model.result("pg2").feature("surf1").set("evaluationsettings", "parent");

//    In the Settings window for Surface, click Replace Expression in the upper-right corner of the Expression section.
//    From the menu, choose Component 1 (comp1) > Magnetic Fields > Currents and charge > Current density - A/m² > mf.Jphi - Current density, phi-component.

    model.result("pg2").feature("surf1").set("expr", "mf.Jphi");
    model.result("pg2").feature("surf1").set("descr", "Current density, phi-component");

//    Locate the Coloring and Style section.
//    From the Color table list, select Dipole.

    model.result("pg2").feature("surf1").set("colortable", "Dipole");

//    In the Current Density toolbar, click Plot.

    model.result("pg2").run();

//    Next, plot the \[z\]-component of the Lorentz force on the magnet.
//    In the Results toolbar, click 1D Plot Group.

    model.result().create("pg3", "PlotGroup1D");
    model.result("pg3").run();

//    In the Settings window for 1D Plot Group, type Lorentz Force, Fz in the Label text field.

    model.result("pg3").label("Lorentz Force, Fz");

//    Right-click Lorentz Force, Fz and choose Global.

    model.result("pg3").create("glob1", "Global");
    model.result("pg3").feature("glob1").set("markerpos", "datapoints");
    model.result("pg3").feature("glob1").set("linewidth", "preference");

//    In the Settings window for Global, click Replace Expression in the upper-right corner of the y-Axis Data section.
//    From the menu, choose Component 1 (comp1) > Definitions > Variables > Fz - Lorentz force in z direction - N.

    model.result("pg3").feature("glob1").set("expr", new String[]{"Fz"});
    model.result("pg3").feature("glob1").set("descr", new String[]{"Lorentz force in z direction"});
    model.result("pg3").feature("glob1").set("unit", new String[]{"N"});

//    In the Lorentz Force, Fz toolbar, click Plot.

    model.result("pg3").run();

//    Click Plot.

    model.result("pg3").run();

//    In the Results toolbar, click 1D Plot Group.

    model.result().create("pg4", "PlotGroup1D");
    model.result("pg4").run();

//    In the Settings window for 1D Plot Group, type Terminal Velocity in the Label text field.

    model.result("pg4").label("Terminal Velocity");

//    Right-click Terminal Velocity and choose Global.

    model.result("pg4").create("glob1", "Global");
    model.result("pg4").feature("glob1").set("markerpos", "datapoints");
    model.result("pg4").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("pg4").feature("glob1").setIndex("unit", "cm/s", 0);

//    In the Terminal Velocity toolbar, click Plot.

    model.result("pg4").run();

//    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 Magnet acceleration in the Label text field.

    model.result("pg5").label("Magnet acceleration");

//    Right-click Magnet acceleration and choose Global.

    model.result("pg5").create("glob1", "Global");
    model.result("pg5").feature("glob1").set("markerpos", "datapoints");
    model.result("pg5").feature("glob1").set("linewidth", "preference");

//    In the Settings window for Global, click Replace Expression in the upper-right corner of the y-Axis Data section.
//    From the menu, choose Component 1 (comp1) > Definitions > Variables > a - Magnet acceleration - m/s².

    model.result("pg5").feature("glob1").set("expr", new String[]{"a"});
    model.result("pg5").feature("glob1").set("descr", new String[]{"Magnet acceleration"});
    model.result("pg5").feature("glob1").set("unit", new String[]{"m/s^2"});

//    In the Magnet acceleration toolbar, click Plot.

    model.result("pg5").run();

    model.title("Magnet Falling Through Copper Tube");

    model
         .description("A cylindrical magnet falling through a copper tube induces eddy currents on the tube walls. The eddy currents, in turn, create a magnetic field that opposes the magnetic field of the magnet and induces a braking force that opposes the motion of the magnet. This opposing force increases with increasing velocity. Thus, there is a terminal velocity at which the magnetic braking force equals the force of gravity. The example computes the velocity of the magnet after it is dropped as it reaches its terminal velocity.");

    return model;
  }

  public static void main(String[] args) {
    run();
  }

}
