prophys.physics

prophys.physics#

Generic physics primitives.

Each function returns a symbolic Expr backed by an exact native kernel with exact gradients. Arguments may be constants, parameters, random variables or other expressions. The primitives are generic building blocks: a transport, dispersion, thermal or reliability model is a composition of them with symbolic arithmetic, not a kernel of its own.

Classes

AccelerationMoments

Mean and covariance of the gravitational acceleration under vertex uncertainty.

Functions

superpose

Superpose the Green's function contributions of all sources at every receptor.

gaussian_polygon_probability

Compute the exact probability P(x in polygon) for a bivariate normal position x ~ N(mean, L L^T).

ray_integral

Compute exact reductions of a raster along line segments (path integrals, maxima, lengths above a threshold).

propagate_linear

Compute the exact state after duration of the linear system dx/dt = generator @ x + source.

overlap_area

Compute the exact overlap area of a polygonal region with a polygon or a disk.

piecewise_polynomial

Evaluate a published piecewise polynomial fit, such as a log log scaling law, at x.

network_potentials

Solve a grounded linear network L(conductance) phi = injection for the node potentials.

state_space_loglik

Compute the exact log likelihood of an observation series under a linear Gaussian state space model.

eigensystem

Solve the generalized symmetric eigenproblem K q = lambda M q, with exact gradients.

natural_frequencies

Angular natural frequencies omega_i = sqrt(lambda_i) of K q = lambda M q.

modal_superposition

Frequency response of a structure by exact modal superposition.

track_modes

Match modes to a reference set by the modal assurance criterion.

compound_distribution

Compute the exact pmf of a compound sum of a random number of severities on the lattice 0..n_out-1.

spectral_random_field

Evaluate a stationary random field with a prescribed covariance at points (spectral randomization method).

directional_sweep

Compute node outputs reduced by the shadowing of upstream nodes along a direction, such as turbine wakes.

fatigue_damage

Compute the Palmgren Miner fatigue damage of a load or stress history by rainflow counting.

polyhedron_gravity

Return the potential, the acceleration and the gravity gradient of a constant density polyhedron.

delta_acceleration_moments

First order delta method mean and covariance of the acceleration under vertex uncertainty.

montecarlo_acceleration_moments

Monte Carlo mean and covariance of the acceleration under vertex uncertainty.

propagate_nbody

Propagate mutually gravitating point masses by a differentiable velocity Verlet fold.

Constants and objects

GRAVITATIONAL_CONSTANT

Convert a string or number to a floating-point number, if possible.