This repository contains reproducible code for the reduced-form numerical illustration accompanying a framework manuscript on Performance-Based Food Engineering (PBFE). The full conceptual framework distinguishes environmental hazard, latent plant response, damage state, physical or operational consequence, stakeholder decision variable, strategy, context, observations, and history. The code here implements a deliberately reduced synthetic path; it is not an end-to-end PBFE validation.
The latest published release is v1.2.0, released September 22, 2026 (UTC). The v1.1.0 tag remains at commit 03127e530870e4fe91f5b8c8ad28b7abf574e3a0; its original numerical code, tests, outputs, figures, and dependencies are unchanged. Current citation metadata identify v1.2.0, with the historical v1.1.0 citation hash preserved in the release provenance.
v1.2.0 publishes the reviewed revision additions. See revision/README.md for the D0–D4 results for S0, S_R, and S_Q; nominal Table 3; joint-COV and one-module gamma screens; full-precision references; and saved-data plotting/reproduction instructions. Release notes and provenance list the changes and validation status.
The following baseline/UQ sections describe the published v1.1.0 material. The new revision keeps each drought state separate and adds synthetic state/case comparisons; it does not introduce hazard-occurrence weights or an empirical intervention ranking.
The deterministic baseline implements
IM -> PRP (LAI) -> Q proxy (TFP) -> DV (normalized loss).
It uses finite-domain conditional distributions and direct discrete probability propagation. The authoritative baseline result at the illustrative loss limit DV = 1 is
P(DV > 1) = 0.09591450211754649
The baseline does not use Monte Carlo sampling. Running src/pbfe_numerical_example.py regenerates four baseline figures and outputs/numerical_summary.json.
The extension retains the direct discrete probability as authoritative and adds:
- an independent continuous Monte Carlo check;
- a first-order reliability method (FORM) approximation;
- local design-point directional cosines;
- six one-dimensional synthetic target-oriented multiplier families;
- a publication-facing target-oriented figure; and
- machine-readable diagnostics and tables.
The verified probability diagnostics are:
| Quantity | Value |
|---|---|
| Direct discrete probability | 0.09591450211754649 |
| Continuous Monte Carlo probability | 0.095851 |
| Monte Carlo Bernoulli standard error | 0.0002943867962375351 |
| Monte Carlo sample size | 1,000,000 |
| Monte Carlo seed | 20260810 |
| FORM reliability index, beta | 1.2255614575907634 |
| FORM probability | 0.11018187469032242 |
The governing FORM design point is
[-0.32200378393151086, -0.2670877121208008, 1.1519455731499912]
and the corresponding local directional-cosine vector is
[0.26273986295475965, 0.2179308317562805, -0.9399329321736364]
The six multiplier families separately vary the nominal mean or coefficient of variation (COV) for the LAI, TFP-link, and normalized-loss-link modules. The resolved crossings of the illustrative 5% exceedance level are:
| Multiplier | Resolved crossing |
|---|---|
r_mL |
1.649894453167797 |
r_mT |
1.3065074972957837 |
r_mD |
0.9302953633446296 |
r_cD |
0.7200710995853127 |
No 5% crossing was resolved for r_cL or r_cT in the extended numerical search. The r_cL profile was nonmonotonic. These findings do not prove that a crossing is mathematically impossible.
All parameter scenarios are synthetic and are not calibrated agricultural interventions. The FORM directional cosines are local diagnostics at the DV = 1 boundary, not global sensitivity indices or variance fractions.
This repository includes no empirical agricultural data, calibrated damage model, empirical economic model, or empirical strategy model. It establishes no real intervention or investment ranking and produces no annual agricultural risk estimate. The fixed D1 calculation is a conditional scenario, not an annual hazard-frequency model. No end-to-end PBFE validation is claimed.
PBFE-Framework/
├── README.md
├── CITATION.cff
├── requirements.txt
├── environment.yml
├── .gitignore
├── src/
│ ├── pbfe_numerical_example.py
│ ├── pbfe_uq_target_extension.py
│ └── generate_pbfe_target_scenarios_figure.py
├── tests/
│ ├── test_pbfe_numerical_example.py
│ └── test_pbfe_uq_target_extension.py
├── figures/
│ ├── illustrative_lai_distributions.png
│ ├── illustrative_tfp_distributions.png
│ ├── illustrative_loss_distributions.png
│ ├── synthetic_loss_exceedance.png
│ └── pbfe_target_scenarios.png
├── outputs/
│ ├── numerical_summary.json
│ └── uq_target_extension/
│ ├── pbfe_uq_target_diagnostics.json
│ ├── pbfe_uq_target_sensitivity_verification_table.csv
│ └── pbfe_uq_target_profiles_and_roots.csv
├── revision/ # v1.2.0 revision code, full-precision results and provenance
└── docs/
├── model_scope.md # Original v1.1.0 numerical scope
└── revision_release.md # v1.2.0 release contents and validation
The reference environment uses Python 3.9 and the dependency versions recorded in requirements.txt and environment.yml.
conda env create -f environment.yml
conda activate pbfepython3.9 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtThe original commands below write the existing output paths; use a disposable checkout if preserving committed reference files. Run them from the repository root:
# Baseline calculation and its five tests
python src/pbfe_numerical_example.py
python -m unittest -v tests/test_pbfe_numerical_example.py
# UQ and target extension and its sixteen tests
python src/pbfe_uq_target_extension.py
python -m unittest -v tests/test_pbfe_uq_target_extension.py
# Publication-facing target figure
python src/generate_pbfe_target_scenarios_figure.py
# Published v1.1.0 regression suite: 21 tests
python -m unittest discover -s tests -vThe extension writes only machine-readable files under outputs/uq_target_extension/. The target-figure generator reads those diagnostics and writes figures/pbfe_target_scenarios.png on the fixed display domain 0.5 <= r <= 2.0.
For the additional 10 revision tests, the read-only release-integrity check, saved-array plotting, and optional full revision reproduction, use revision/README.md. Release preparation runs regression checks without rerunning the full revision study or replacing reference outputs.
No empirical agricultural data are required or included. All numerical inputs are synthetic and are stated in the source code and docs/model_scope.md.
Please cite the associated PBFE manuscript once its final bibliographic information is available. Repository citation metadata are provided in CITATION.cff.
No software license has yet been assigned to this repository.
Khalid M. Mosalam (corresponding author): mosalam@berkeley.edu