Fitting > Troubleshoot fitting > Fitting runs slowly |
If Fitting runs slowly, there could be several reasons:
Some models contain very rapid changes in the species concentrations or other variables being integrated by the solver. The solver will therefore need to take very small timesteps to capture these rapid changes, which results in a longer run time.
Typical examples include fast reactions (e.g. pH adjustment / neutralization, reactions with ionic equilibria); fast mass transfer (high kLa to ensure equilibrium between phases), models where phases appear or disappear. The variable causing the small timestep can be identified by viewing the Event Log in Simulator. This should give an indication of the source of the problem.
To correct this try modifying the model (either reduce very large parameter values or simplify the model). If this cannot be done, then some other options are available to reduce run times:
The more scenarios are selected for fitting, the longer the time for each fitting iteration as each selected scenario requires a proportional increase in run time per fitting iteration. In order to reduce the overall time for fitting, it is recommended to begin fitting with one scenario. This will enable good estimates of the parameters, which will then speed up fitting when other scenarios and data are included.
As with scenarios, the more parameters selected, the longer the run time will be. One of the temptations of automated fitting is to select too many parameters. This will normally result in a slow run, and large confidence intervals on parameters (i.e. there is not enough information in the experimental data to fit all of the selected parameters). Try to keep the number of parameters to be fitted low (e.g. less than 8 if possible). Alternatively, do the fitting exercise in stages, selecting a few parameters at a time to fit (this will refine the initial guesses for these parameters) before fitting all parameters. For example, fit the main reaction first (this will dominate the mole balance) before fitting the impurity-forming reactions. A sensible strategy for fitting can significantly reduce the time taken in fitting parameters and, in many cases, it will be the only method that results in success.