Skip to content

Seismology

Seismology systems.

The package covers earthquakes on loaded faults.

BurridgeKnopoffSystem(n_blocks=20, *, k_c=2.5, k_p=1.0, velocity=0.01, F0=1.0, v_c=0.5, random_state=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

The Burridge-Knopoff fault.

A chain of blocks pulled by a moving plate sticks and slips.

Every block is coupled to its neighbours by springs of stiffness k_c and to a plate moving at velocity by a leaf spring of stiffness k_p. A block at rest stays stuck until its spring force exceeds the static friction F0, and a sliding block feels the friction F0 / (1 + v / v_c), which weakens with its speed, so slips spread as earthquakes of many sizes. The ends of the chain are free, and the blocks start at small random offsets.

The drift switches whenever a block sticks or starts to slide, and these switches of single blocks give no events, so the adaptive default solver stalls on them: LSODA gives way to RK45 after its stall guard fires, and 2000 time units take about 24 s. The system runs with RK4Solver(dt=0.05), well inside the stability limit set by the highest frequency sqrt(k_p + 4 k_c), which runs the same span in about 3.5 s with the same statistics of slips. The system has the positions fault.x and velocities fault.v of the blocks.

Parameters:

Name Type Description Default
n_blocks int

The number of blocks.

20
k_c float

The stiffness of the springs between neighbouring blocks.

2.5
k_p float

The stiffness of the leaf springs to the plate.

1.0
velocity float

The velocity of the plate.

0.01
F0 float

The static friction force.

1.0
v_c float

The speed at which the friction halves.

0.5
random_state int | Generator | None

The seed or generator of the initial offsets.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.seismology import BurridgeKnopoffSystem
>>> trajectory = BurridgeKnopoffSystem(5).prepare().simulate(until=1.0)
>>> trajectory.get_values('fault.x').shape
(2, 5)
Source code in src/skcomplex/systems/physics/seismology/_spring_blocks.py
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
def __init__(
    self,
    n_blocks: int = 20,
    *,
    k_c: float = 2.5,
    k_p: float = 1.0,
    velocity: float = 0.01,
    F0: float = 1.0,
    v_c: float = 0.5,
    random_state: int | np.random.Generator | None = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.n_blocks = n_blocks
    self.k_c = k_c
    self.k_p = k_p
    self.velocity = velocity
    self.F0 = F0
    self.v_c = v_c
    self.random_state = random_state

EarthquakesSystem(shape=(50, 50), *, alpha=0.2, random_state=0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

The Olami-Feder-Christensen earthquake system with open edges.

The system starts from random forces.

The fault is a cascade that resets a slipping block to zero and passes the fraction alpha of its force to each of its four neighbours. With alpha below 1/4 the system is dissipative and its earthquake sizes still follow a power law. Its earthquakes are recorded as earthquake events with their sizes, the number of slips, their durations, and their areas. The system has the forces fault.force.

Parameters:

Name Type Description Default
shape Sequence[int]

The number of rows and columns.

(50, 50)
alpha float

The fraction of force passed to each neighbour.

0.2
random_state int | Generator | None

The seed or generator of the initial forces.

0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.seismology import EarthquakesSystem
>>> EarthquakesSystem((10, 10), alpha=0.15).prepare().system_.interactions[0].share
0.15
Source code in src/skcomplex/systems/physics/seismology/_faults.py
102
103
104
105
106
107
108
109
110
111
112
113
114
115
def __init__(
    self,
    shape: Sequence[int] = (50, 50),
    *,
    alpha: float = 0.2,
    random_state: int | np.random.Generator | None = 0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.shape = shape
    self.alpha = alpha
    self.random_state = random_state

FaultElement(label, *, force=0.0, space=None)

Bases: Element

Blocks of the Olami-Feder-Christensen earthquake system, the forces on them.

The cascade of EarthquakesSystem loads every block uniformly until one reaches the threshold force, and a slipping block passes a fraction of its force to each of its four neighbours and drops to zero.

Parameters:

Name Type Description Default
label str

The label of the blocks.

required
force Annotated[object, closed_open(0, oo)]

The initial force, one value or one per block.

0.0
space BaseSpace | None

The lattice of the blocks, or None for one block.

None

Examples:

>>> from skcomplex.systems.physics.seismology import FaultElement
>>> FaultElement('block').force
0.0
Source code in src/skcomplex/systems/physics/seismology/_faults.py
50
51
52
53
54
55
56
57
58
def __init__(
    self,
    label: str,
    *,
    force: Annotated[object, RealSet.closed_open(0, oo)] = 0.0,
    space: BaseSpace | None = None,
) -> None:
    super().__init__(label, space=space)
    self.force = force

SpringBlockElement(label, *, x=0.0, v=0.0, space=None)

Bases: Element

Blocks of the Burridge-Knopoff fault, their displacements and velocities.

Parameters:

Name Type Description Default
label str

The label of the blocks.

required
x object

The initial displacement, one value or one per block.

0.0
v object

The initial velocity, one value or one per block.

0.0
space BaseSpace | None

The lattice of the blocks, or None for one block.

None

Examples:

>>> from skcomplex.systems.physics.seismology import SpringBlockElement
>>> SpringBlockElement('block', x=0.5).x
0.5
Source code in src/skcomplex/systems/physics/seismology/_spring_blocks.py
45
46
47
48
49
50
51
52
53
54
55
def __init__(
    self,
    label: str,
    *,
    x: object = 0.0,
    v: object = 0.0,
    space: BaseSpace | None = None,
) -> None:
    super().__init__(label, space=space)
    self.x = x
    self.v = v

StickSlipInteraction(label, *, target, m=1.0, k_c=2.5, k_p=1.0, velocity=0.01, F0=1.0, v_c=0.5)

Bases: Interaction

Stick-slip friction of blocks pulled by springs and a moving plate.

The force on a block is the pull k_c of the springs to its neighbours plus the pull k_p of the plate moving at velocity. A block at rest sticks until the force exceeds the static friction F0, and a sliding block feels the friction F0 / (1 + v / v_c), so x' = max(v, 0) and m v' = force - friction while the block slides.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the blocks.

required
m float

The mass of a block.

1.0
k_c float

The stiffness of the springs between neighbouring blocks.

2.5
k_p float

The stiffness of the springs to the plate.

1.0
velocity float

The speed of the plate.

0.01
F0 float

The static friction.

1.0
v_c float

The characteristic speed of the weakening of the friction.

0.5

Examples:

>>> from skcomplex.systems.physics.seismology import StickSlipInteraction
>>> StickSlipInteraction('friction', target='fault').F0
1.0
Source code in src/skcomplex/systems/physics/seismology/_spring_blocks.py
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
def __init__(
    self,
    label: str,
    *,
    target: Role,
    m: float = 1.0,
    k_c: float = 2.5,
    k_p: float = 1.0,
    velocity: float = 0.01,
    F0: float = 1.0,
    v_c: float = 0.5,
) -> None:
    super().__init__(label)
    self.target = target
    self.m = m
    self.k_c = k_c
    self.k_p = k_p
    self.velocity = velocity
    self.F0 = F0
    self.v_c = v_c