Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prophys

prophys examples

Small, runnable scripts that show how to build risk models with prophys

A road optimised over a terrain field, rendered in 3D

prophys is a Python library by RhineQC for models that combine geometry, physics and uncertainty in one differentiable graph. You write the model once and then sample it, calibrate it against measurements and optimise a design with the same gradient. Every number comes back with its error bar.

This repository holds a set of examples that use the public API only. They start with a model of a few lines and build up step by step to calibration, sensitivity analysis, stochastic processes and design optimisation. Every example stays within the free tier, so it runs without a license.

Install

pip install -r requirements.txt

This installs prophys, NumPy and Matplotlib. prophys needs Python 3.11 or newer and brings JAX with it.

Run

python examples/01_first_model.py

Each script prints its results and writes its figure to assets as a light and a dark PNG on a transparent background. Every example runs in a few seconds on a laptop CPU.

Examples

Script What it shows
01_first_model Houses, turbines and an uncertain acceptance drop in one compiled model
02_symbolic_expressions Parameters, expressions and exact gradients through jax.grad
03_distributions Five distribution families and a maximum likelihood fit with fit_distribution
04_geometry Frames, polygons and grids with signed distances and smooth containment
05_monte_carlo_risk A flood damage model with quantiles, tail risk and Monte Carlo errors
06_calibration Fitting a cooling law with standard errors, propagation and a profile likelihood
07_design_optimization Placing turbines inside a permitted area with constraints on spacing
08_sensitivity Local elasticities, Sobol indices and a response surface of a beam
09_terrain_route_3d A road over a raster Field, optimised to trade climb against length
10_plume_dispersion A Gaussian plume under uncertain wind and a map of exceedance probability
11_time_series_process An Ornstein Uhlenbeck process fitted to data and a path dependent quantity
12_power_grid_network DC power flow under uncertain wind with line reinforcement as binary decisions

Gallery

Site plan and acceptance distributions An expression and its gradient
Distribution families and a Weibull fit Signed distance map and smooth containment
Flood damage histogram and exceedance curves Calibrated cooling curve, loss and profile likelihood
Optimised turbine layout over a noise map Response surface in 3D and Sobol indices
Plume in 3D and exceedance probability map Temperature paths and degree hours
Grid line overload before and after reinforcement Road over terrain in 3D

License

The example scripts and figures in this repository are released under the MIT License, see LICENSE.

prophys itself is proprietary software by RhineQC GmbH. It includes a free tier for models of up to 250 structural objects, such as points, polygon vertices, raster cells and network nodes. Monte Carlo samples, observations and optimiser steps never count towards that limit. Larger models need a signed license from RhineQC.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors