Modeling#

bruces.modeling.etas(catalog, end_time=None, mc=0.0, theta=0.2, alpha=0.5, c=0.001, K=0.1, b=1.0, d=1.0, seed=None)[source]#

Epidemic-Type Aftershock Sequence.

Parameters:
  • catalog (bruces.Catalog) – Earthquake catalog of background events.

  • end_time (scalar, datetime_like or None, optional, default None) – Maximum simulation time. Default is origin time of last earthquake in input catalog.

  • mc (scalar, optional, default 0.0) – Magnitude of completeness.

  • theta (scalar, optional, default 0.2) – Omori’s exponent (> 0.0).

  • alpha (scalar, optional, default 0.5) – Aftershock productivity constant.

  • c (scalar, timedelta_like or None, optional, default None) – Aftershock productivity constant (in days if scalar). Default is 0.001 days.

  • K (scalar, optional, default 0.1) – Aftershock productivity constant.

  • b (scalar, optional, default 1.0) – b-value.

  • d (scalar, optional, default 1.0) – Characteristic length (in km).

  • seed (int or None, optional, default None) – Seed for random number generator.

Returns:

Simulated catalog (background and aftershock events).

Return type:

bruces.Catalog

Note

  • Origin times are generated following Helmstetter and Sornette (2002)

  • Locations are implemented following Ogata (1998)

  • Magnitudes are distributed following Gutenberg-Richter law

bruces.modeling.magnitude_time(times, rates, m_bounds, n=50, b_value=1.0, seed=None)[source]#

Generate earthquake magnitude-time distribution.

Parameters:
  • times (sequence of scalar or sequence of datetime_like) – Dates for every seismicity rate samples (in years if scalar).

  • rates (array_like) – Seismicity rates.

  • m_bounds (array_like) – Magnitude bounds (support for CDF from which magnitude values are sampled).

  • n (int, optional, default 50) – Number of magnitude points to define CDF.

  • b_value (scalar, optional, default 1.0) – b-value.

  • seed (int or None, optional, default None) – Seed for random number generator.

Returns:

List of magnitude samples for every time steps.

Return type:

list

bruces.modeling.seismicity_rate(times, stress, stress_ini, asigma, t_crit=None, t_bound=None, first_step=None, max_step=None, reduce_step_factor=4.0, rtol=1e-05)[source]#

Rate-and-state modeling of seismicity rate.

Parameters:
  • times (sequence of scalar or sequence of datetime_like) – Dates for every stressing rate samples (in years if scalar). Common to all integration points.

  • stress (sequence of scalar) – Stressing rates or sequence for every integration points.

  • stress_ini (scalar or sequence of scalar) – Background stressing rate or sequence for every integration points.

  • asigma (scalar or sequence of scalar) – Free parameter for rate-and-state constitutive model or sequence for every integration points.

  • t_crit (datetime_like or None, optional, default None) – Critical time. Default is times[0].

  • t_bound (datetime_like or None, optional, default None) – Boundary time.

  • first_step (scalar, timedelta_like or None, optional, default None) – Initial time step size (in years if scalar). Default is 1 day.

  • max_step (scalar, timedelta_like or None, optional, default None) – Maximum allowed time step size (in years if scalar). Default is 1 month.

  • reduce_step_factor (scalar, optional, default 4.0) – Factor by which time step size is reduced for unsuccessful time step.

  • rtol (scalar, optional, default 1.0e-5) – Relative convergence tolerance.

Returns:

Seismicity rates or list of seismicity rates for every integration points. Returned seismicity rates are relative to background seismicity rate.

Return type:

array_like