find_ndiv()
Description: This function calculates the number of Gaussian quadratures needed to reach an arbitrary tolerance.
Usage
ndiv = find_ndiv(transducer, coordinate_grid, medium, f0);
ndiv = find_ndiv(transducer, coordinate_grid, medium, f0, tol);
Arguments
- transducer A FOCUS transducer array.
- coordinate_grid A FOCUS coordinate grid.
- medium A FOCUS medium.
- f0 The frequency of the array in Hz.
- tol Maximum difference in the result between two ndiv calculations. This parameter is optional; its default value is 1×10 - 10.
Output Parameters
- ndiv The number of divisions.
Notes
This function is mainly used by fnm_run when users do not enter the ndiv value. If the desired tolerance cannot be reached with 100 quadratures, the number will be set to 20.

