Companion film
Dispatch the battery
Change the evening price spike and watch hourly charge and discharge choices roll into a new daily P&L.
19 secGrid 0.61.0
Open film page →Canonical Grid model
Lamp-works pricing desk: SOLVE goal-seek to a profit target, bounded SOLVE MAXIMIZE, and lambda optimizers GOALSEEK and MINIMIZE.
What this model gives you
20 min to study · Source reviewed 2026-08-24
Continue with guided practiceExpected checkpoint
After loading the canonical source with its authored candidate values.
The chosen interval selects the intended price region when the equation has multiple mathematical answers.
SOLVE writes answers to result cells while candidate price and run-size inputs remain available for comparison.
Unit cost, fixed cost, demand, and sensitivity remain upstream dependencies of every recommendation.
MODEL "Goal-Seek And Optimization"
DESCRIPTION "Lamp-works pricing desk: SOLVE goal-seek to a profit target, bounded SOLVE MAXIMIZE, and lambda optimizers GOALSEEK and MINIMIZE."
VERSION "1.0.0"
AUTHOR "Grid Team"
TAGS "canonical", "solve", "goalseek", "optimization"
# Inputs — monthly economics for one desk-lamp line
A1 IS currency = 38
A2 IS currency = 24000
A3 = 2200
A4 = 9
A5 IS currency = 120
A6 = 900
# Candidate-price economics (linear demand: units fall A4 per currency of price)
B1 = MAX(A3 - A4 * A5, 0)
B2 IS currency = A5 * B1
B3 IS currency = B2 - (A1 * B1 + A2)
B4 IS currency = (B1 / A6) * 1800 + 0.65 * A6 / 2
# SOLVE statements — variable cells A5/A6 are never mutated; each result
# cell receives the solved value, and edits upstream re-solve reactively.
SOLVE C1 = A5 IN [40, 140] GOAL B3 = 30000
SOLVE C2 = A5 IN [40, 240] MAXIMIZE B3
SOLVE C3 = A6 IN [100, 4000] MINIMIZE B4
# Economics at the profit-maximizing price
D1 = MAX(A3 - A4 * C2, 0)
D2 IS currency = (C2 - A1) * D1 - A2
# Function-form optimizers over lambdas rather than cells
E1 = GOALSEEK(p => (p - A1) * MAX(A3 - A4 * p, 0) - A2, 0, 40, 140, 0.0001, 200)
E2 = MINIMIZE(q => (D1 / q) * 1800 + 0.65 * q / 2, 100, 4000, 0.001, 200)
E3 IS currency = (D1 / E2) * 1800 + 0.65 * E2 / 2
# Readout
F1 = B3 >= 0.9 * D2 THEN "near-optimal" ELSE "reprice"
F2 = `breakeven={E1} target_price={C1} best_price={C2} run_size={C3} batch={E2}`
END MODEL