The Simulation Scripting environment in detail > Optimization, Design of Experiments
Using the Design Exploration API
Accessing studies in a model
accessing studies in a model Follow the steps below to access an existing study in a model. You can access the model_studies object of a model by typing the command below, where the parameter passed in is the path of the model file:
Copy
ms=DE.get_model_studies (r'$AME\demo\Platform\OptimizationRobustnessDOE\
Optimization\DesignOptimization.ame')
You can access the study required from the model_studies object by typing the command below, where the first parameter is “study name” and second is the “type of study”.
Copy
ms=DE.get_model_studies (r'$AME\demo\Platform\OptimizationRobustnessDOE\
Optimization\DesignOptimization.ame')
Figure 11: Accessing a design exploration study in a model
Creating a new study in a model
Follow the steps below to create a new study in a model.
Access the model_studies object for the model with a given path.
Copy
ms=DE.get_model_studies (r'$AME\demo\Platform\OptimizationRobustnessDOE\
Optimization\DesignOptimization.ame')
You can create a study by typing the command below, where the first parameter is the “name of study” and second parameter is the “type of study”
Copy
study=ms. create_study ( "new_study" , Study.study_type.OPT)
The function above can be called with a second parameter as a string referring to the type of study as below:
Copy
study=ms. create_study ( "new_study" , "OPT")
You can save all the studies in the model_studies object by typing the command: print (ms.save_studies() )
Figure 12: Creating a new study
The new study name “new_study” and of type “OPT” has been created and saved in the model. You can see the created study in the model by opening the model in Simcenter Amesim and accessing the Design exploration window for that model.
Setting the alogrithm to study and the properties of the alogrithm
setting the algorithm to study and the properties of the algorithm
You can set the algorithm to the previously created study. You can get the list of possible algorithms for a study by typing:
Copy
study.get_available_algorithms()
You can set an algorithm to a study by typing the command below where the parameter passed in is algorithm name:
Copy
algo=study.set_algorithm('GeneticAlgorithm')
You can get the available properties for an algorithm by typing:
Copy
algo.get_properties()
You can set the property of an algorithm by typing the command below, where the parameters passed in are property_name and the value for that property consecutively:
Copy
algo.set_property('Population_Size', 50)
Figure 13: Setting the algorithm to study
Setting the properties of parameters in a study
setting the properties of parameters in a study
You can get a parameter in a study and set its properties. You can get the list of parameters in the study and store it in the variable param_list by typing:
Copy
param_list=study.get_parameters()
You can get the first param in the list to the variable first_param by typing:
Copy
first_param=param_list[0]
You can get the list of properties applicable to that parameter by typing:
Copy
first_param.get_properties()
You can set the property “Used” for that param to “True” by typing:
Copy
first_param.set_property('Used', True)
Figure 14: Setting the properties of a parameter
Running a study
running a study
You can run a study by typing:
Copy
study.run()
Figure 15: Running a study
Figure 16: Successful completion of a study run
The study has been run and its results have been printed in the console. If any errors or warnings arise during study execution, they will be displayed in the console.
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Scripting/xid1133405 · retrieved 2026-07-17