Honglin Li
  • Research
  • Projects
  • Publications
  • Software
  • Teaching
  • Learn
  • Notes
  • CV
  • Journeys

Where should a factory go when sun and wind are part of the decision?

When a factory can make and sell its own energy, its wind and sun become part of choosing where to build it

Case file CF1 of Energy Systems, Step by Step: when a factory can make and sell its own energy, its wind and sun become part of choosing where to build it.
  1. Learn
  2. CF1
  • Analyst · L2
  • Case file
  • 10 min
  • After lesson 10
  • Completed
  1. 1The case
  2. 2Explain
  3. 3Check
  4. 4Sources

1 · The puzzle

A factory usually goes where land is cheap and its customers are close. If it can make its own power and sell what it does not use, does a windy, sunny site far away start to look better?

2 · The question in one sentence

Where should a manufacturing supply chain place its facilities, and how much on-site wind, solar and storage should each facility install when facilities can trade energy with the grid?

Question type: prescriptive (where should it build, and what should each site install?).

3 · Scale and boundary

  • Inside: a stylized supply chain of factories, warehouses and retail stores, with candidate sites in California, Arizona and Nevada, over one year: production week by week, energy hour by hour (52 weeks of 168 hours).
  • Left out: real distances and costs, which are synthetic; grid outages; the rest of the grid, which enters through hourly buying and selling prices.

4 · Decisions, goal and rules, in words

  • Decisions: which candidate factories and warehouses to open, how products move through the network, how much wind, solar and storage each open site installs, and what it buys and sells every hour.
  • Goal: the lowest net cost of the supply chain (facilities, production, inventory, transport and energy), less what energy sales earn.
  • Rules: each open site balances its energy every hour; weekly store demand is met at a set service level (a chance constraint).

5 · Data and method

  • A mixed-integer model opens factories and warehouses, routes products and sizes each open site's wind, solar and storage, with an hourly energy balance and grid trade.
  • Uncertain weekly store demand enters as a chance constraint with a set service level, written as its deterministic equivalent, so the model stays a mixed-integer linear program.

6 · What came out, and where it holds

When each facility can install its own wind, solar and storage and trade energy with the grid, a candidate site's renewable resource affects its operating cost.

Because the transactive energy market brought a new revenue stream, locations with stronger renewables became competitive to establish facilities despite higher fixed and logistics cost.

Transactive energy, time-of-use tariffs and climate conditions played a critical role in locating factories, warehouses, wind turbines, solar photovoltaics and energy storage systems.

Contrary to intuition, energy storage systems, which balance intermittent power and uncertain load, had limited benefits for cost saving.

Approved excerpt of: Li et al. (2023), Applied Mathematical Modelling.
  • Holds when: stylized networks with synthetic distances and costs, candidate sites in California, Arizona and Nevada, and one year, planned week by week for products and hour by hour for energy.
  • Leaves out: grid outages, which the studies do not model.

The studies in time

  1. February 2023 · Journal article (this case). Factories, warehouses and their on-site microgrids are sited and sized together, for a three-tier supply chain over one year; published online in February 2023, in the July 2023 issue. Source: Li et al. (2023), Applied Mathematical Modelling 119, 119–136
  2. June 2023 · Conference paper. A two-tier version locates warehouses and sizes their microgrids, with electric-truck routing and electricity trading. Source: Li et al. (2023), SEGRE 2023, 410–415
  3. 30 October 2026 · Code released. A documented, runnable implementation of the location models, with synthetic examples (version 1.0.1). Source: supply-chain-microgrid-models on GitHub, as of 3 November 2026

Every result about the studies is quoted from approved excerpts of the published papers named in the sources. The toy below uses illustrative round numbers.

The idea behind it, then where the result holds

One factory, two sites (illustrative)

The toy's two sites (illustrative, 2025 dollars)
Near site Windy site
Site and building, a year $1.00M $1.15M
Shipping to the stores, a year $0.60M $1.00M
Wind capacity factor 25% 42%
Solar capacity factor 18% 26%

Both: a flat 3 MW factory load; grid power bought at $80/MWh; wind $170,000 and solar $85,000 per MW a year; room for up to 8 MW of each.

