Skip to content
Gijs Molenaar edited this page Feb 13, 2014 · 4 revisions

= MeqSolver =

The general equation solver

Initrec

[[!table header="no" class="mointable" data=""" Field | Default | Comment num_iter | 3 | Maximum number of solver iterations epsilon | 0.0 | Fit considered converged if solver "fit" parameter < epsilon, see below. epsilon=10-4 is generally a good value. Set num_iter to a high value, like 20. Usually the fit converges in 3 or fewer iterations. last_update | False | Update parameters after solve converged. Set this one and save_funklets to True if you want to store the solutions in a ParmTable save_funklets | False | Set to True if you want to store the solutions in a ParmTable use_svd | True | Use a Singular Value Decomposition matrix inversion. HIGHLY RECOMMENDED



## Stopping condition

From now on the solver stops iterating when 

* iteration == num_iter 
               * OR 
* abs(fit) < epsilon AND fit < 0.0 
10<sup>-4</sup> appears to be a sensible setting for epsilon. 

fit < 0.0 implies that chi-squared decreased during the last iteration. One should NEVER stop after iterations that increased chi-squared. Set num_iter to 20 or 40 or something similar to catch difficult cases. 

I added two fields to the solver metrics:  

* Iterations: number of iterations used in solution 
* Converged: indicates whether convergence was achieved. 
Clone this wiki locally