# Examples The gallery consists of standalone [Marimo](https://marimo.io/) notebooks from `examples/gallery`. Each link opens an executed, non-interactive HTML snapshot containing the notebook code and outputs. Published snapshots use $\epsilon_{\mathrm{target}}=10^{-5}$ to balance numerical validation and export time; live sessions can request tighter continuation targets. ## Modeling primers - {example}`Analytic quadratic ` compares epsilon-relaxed solutions with a closed-form lower response. - {example}`Optimistic linear program ` shows how the upper problem selects among tied lower optimizers. - {example}`Parameter-dependent SOCP ` derives a geometric response and inspects parameter-dependent canonical data. - {example}`Best-of local optima ` compares a deterministic local solve with several complete randomized runs. ## Applications - {example}`Ridge hyperparameter selection ` selects a training penalty using validation loss. - {example}`Demand-response pricing ` designs a time-of-use price while anticipating flexible energy use. - {example}`Renewable-capacity planning ` trades capacity investment against lower-level electricity dispatch. - {example}`Traffic tolling ` selects tolls while anticipating a congestion equilibrium. - {example}`Stackelberg port security ` allocates limited patrol coverage against a best-responding attacker. - {example}`Planar truss sizing ` allocates member areas while anticipating elastic equilibrium. - {example}`DC motor MPC tuning ` learns control-cost weights while anticipating a constrained MPC response. ## Advanced examples Advanced examples are available as source notebooks in the repository. They are checked statically and executed during release validation, but are not published with the gallery. - [Ridge-polishing decision](https://github.com/dxogrp/blvpy/blob/main/examples/advanced/ridge_polishing.py) retrains a validation-selected ridge model at its fixed penalty, then lets the user choose between lower-level feasibility and a better relaxed validation objective. - [Low-carbon blend polishing](https://github.com/dxogrp/blvpy/blob/main/examples/advanced/low_carbon_blend_polishing.py) designs material rebates for a constrained producer, rejects a coarse polished response, tightens continuation, and explicitly adopts the candidate that passes a quantitative deployment gate. - [Clean-equipment rebates](https://github.com/dxogrp/blvpy/blob/main/examples/advanced/clean_equipment_rebate.py) uses a three-dimensional power cone to design a rebate while anticipating a producer's clean and fossil input choices under Cobb--Douglas production. - [Carbon-tax abatement](https://github.com/dxogrp/blvpy/blob/main/examples/advanced/carbon_tax_abatement.py) sets a carbon tax while anticipating sector-level abatement with exponential costs represented by exponential cones. Browse all [repository examples](https://github.com/dxogrp/blvpy/tree/main/examples). For live interaction, install and open the complete example workspace from a repository checkout: ```shell make marimo ```