AmesimKnowledge

Customizing submodels

Example 1: Customized submodel of the cosine function

Objective

To create the simplest possible customized submodel.

The function submodel FX00 belongs to the Signal, Control and Observers library. The associated icon is shown here. You can find it in the table & functions folder. This submodel applies any user-supplied function of one variable x, to the input signal on port 2. The result is the output f(x) on port 1. The function f is defined by the user in Parameter mode.

A simple customization can be made to FX00 to produce COS50, which will calculate the cosine of the input. We could also produce a sine version, an absolute value version and indeed a whole collection of customized versions of FX00.

For this simple example you will load the generic submodel FX00 into Component Customization and customize it saving the resulting customized submodel as COS50. It is a good idea to create a special directory or folder called tutorial (for instance) and save all the customized submodels in this directory.

Step 1: Start Component Customization

starting Component Customization

Using Unix: Talk to your system administrator, who will show you how to set up your working environment so that you can access Component Customization. To start Component Customization, in a suitable window change to the directory where you wish to work (tutorial for example) and type: AMECustom
Using Windows: Do one of the following: Select Component Customization from the menu Program > Imagine > Component Customization produced by the Start button, or Double click on the Component Customization icon on your desktop, or Type AMECustom in a MS DOS Command window from the directory where you wish to work (tutorial for instance).

The display shown in the following figure appears. It has been deliberately made similar to Simcenter Amesim and Submodel Editor but there are small differences in the display and Component Customization performs different functions. The main area is used to display details of submodels and supercomponents that are customized.

Figure 5: Component Customization main area

Note

For the rest of the tutorial exercises, you should save all your customized submodels in the same directory as the current one (tutorial directory).

Warning

Do not use special characters in library paths (such as '$', '#', ';', '', '&', '"', ''', '(', ')', '|', '`' etc.) as this can cause problems for model compilation.

Step 2: Select the FX00 icon

Procedure

  1. On the right-hand side of the Component Customization display are the Categories. Select the Signal, Control and Observers category and then the table & functions folder. Click on the standard f(x) icon.

The Open Submodel dialog box opens.

  1. Select the submodel FX00 in the list and click on Open.

The following figure shows the new display. Figure 6: Component Customization display with a submodel loaded

Step 3: Customize the generic submodel

The process of customizing submodels is largely a matter of filling in forms. Here you are going to alter the characteristics of the submodel FX00 to get your own submodel COS50:

Procedure

  1. In the Brief description Brief description setting field, replace the current description by the following: computes the cosine of the input.

This field contains text, which will be displayed when the submodel is selected in Simcenter Amesim.

  1. Click on the button labeled Full description Full description setting and change the title and description as shown below:

Figure 7: Full description

  1. Click OK to close the description window.

  2. In the External variables External variables modifying table, modify the title of the two external variables as follows:

Figure 8: External variable table

  1. Select the Text parameters tab from the Internal items table and set the default value of the expression in terms of the input x parameter to cos(x):

Figure 9: Internal variable table

  1. Select the Hidden check box checkbox:

Warning This point is important because in Simcenter Amesim, the parameter will no longer appear in the submodel parameter list and its default value will be used. Hiding a customized submodel parameter ensures that its default value will always be used in Simcenter Amesim.

Step 4: Save the customized model

At this stage the customization is complete.

Procedure

  1. saving a customized object Save it by clicking on the button.

This will produce the dialog box below from which you can give a name to your customized submodel: Figure 10: Submodel name and password

Putting a tick mark in the check box labeled Save encrypted is not necessary for such a simple submodel. This feature will be covered in the last example of next section. If you then click on OK, a file browser appears and you must select an Simcenter Amesim node directory for your customized submodel. Note If the directory you selected is not in the path list you will get the following message:

If you click on Yes, this directory will be added to your path list.

  1. You can get a preview of the Change Parameters and Variable List dialog boxes you would get in Simcenter Amesim. Click on the buttons and to get the Preview facilities previews shown in the two following figures, respectively:

Figure 11: Preview of the Change Parameters dialog box

Figure 12: Preview of the Variable List dialog box

As you can see, the parameter list is empty since the only parameter of the generic submodel is now hidden. It is set to cos(x) and cannot be changed by an Simcenter Amesim user. The variable list shows the customized names of external variables.

Step 5: Use the customized submodel in Simcenter Amesim

Procedure

  1. Start Simcenter Amesim and build the small model shown in order to test your new submodel:

  2. In Submodel mode you will get the Submodel List with customized submodels Submodel List dialog box shown below after selecting the f(x) icon, and after clicking on the cross that appears on the left-hand side of the list:

Figure 13: Submodel List dialog box

  1. You can then select the customized submodel COS50.If COS50 does not appear in the list, check your path list and update it as necessary.

  2. In Parameter change parameters with customized submodels mode, it is also possible to change between generic and customized submodels.

The submodel currently assigned appears in a field and you can select another submodel from a list which is produced by clicking on the arrow in this field: Figure 14: List of customized submodels

  1. Set the slope parameter of the ramp submodel (RAMP0) to 2*PI/10.

  2. In Simulation mode, start a simulation for 10 seconds with a print interval of 0.01 seconds and plot the output of COS50 cosine of input x. You should get the following curve:

Figure 15: Plot the output of COS50 against its input

Results

As an extension to this first example, you could create other customized submodels from FX00 such as: SIN50, ABS50, EXP50, etc.

Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.AMECustom/Example_1_customized_submodel_of_the_cosine_function · retrieved 2026-07-17