G-SET PV Plant Simulation Engine
Version: 1.0.5 | License: MIT | Python: 3.10+
Physics-accurate rooftop solar PV simulation engine for education and research. Developed by the G-SET Research Unit, Kasetsart University Sriracha Campus. www.g-set.education
Overview
pvsim_engine.py simulates a rooftop PV system on a commercial building
at any geographic location. Default parameters are calibrated for
Bangkok, Thailand (13.75°N, 100.52°E, UTC+7).
Every variable is computed from physical first principles at configurable time resolution (default: 5 minutes), producing a time-series dataset suitable for energy analysis, IoT prototyping, and hands-on teaching.
Physics Models
| Component | Model | Reference |
|---|---|---|
| Solar irradiance | ASHRAE clear-sky (Spencer declination, Kasten–Young air mass) | ASHRAE HOF 2009 |
| Cloud cover | Mean-reverting Markov chain | — |
| Cell temperature | Faiman model | PVGIS / Faiman (2008) |
| Ambient temperature | Sinusoidal diurnal + Gaussian noise | — |
| Building load | Dual-Gaussian (Bimodal) + First-Order Low-Pass Filter | — |
| PV power output | Temperature-corrected STC efficiency | IEC 61215 |
| Electricity tariff | Time-of-Use (TOU) — On-Peak / Off-Peak | PEA Thailand (default) |
Location Support
The solar geometry engine is fully location-aware.
Simulate any site by passing latitude_deg, longitude_deg, and
timezone_offset_h, or use a built-in LocationPreset:
| Preset key | City | Latitude | Longitude | UTC |
|---|---|---|---|---|
'bangkok' |
Bangkok, Thailand | 13.75°N | 100.52°E | +7 (default) |
'tokyo' |
Tokyo, Japan | 35.68°N | 139.69°E | +9 |
'london' |
London, UK | 51.51°N | 0.13°W | 0 |
'sydney' |
Sydney, Australia | 33.87°S | 151.21°E | +10 |
'dubai' |
Dubai, UAE | 25.20°N | 55.27°E | +4 |
'new_york' |
New York, USA | 40.71°N | 74.01°W | -5 |
Any unlisted location can be simulated by passing coordinates directly in
override_params— no preset is required.
Building Load Presets
| Preset key | Typical use | peak_load |
Peak hours |
|---|---|---|---|
'residential' |
Home / apartment | 2.0 kW | Morning + Evening |
'office' |
Commercial office | 3.0 kW | Business hours only |
'retail' |
Shop / mall | 4.0 kW | All-day + evening surge |
'factory' |
Industrial / 2-shift | 8.0 kW | Narrow shift peaks |
Three-Season Presets (Bangkok default)
| Season | Key | Period | cloud_mean |
temp_base_c |
wind_speed_mean_ms |
|---|---|---|---|---|---|
| Hot-Dry | 'summer' |
Mar–May | 0.20 | 33.0 °C | 1.8 m/s |
| Monsoon | 'rainy' |
Jun–Oct | 0.70 | 30.5 °C | 3.5 m/s |
| Cool-Dry | 'winter' |
Nov–Feb | 0.15 | 26.5 °C | 3.0 m/s |
Quick Start (Google Colab)
# Step 1 — load engine
!wget -q -O pvsim_engine.py https://raw.githubusercontent.com/YOUR-USERNAME/pviot-workshop/main/pvsim_engine.py
%run pvsim_engine.py
# Step 2 — fix random seed for reproducibility
set_seed(42)
# Step 3 — simulate (Bangkok default)
data = run_season('summer')
plot_single_season(data, 'summer')
print_financial_summary('summer', data)
With location and building type
# Office building in Tokyo
set_seed(42)
data = run_season('summer',
location='tokyo',
building_type='office',
temp_base_c=28.0)
# Factory in London — custom coordinates
set_seed(42)
data = run_days('winter', n_days=14,
latitude_deg=51.51,
longitude_deg=-0.13,
timezone_offset_h=0.0,
building_type='factory',
temp_base_c=8.0,
cloud_mean=0.65)
# Adjust figure size in Colab
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (12, 8)
plt.rcParams['figure.dpi'] = 80
Parameter override
override_params = {
# location
# 'location' : 'tokyo',
# building
# 'building_type' : 'office',
# cloud
# 'cloud_mean' : 0.50,
# temperature
# 'temp_base_c' : 30.0,
# PV panel
'pv_capacity_kw' : 5.0, # auto-derives area
# 'eta_stc' : 0.22, # premium panel
# tariff
# 'tou_on_peak_rate' : 4.18,
}
set_seed(42)
data = run_season('summer', **override_params)
Key Functions
| Function | Description |
|---|---|
set_seed(seed) |
Fix random seed for reproducibility |
run_season(season, **kw) |
Simulate one representative day |
run_days(season, n_days, **kw) |
Simulate multiple consecutive days |
get_financial_summary(season, data) |
Return energy/cost summary as dict |
print_financial_summary(season, data) |
Print formatted summary |
save_simulation_to_csv(data, filename) |
Export to CSV |
plot_single_season(data, season) |
4-panel season chart |
plot_season_comparison(dict) |
Three-season overlay chart |
For full parameter tables and class references, see api_reference.md.
Credits
Kullawadee Somboonviwat, Ph.D. kullawadee.som@ku.th
G-SET Research Unit Faculty of Engineering at Sriracha, Kasetsart University www.g-set.education
MIT License — see LICENSE file for details.
Metadata
Release files for pvsim-engine 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pvsim_engine-1.0.5.tar.gz | 25.4 kB | With provenance | Details for pvsim_engine-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pvsim_engine-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for pvsim_engine-1.0.5-py3-none-any.whl |
Total release size: 43.6 kB
Release files / pvsim_engine-1.0.5.tar.gz
| Download URL | pvsim_engine-1.0.5.tar.gz |
|---|---|
| Size | 25.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9659d0855882bfcfdc113fa3079fc0978d4ba8ba8739de053aadae4ee0e4572
|
|
BLAKE2b-256 checksum How to use checksums |
cc897fcb5020823c54c4ffb467422fa7435e1ae0d8699ac7f436b188efc9f10a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 1, 2026.
Transparency logRelease files / pvsim_engine-1.0.5-py3-none-any.whl
| Download URL | pvsim_engine-1.0.5-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b2db5b29f3b2a868209507f087a7978e00eb582cc0d68445f37304118c0e0586
|
|
BLAKE2b-256 checksum How to use checksums |
c1b8840cbd45bd1ae5de04de783d9632f32f68527aad0cc1099aa9496e600797
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 1, 2026.
Transparency logSecurity for pvsim-engine 1.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pvsim_engine-1.0.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.