Tutorial
Creating global parameters
API creating global parameters
Global parameters are created using the function AMEAddGlobalParameter. You should consult the documentation for this function by typing help (‘AMEAddGlobalParameter’) AMEAddGlobalParameter
API AMEAddGlobalParameter .
We will create the following Global parameters:
| Name | Title | Value | Unit |
|---|---|---|---|
| MASS | mass of piston | 0.5 | kg |
| BORE | bore of piston | 60 | mm |
| R | radius of crank | 30 | mm |
| ANG | initial angular position of crank | 30 | degree |
| OFF | difference in piston angles | 180 | degree |
| L | length of connecting rod | 40 | mm |
We suggest you set meaningful default, minimum and maximum values for your Global parameters, according to usage type.
Add the code to your script:
# Set Global parameter values
AMEAddGlobalParameter('MASS', 'mass of piston', 'ame_real_parameter', '0.5', '0.1', '0.5', '2', 'kg')
AMEAddGlobalParameter('BORE', 'bore of piston', 'ame_real_parameter', '60', '20', '60', '100', 'mm')
AMEAddGlobalParameter('R', 'radius of crank', 'ame_real_parameter', '30', '10', '30', '50', 'mm')
AMEAddGlobalParameter('ANG', 'initial angular position of piston 1', 'ame_real_parameter', '0', '0', '0', '360', 'degree')
AMEAddGlobalParameter('OFF', 'difference in piston angles', 'ame_real_parameter', '180', '0', '0', '360', 'degree')
AMEAddGlobalParameter('L', 'length of connecting rod', 'ame_real_parameter', '40', '25', '40', '110', 'mm')
Launch your script and then open the circuit in Simcenter Amesim. Switch to Parameter mode and check the parameter values and Global parameter values you created:
Figure 16: Global Parameters set for a component
You will observe that MASS now appears in black as the global parameter now exists.
Figure 17: Global Parameters
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Circuit_API/Creating_global_parameters · retrieved 2026-07-17