Examples¶
The example collections consist of standalone Marimo notebooks. Each link opens an executed, non-interactive HTML snapshot containing the notebook code and outputs.
Modeling primers¶
Analytic quadratic compares epsilon-relaxed solutions with a closed-form lower response.
Optimistic linear program shows how the upper problem selects among tied lower optimizers.
Parameter-dependent SOCP derives a geometric response and inspects parameter-dependent canonical data.
Best-of local optima compares a deterministic local solve with several complete randomized runs.
Applications¶
Ridge hyperparameter selection selects a training penalty using validation loss.
Demand-response pricing designs a time-of-use price while anticipating flexible energy use.
Renewable-capacity planning trades capacity investment against lower-level electricity dispatch using a compact synthetic daily profile.
Traffic tolling selects tolls while anticipating a congestion equilibrium.
Stackelberg port security allocates limited patrol coverage against a best-responding attacker.
Planar truss sizing allocates member areas while anticipating elastic equilibrium.
DC motor MPC tuning learns control-cost weights while anticipating a constrained MPC response.
Clean-equipment rebates design a rebate while anticipating a producer’s clean and fossil input choices under Cobb–Douglas production.
Carbon-tax abatement sets a carbon tax while anticipating sector-level abatement with exponential costs.
Advanced examples¶
Advanced examples are published as a separate nested collection and may use advanced features or take longer to run.
Real-data examples¶
Stigler food pricing uses the OR-Tools Stigler food table in a Stackelberg markup model.
Iris SVM regularization selects regularization for a linear classifier trained on the corrected UCI Iris data.
Tourism-seasonality levies designs monthly levies while travelers redistribute 2025 EU-27 tourist accommodation nights from Eurostat.
Renewable-capacity planning with German grid data applies the capacity model to an observed day of German demand, wind, and solar generation.
Polishing workflows¶
Ridge-polishing decision 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 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.
For live interaction, install and open the complete example workspace from a repository checkout:
make marimo