# API Reference

## Inputs

The driving record, the pile and hammer that produced it, and the ground it was driven through.

[DriveLog](DriveLog.md#driven_pile.DriveLog)  
A pile-driving record, one entry per logged foot.

[Pile](Pile.md#driven_pile.Pile)  
Pile geometry and stiffness.

[Hammer](Hammer.md#driven_pile.Hammer)  
Driving hammer.

[SoilProfile](SoilProfile.md#driven_pile.SoilProfile)  
Ground conditions at a pile location.

[bpm_to_stroke()](bpm_to_stroke.md#driven_pile.bpm_to_stroke)  
Hammer stroke from the blow rate of a free-falling ram.

[stroke_to_bpm()](stroke_to_bpm.md#driven_pile.stroke_to_bpm)  
Blow rate of a free-falling ram from its stroke; inverse of [bpm_to_stroke](../reference/bpm_to_stroke.md#driven_pile.bpm_to_stroke).

## Options

Model parameters and Monte Carlo settings, with the published values as defaults.

[ModelOptions](ModelOptions.md#driven_pile.ModelOptions)  
Parameters of the drive model.

[MonteCarloOptions](MonteCarloOptions.md#driven_pile.MonteCarloOptions)  
Monte Carlo settings.

## Pipeline

One function per stage of the method, and one call that runs them all.

[analyze()](analyze.md#driven_pile.analyze)  
Characterize the soil from a driving log and estimate long-term capacity.

[prepare_target()](prepare_target.md#driven_pile.prepare_target)  
Build the capacity target from a driving log.

[sweep_top_phi()](sweep_top_phi.md#driven_pile.sweep_top_phi)  
Sweep a constant top-segment friction angle and find the admissible band.

[run_drive()](run_drive.md#driven_pile.run_drive)  
Characterize every foot sequentially from the capacity target, top down.

[long_term_capacity()](long_term_capacity.md#driven_pile.long_term_capacity)  
Long-term shaft and toe resistance of a [DriveResult](../reference/DriveResult.md#driven_pile.DriveResult).

[monte_carlo()](monte_carlo.md#driven_pile.monte_carlo)  
Realizations of the long-term capacity under the five uncertainty sources.

## Results

Dataclasses of plain NumPy arrays.

[Analysis](Analysis.md#driven_pile.Analysis)  
Everything [analyze](../reference/analyze.md#driven_pile.analyze) produces.

[Target](Target.md#driven_pile.Target)  
Per-foot capacity target and static soil state on the analysis grid.

[TopPhiBand](TopPhiBand.md#driven_pile.TopPhiBand)  
Admissible friction angles for the unlogged top segment.

[DriveResult](DriveResult.md#driven_pile.DriveResult)  
Soil characterization and capacities from one drive-model run.

[MonteCarloResult](MonteCarloResult.md#driven_pile.MonteCarloResult)  
Monte Carlo realizations of the long-term capacity.

## DriveResult Methods

Methods for the DriveResult class

[DriveResult.n_logged](DriveResult.n_logged.md#driven_pile.DriveResult.n_logged)  
Number of logged feet.

[DriveResult.logged](DriveResult.logged.md#driven_pile.DriveResult.logged)  
Boolean mask of the logged feet.

[DriveResult.reason_counts()](DriveResult.reason_counts.md#driven_pile.DriveResult.reason_counts)  
Count of each outcome code over the logged feet.

[DriveResult.fraction_liquefied()](DriveResult.fraction_liquefied.md#driven_pile.DriveResult.fraction_liquefied)  
Fraction of logged feet that liquefied during the drive.

[DriveResult.plot_profile()](DriveResult.plot_profile.md#driven_pile.DriveResult.plot_profile)  
Plot friction angle, blow count and pore-pressure ratio versus elevation.

[DriveResult.plot_fit()](DriveResult.plot_fit.md#driven_pile.DriveResult.plot_fit)  
Plot the capacity target and the modeled capacity versus elevation.

## Equation-level functions

The equations of the method, importable from the submodules for teaching and testing.

[formulas.elastic_set()](formulas.elastic_set.md#driven_pile.formulas.elastic_set)  
Elastic compression term of the Danish formula.

[formulas.danish_capacity()](formulas.danish_capacity.md#driven_pile.formulas.danish_capacity)  
Capacity at the time of driving from the recalibrated Danish formula.

[preprocess.smooth_capacity()](preprocess.smooth_capacity.md#driven_pile.preprocess.smooth_capacity)  
Savitzky-Golay smoothing of a capacity sequence.

[preprocess.sigma_v0_profile()](preprocess.sigma_v0_profile.md#driven_pile.preprocess.sigma_v0_profile)  
Static vertical effective stress at each elevation.

[preprocess.extend_to_mudline()](preprocess.extend_to_mudline.md#driven_pile.preprocess.extend_to_mudline)  
Prepend the unlogged feet between the mudline and the first logged foot.

[preprocess.residual_scale()](preprocess.residual_scale.md#driven_pile.preprocess.residual_scale)  
Robust standard deviation of the raw-minus-smoothed capacity residuals.

[bearing.nq_vesic()](bearing.nq_vesic.md#driven_pile.bearing.nq_vesic)  
Vesic bearing capacity factor on vertical effective stress.

[bearing.rigidity_index()](bearing.rigidity_index.md#driven_pile.bearing.rigidity_index)  
Rigidity index from a stress-dependent shear modulus.

[bearing.toe_bearing()](bearing.toe_bearing.md#driven_pile.bearing.toe_bearing)  
Unit toe resistance `q_p = N_q*(phi, I_r) sigma'_v`, ksf.

[bearing.phi_from_toe_bearing()](bearing.phi_from_toe_bearing.md#driven_pile.bearing.phi_from_toe_bearing)  
Friction angle whose toe bearing on `sigma_v` equals `q_needed`.

[bearing.phi_from_toe_bearing_grid()](bearing.phi_from_toe_bearing_grid.md#driven_pile.bearing.phi_from_toe_bearing_grid)  
Friction angle from toe bearing by interpolation on a fixed grid.

[spt.phi_from_n160()](spt.phi_from_n160.md#driven_pile.spt.phi_from_n160)  
Friction angle from the corrected SPT blow count.

[spt.n160_from_phi()](spt.n160_from_phi.md#driven_pile.spt.n160_from_phi)  
Corrected blow count whose correlated friction angle equals `phi`.

[shaft.coyle_castello_k()](shaft.coyle_castello_k.md#driven_pile.shaft.coyle_castello_k)  
Coyle and Castello earth pressure coefficient at the ground surface.

[shaft.nordlund_k_delta()](shaft.nordlund_k_delta.md#driven_pile.shaft.nordlund_k_delta)  
Nordlund lateral coefficient for a non-tapered displacement pile.

[shaft.fs_coyle_castello()](shaft.fs_coyle_castello.md#driven_pile.shaft.fs_coyle_castello)  
Unit shaft resistance of a driven pile in sand.

[shaft.interface_alpha()](shaft.interface_alpha.md#driven_pile.shaft.interface_alpha)  
Interface factor on the residual strength of liquefied soil.

[shaft.fs_partially_liquefied()](shaft.fs_partially_liquefied.md#driven_pile.shaft.fs_partially_liquefied)  
Unit shaft resistance through soil at pore-pressure ratio `ru`.

[liquefaction.delta_n_fines()](liquefaction.delta_n_fines.md#driven_pile.liquefaction.delta_n_fines)  
Fines-content adjustment to the clean-sand equivalent blow count.

[liquefaction.n160_clean_sand()](liquefaction.n160_clean_sand.md#driven_pile.liquefaction.n160_clean_sand)  
Clean-sand equivalent blow count `N1,60cs = N1,60 + dN(FC)`.

[liquefaction.crr_m75()](liquefaction.crr_m75.md#driven_pile.liquefaction.crr_m75)  
Cyclic resistance ratio at the magnitude 7.5 reference and 1 atm.

[liquefaction.k_sigma()](liquefaction.k_sigma.md#driven_pile.liquefaction.k_sigma)  
Overburden correction factor on the cyclic resistance ratio.

[liquefaction.crr_15()](liquefaction.crr_15.md#driven_pile.liquefaction.crr_15)  
In-situ cyclic resistance ratio at the 15-cycle reference.

[liquefaction.csr_driving()](liquefaction.csr_driving.md#driven_pile.liquefaction.csr_driving)  
Cyclic stress ratio applied by a hammer blow that fails the soil.

[liquefaction.cycles_to_liquefaction()](liquefaction.cycles_to_liquefaction.md#driven_pile.liquefaction.cycles_to_liquefaction)  
Uniform cycles at `csr` needed to trigger liquefaction.

[liquefaction.ru_linear()](liquefaction.ru_linear.md#driven_pile.liquefaction.ru_linear)  
Pore-pressure ratio growing linearly with the cycle ratio.

[liquefaction.residual_strength()](liquefaction.residual_strength.md#driven_pile.liquefaction.residual_strength)  
Residual strength of liquefied soil.

[capacity.shaft_long_term()](capacity.shaft_long_term.md#driven_pile.capacity.shaft_long_term)  
Long-term shaft resistance, kips.

[capacity.toe_end_of_drive()](capacity.toe_end_of_drive.md#driven_pile.capacity.toe_end_of_drive)  
Toe resistance at the end of the drive, kips.

[characterization.triggering_state()](characterization.triggering_state.md#driven_pile.characterization.triggering_state)  
Blow count, cyclic stress and resistance, and cycles to liquefaction.

[characterization.characterize_foot()](characterization.characterize_foot.md#driven_pile.characterization.characterize_foot)  
Characterize the soil at the toe from the required toe resistance.
