sme_contrib.optimize.SteadyState.find

SteadyState.find(particles=20, iterations=20, processes=None)

Find parameters that result in a steady state concentration close to the target image

Uses particle swarm to minimize the difference between the rescaled concentration and the target image, as well as the distance from a steady state solution.

Parameters:
  • particles (int) – The number of particles in the particle swarm

  • iterations (int) – The number of particle swarm iterations

  • processes – The number of processes to use (the default None means use all available cpu cores)

Returns:

the best parameters found

Return type:

List of float

Note

On Windows, calling this function from a jupyter notebook can result in an error message of the form Can’t get attribute ‘apply_params’ on <module ‘__main__’, where apply_params is the function you have defined to apply the parameters to the model. This is a known issue with Python multiprocessing, and a workaround is to define the apply_params function in a separate .py file and import it into the notebook.