numerical/solve1d.py¶
NumericalModel
¶
NumericalModel(physical_parameters: dict, model_parameters: dict)
Numerical solution of \(\omega(\chi,\tau)\) and \(\phi(\tau)\) evolution.
Class that provides a finite-difference method for solving the space-time evolution of a weakness profile \(\omega(\chi,\tau)\) and its eroding surface position \(\phi(\tau)\) as 2d array \(\omega_i^j\) and 1d vector \(\phi^j\) respectively, and that provides dictionaries for the model and its numerical solution parameters.
Parameters:
-
(physical_parameters¶dict) –model parameters dictionary
-
(model_parameters¶dict) –numerical method parameters dictionary
Attributes:
-
parameters(dict) –model parameters dictionary, extended during & after instantiation
-
model_parameters(dict) –numerical method parameters dictionary
-
chi_domain_size(float) –length of chi solution domain (extracted from model_parameters)
-
Delta_chi(float) –spacing between discrete chi solution points (extracted from model_parameters)
-
n_chi_domain(int) –number of solution points in distance chi (extracted from model_parameters)
-
tau_domain_size(float) –maximum duration of solution (truncated if/when front exits chi domain) (extracted from model_parameters)
-
tau_n_steps(int) –number of solution points in time \(\tau\)
-
Delta_tau(float) –spacing between discrete tau solution points
-
chi_array(NDArray) –discrete distances \(\chi_i\)
-
tau_array(NDArray) –discrete times \(\tau^j\)
-
eta_array(NDArray) –discretized weakness profile \(\omega_i^j\)
-
phi_array(NDArray) –discrete (in time) series of erosion front positions \(\phi^j\) (smoothly resolved as floats)
-
nu_array(NDArray) –discrete (in time) series of dimensionless erosion rates \(\nu^j\)
-
j(int) –final time step index \(j\)
-
W(float) –weathering number \(W\)
-
nu_s(float) –predicted (by analytical solution) dimensionless steady-state erosion rate \(\nu_s\)
-
v_s(float) –predicted (by analytical solution) steady-state erosion rate \(v_s\)
-
Python package
viz
VizSimulations
Methods:
-
neg_exp_Heaviside–Negate, exponentiate and Heaviside clip.
-
solve–Use an explicit finite-difference scheme to solve for evolution of a
Source code in wmbe/numerical/solve1d.py
neg_exp_Heaviside
staticmethod
¶
Negate, exponentiate and Heaviside clip.
Assumes the argument chi= \(\chi\) is the dimensionless distance from the erosion front, and dchi= \(\Delta\chi\) is the discrete spatial step size. Exponentiates \(-\chi H(\chi+\Delta\chi)\) where H=Heaviside function. When invoked in computing \(d{\omega}/d{\chi}\), adding \({\Delta}{\chi}\) means a non-clipped value is returned for the sample point just to the left (-ve \(\chi\)). Thus the \({\omega}\) gradient is estimated across the erosion front, where sample points span the moving origin, as well as for all points \(\chi\geq 0\).
Source code in wmbe/numerical/solve1d.py
solve
¶
Use an explicit finite-difference scheme to solve for evolution of a weakness profile \(\omega_i^j\) and its eroding surface position \(\phi^j\).
Source code in wmbe/numerical/solve1d.py
weakness_chi_tau
¶
Weathering-driven weakness function.
Analytic solution for \(\omega(\chi,\tau)\) as a function of dimensionless distance (depth into the rock) \(\chi\) and time \(\tau\), and parameterized by weathering number \(W\), assuming an exponential-decay model for weathering.
Parameters:
-
(chi¶NDArray) –dimensionless distance \(\chi\)
-
(tau¶NDArray) –dimensionless time \(\tau\)
-
(W¶float) –weathering number \(W\)
Returns:
-
float | NDArray–weakness \(\omega(\chi,\tau; W)\)
Source code in wmbe/numerical/solve1d.py
erosionrate_steadystate_W
¶
Dimensionless steady-state speed of the erosion front \(\nu_s(W)\).
Assumes: \(\nu_s = \tfrac{1}{2}\left(1+\sqrt{1+4W}\right)\).
Parameters:
Returns:
-
float | NDArray–dimensionless erosion rate \(\omega_s\)