Which site wins, and what each builds (the toy, a year)
Setting Cheaper site Near site builds Windy site builds
No on-site energy Near site, by $550k a year – –
Spare energy sold for nothing Near site, by $83k a year 0 MW wind · 5 MW solar 5 MW wind · 2 MW solar
Spare energy sold for $25/MWh Near site, by $31k a year 0 MW wind · 6 MW solar 5 MW wind · 3 MW solar
Spare energy sold for $40/MWh Windy site, by $93k a year 0 MW wind · 7 MW solar 7 MW wind · 8 MW solar

The toy's wind and sun take the shapes of SPP's real 2025 hours (EIA-930), scaled to each site's capacity factor; its costs are illustrative, in 2025 dollars.

It has no storage and no outages. It assumes the grid takes every spare unit at the chosen price, with no connection limit or extra charge.

Two costs pull apart

Cost What sets it Which site it favours in the toy
Site, building and shipping land prices and the distance to the stores the near site
Energy, net of sales the site's wind and sun, the grid's buying price, and what spare energy earns the windy site, once each site can build wind and solar; selling spare energy can make this saving outweigh its higher site and shipping costs

Every hour counts on its own: energy made when the factory needs none is worth only what the grid pays for it.

One hour, for example: a 3 MW load with 2 MW made on site buys 1 MW for that hour, which is 1 MWh; with 5 MW made, it sells 2 MWh.

Where the result holds

It holds when
  • stylized supply-chain networks with synthetic distances and costs;
  • candidate sites in California, Arizona and Nevada;
  • products planned week by week and energy hour by hour over one year;
  • the modeled time-of-use tariffs and grid buying and selling prices.
It leaves out
  • grid outages, which the studies do not model;
  • real distances and costs, which are synthetic.

From the approved excerpt of Li et al. (2023), Applied Mathematical Modelling.

Go deeper · ModelerChoosing sites and sizes in one program
  • Opening a site is a yes-or-no choice, so a location model is a mixed-integer program: lesson 10 introduces decisions, a goal and rules, and lesson 11 solves a mixed-integer program.
  • The toy above tries every pair of whole-MW sizes at two sites; a solver searches far larger networks without listing every choice.
  • Lesson F7 builds an hourly energy balance by hand, and Modeler lesson M5 sizes a microgrid with a solver.

Check yourself, then try it

Myth or fact? “The site nearest the customers is always the cheapest place for a factory.”

  • Myth
  • Fact
Answer

Myth. In the toy, once spare energy earns $40/MWh, the windy site wins by $93k a year, though its site and shipping cost $550k more.

Myth or fact? “A factory with its own wind and solar no longer needs the grid.”

  • Myth
  • Fact
Answer

Myth. Even with 7 MW of wind and 8 MW of solar, the windy site still buys 1,881 MWh a year in hours when its wind and solar together fall short of the load, and sells 19,576 MWh.

Try it yourself

Optional, about 30 minutes; needs Python on your computer (lesson B2).

  • Run examples/sensitivity.py. It solves a synthetic supply chain in several cases: compare the benchmark row with "grid supply only". Do the open factories or warehouses change?
  • Predict first, then read the "purchase price +25%" row: does on-site wind and solar photovoltaic (PV) capacity grow or shrink?

supply-chain-microgrid-models: public example repository · MIT licence · synthetic data.

Sources and what’s next

Keep going

Back to the course map

Where this came up before

Lesson F7 islanded a campus, and A14 asked whether its microgrid pays. This case puts on-site energy inside a larger choice: where to build.

Sources and further reading

  • Li et al. (2023). Facility and microgrid location-allocation for integrated supply chain and transactive energy operations. Applied Mathematical Modelling 119, 119–136.
  • Li et al. (2023). Locating and Allocating Warehouse Facilities and Prosumer Microgrid in Transactive Energy Paradigm. 2023 International Conference on Smart Electrical Grid and Renewable Energy (SEGRE), 410–415.
  • supply-chain-microgrid-models on GitHub, version 1.0.1 (30 October 2026).
  • EIA. Hourly Electric Grid Monitor (Form EIA-930), SPP wind and solar, 2025: the toy's hourly shapes.

Spotted an error, or stuck? Write to hlli@ksu.edu. Corrections are made in place and dated here.

Text licensed CC BY 4.0, code MIT: teachers and students may reuse and adapt it, with credit to Honglin Li.

© 2026 Honglin Li · Kansas State University · hlli@ksu.edu

 

Last updated: November 2026 · Built with Quarto