COSA is an agent-based model (ABM) for simulating the adoption of rooftop photovoltaic (PV) systems in urban environments, with a focus on community solar installations. The model captures how building owners decide whether to install PV individually or jointly in a community PV installation based on economic, social, and attitudinal factors.
Community solar enables multiple electricity users to share PV systems across buildings, unlocking economies of scale and higher self-consumption rates. COSA simulates the decision-making of building owners to evaluate how different policy designs influence PV adoption in cities.
COSA uses input from the open-source urban building energy model City Energy Analyst (CEA), as well as socio-economic and geographical information system (GIS) data.

For the case of the Alt-Wiedikon neighborhood in Zurich, Switzerland:
COSA takes inputs from the CEA model, socio-economic and GIS data, and runs simulations based on policy scenairos following three main processes executed each time step (year):

| State | Description |
|---|---|
| Grid Consumer | No PV installed |
| Grid Prosumer | Individual PV installation |
| Community Prosumer | Member of a community PV installation |
Simulations are configured through JSON experiment files containing:
| Term | Description |
|---|---|
| Experiment | Simulation inputs defined in JSON file |
| Scenario | Unique combination of simulation parameters |
| Batch | Set of simulation runs for one scenario |
| Run | Single deterministic simulation |
| Timestep | One year in the simulation |
COSA was designed to evaluate community solar policy designs. The published study analyzed three scenarios:
| Scenario | Community Solar | Eligibility Rule |
|---|---|---|
| IND | Not allowed | — |
| ZCS | Allowed | Buildings in same zone (no street crossing) |
| RCS | Allowed | Buildings within 100-meter radius |
COSA/
├── main.py # Main entry point
├── COSA_Model.py # SolarAdoptionModel class
├── COSA_Agent.py # BuildingAgent class
├── COSA_Tools.py # Economic evaluation, data collection, utilities
├── COSA_Data/ # Input data (building profiles, prices, etc.)
└── COSA_Outputs/ # Simulation results
COSA requires the following input data:
Note: The model was applied to Alt-Wiedikon district in Zurich, Switzerland. Large input files are not included in the repository.
If you use COSA in your research, please cite the following paper:
@article{NunezJimenez2023,
author = {Nuñez-Jimenez, Alejandro and Mehta, Prakhar and Griego, Danielle},
title = {Let it grow: How community solar policy can increase PV adoption in cities},
journal = {Energy Policy},
volume = {175},
pages = {113477},
year = {2023},
doi = {10.1016/j.enpol.2023.113477}
}
📄 Paper: Energy Policy (2023)
This project is licensed under the MIT License — see the LICENSE file for details.
For questions or collaboration inquiries, please open an issue or contact the authors through the corresponding author information in the published paper.