pymodelfit.core.intersect_models

pymodelfit.core.intersect_models(m1, m2, bounds=None, nsample=1024, full_output=False, **kwargs)[source]

Determine the points where two models intersect.

Parameters:
  • m1 (a FunctionModel1D object) – the first model
  • m2 (a FunctionModel1D object) – the second model
  • bounds – If None, the bounds will be determined from the model data if any is saved. Otherwise, a 2-tuple (min,max) defining the region to search for intersections.
  • nsample – number of points within the bounds to sample for intersections.
Returns:

A sorted array of points where the two models intersect on the interval (up to a resolution of (max-min)/nsample), or if full_output is True, returns (array,scipy.optimize.zeros.RootResults)

kwargs are passed into scipy.optimize.brentq()

Previous topic

pymodelfit.core.scale_and_offset_model

Next topic

Builtins Module - Built-in Model Classes

This Page