In the demo folder under the COMSOL Multiphysics
installation directory there are some files that can be used for creating the demonstration example. The example models for this demonstration is placed in the
demo\api\beammodel directory. There is a model file called
BeamModel.mph. This file contains the model to use for the GUI. Open COMSOL and open the model.
Spend some time familiarizing yourself with the model. Note especially that the model has a set of parameters under Global Definitions that are used to update the dimensions of the geometry, and that there is a set of variables defined under
Model>Defintions>Variables that are used to define the outputs from the simulations.
Use Compact History to make the model history compact. Then save the Java file using
Save As. Choose
Model file for Java (*.java) from the
Save as type list, and name the file
BeamModel.java. Then click
Save.