6.5.1. pyafv.calibrate.auto_calibrate

auto_calibrate(phys, ext_forces=None, dt=0.001, nsteps=50000, show=False)[source]

Auto-calibrate the parameters phys against the deformable-polygon (DP) model.

In this calibration, we simulate an initially steady-state cell doublet under increasing external force dipoles using the DP model; the external force starts from 0 to max(ext_forces). We identify the detachment force as the first external force at which detachment occurs. We then search for the delta value in the finite-Voronoi (FV) model to match this detachment force.

Parameters:
  • phys (PhysicalParams) – The initial physical parameters.

  • ext_forces (ndarray | None) – An array of external forces to apply during calibration; defaults to None, which uses np.linspace(0, 10, 101)[1:]; should start from a small positive value.

  • dt (float) – Time step for each simulation step.

  • nsteps (int) – Number of simulation steps to run for each external force.

  • show (bool) – Whether to print progress information; no need to use it if tqdm is installed.

Raises:

TypeError – If phys is not an instance of PhysicalParams.

Returns:

A tuple containing the detachment force and the calibrated PhysicalParams. If detachment does not occur within the given force range, return a NaN force.

Return type:

tuple[float, PhysicalParams]

Warning

This function may take some time to run, depending on the parameters. (If tqdm is installed, a progress bar will be shown automatically.) Do not change defaults unless you understand the implications.

If you only need a rough or faster calibration, you may change the external force range or interval. Adjusting dt and nsteps may also speed up simulations, but may affect accuracy; test the DeformablePolygonSimulator model separately to ensure accuracy is acceptable.