Experiment

Contents

Experiment#

The Experiment class is a thin wrap of the mmodel.Model class. The change is that the instantiation takes the additional dictionary input “components”, used to replace group inputs with component objects.

For example, if the model input arguments are ["radius", "origin", "field"], and a magnet component contains the attributes “radius” and “origin”, then the magnet component can be used as a replacement object with the argument:

components = {'magnet': ["radius", "origin"]}

The resulting model inputs are ["magnet", "field"].

The Experiment class shares the same functionalities as the mmodel.Model, such as creating a new model with the edit method. For more details, see the mmodel documentation.

Nodes in the experiment graph can define the optional “output_unit” attribute. The units defined are displayed in node and model string representations.

model module#

Experiment class for mrfmsim.

The class inherits from mmodel.Model with minor modifications. The handler defaults to MemHandler, and in plotting, the method defaults to draw_graph.