finesse.model.Model.run

Model.run(analysis=None, return_state=False, progress_bar=False, simulation_type=None, simulation_options=None)[source]

Runs the current analysis set for this model. If no analysis has been set in the model and the analysis argument is None, then this will run a Noxaxis() on the current model.

If a separate analysis has been provided with the analysis argument then this will be run instead of what has been set to model.analysis.

Parameters
analysis[str, Action], optional

KatScript code for an analysis or an analysis object to run.

return_statebool, optional

Whether to return the state of each model generated by this analysis.

progress_barbool, optional

Whether to show progress bars or not

Returns
solSolution Object

Solution to the analysis being performed

statesobjects, only when return_state == True

States generated by the analysis

Examples

Run a model with the analysis specified in the original KatScript:

>>> import finesse
>>> model = finesse.Model()
>>> model.parse('''
... l l1
... pd P l1.p1.o
... ''')
>>> model.run("for(l1.P, [0, 1, 2, 3], print(l1.P))")

Or you can run a separate analysis:

>>> model.run("noxaxis()")