7.6.2. pyafv.calibrate.DeformablePolygonSimulator
- class DeformablePolygonSimulator(phys, num_vertices=100)[source]
Simulator for the deformable polygon (DP) model of cell doublets.
- Parameters:
phys (PhysicalParams) – An instance of PhysicalParams containing the physical parameters, while phys.r and phys.delta are ignored.
num_vertices (int) – Number of vertices \(M\) to use for each cell.
- Raises:
TypeError – If phys is not an instance of PhysicalParams.
Warning
If the target shape index (based on phys.P0 and phys.A0) indicates a non-circular shape, a UserWarning is raised since the DP model is not valid in that regime.
Attributes
Methods
- simulate(ext_force, dt, nsteps, resample_every=1000)[source]
Simulate the DP model for a number of time steps under an external force.
This is basically a wrapper around
_step_update()andresample_polyline()with some bookkeeping.
- plot_2d(ax=None, show=False, **kw)[source]
Render a 2D snapshot of the cell doublet in DP model.
- Parameters:
ax (Axes | None) – If provided, draw into the axes; otherwise get the current axes.
show (bool) – Whether to call
plt.show()at the end.line_color_in (str, optional) – Specifies the color for the contact edge.
line_color_out (str, optional) – Specifies the color for the vertices and non-contact edges.
line_width_in (float, optional) – Specifies the line width for the contact edge.
line_width_out (float, optional) – Specifies the line width for the non-contact edges.
point_size (float, optional) – Specifies the marker size for the vertices.
- Returns:
The matplotlib axes containing the plot.
- Return type: