Skip to main content

Lab 7 — Energy Grid Management

Skills: 4, 5, 12

Introduction

In this lab, you're developing the management system for a smart renewable energy grid. The system tracks solar panels, wind turbines, battery storage units, and energy consumption across multiple facilities. You have been given the following data definitions to work with:

# DEFINITION
data EnergySource:
| solar-panel(location :: String, capacity :: Number, efficiency :: Number, hours-sunlight :: Number)
| wind-turbine(location :: String, capacity :: Number, wind-speed :: Number, operational :: Boolean)
| battery-storage(location :: String, max-capacity :: Number, current-charge :: Number, charge-rate :: Number)
| energy-consumer(location :: String, demand :: Number, priority :: String, building-type :: String)
end

# EXAMPLES
empty-grid = empty

residential-grid = [list:
solar-panel("Roof A", 10, 85, 8),
battery-storage("Garage", 50, 30, 5),
energy-consumer("House 1", 15, "high", "residential")]

industrial-grid = [list:
solar-panel("Factory Roof", 100, 90, 7),
wind-turbine("Hill Site", 150, 25, true),
wind-turbine("Coast Site", 200, 30, true),
battery-storage("Main Storage", 500, 200, 25),
battery-storage("Backup Storage", 300, 150, 15),
energy-consumer("Factory A", 80, "critical", "industrial"),
energy-consumer("Office Block", 25, "medium", "commercial"),
energy-consumer("Warehouse", 40, "low", "industrial")]

campus-grid = [list:
solar-panel("Library Roof", 50, 88, 6),
solar-panel("Gym Roof", 30, 82, 6),
wind-turbine("Campus Hill", 75, 20, false),
battery-storage("Central Battery", 200, 120, 20),
energy-consumer("Library", 35, "high", "educational"),
energy-consumer("Dorm", 45, "high", "residential"),
energy-consumer("Cafeteria", 20, "medium", "commercial")]

Problem 1

Design a function count-sources that counts the total number of energy sources in the given grid.

Problem 2

Design a function count-operational-turbines that counts only wind turbines that are operational.

Problem 3

Design a function total-solar-capacity that calculates the total capacity of all solar panels in a grid.

Problem 4

Design a function repair-all-turbines that sets all wind turbines to operational status.

Problem 5

Data centers are putting a strain on energy grids across the country. Currently around 4% of electricity goes to data centers. (For context: roughly 15% of energy use, including electricity, goes to residences.) This is expected to increase to 15% by 2028.

For more, see these articles:

In most cases, the costs of building out the power plants and new transmission lines to meet this new demand are passed onto the consumer.

When data centers use more energy, this leaves less energy for things like air conditioning, heating, and lighting. Imagine your analysis of the energy grid reveals that data centers are using 10% of the local electricity. During the hot months of summer, when people are cranking their AC, this has contributed to power outages in certain neighborhoods. There is a proposal to add another data center which will bump data centers’ total energy use up to 13% of the local electricity. You estimate this addition will double the number of summer outages.

Part A

In order to assess the proposal, fill out the stakeholder matrix. Identify one more stakeholder. Identify at least two interests for each stakeholder.

StakeholdersInterests or Values
Vulnerable Populations (e.g. elderly)[to be filled in]
Standard Populations (e.g. healthy adults)[to be filled in]
[Additional stakeholder to be identified][to be filled in]

Part B

What are two conflicts of interests in your chart? For each case of conflict, which one do you think is more important? Why?

Part C

Do you think the additional data center should be added? Why or why not?