Skip to main content

This component was initially created by Cornelius Steinbrink based on PyPVSim by Daniel Soto, which is licensed under CC-BY 3.0). It was further extended by Thomas Raub and updated by Jan Sören Schwarz and Danila Valko.

The PV system simulator calculates active power output based on the Direct Normal Irradiance (DNI, [W/m2]) input and current time (hourly).

PV system output data:

  • P[MW] - active power produced

PV system input data:

  • DNI[W/m2] - Direct Normal Irradiance

  • scale_factor - multiplies output [coef], might be used as a contol signal

Configuration:

  • latitude [grad]

  • area - insolated panels area [m2]

  • efficiency [coef]

  • el_tilt - elevation [grad]

  • az_tilt - azimuth [grad]

An example scenario is located in the ´demo´ folder.

Other options

Please pay attention to the input data. If you want to use only Direct Normal Irradiance input data as part of the co-simulation, then mosaik-pv is suitable, if you want to use full weather information (global irradiance, wind speed, air temperature and pressure) then mosaik-pvlib is suitable. If you are satisfied with historical performance estimates for a particular location or have no other input data, then mosaik-pvgis is the best solution which is based on PVGIS performance data.

Installation

pip install mosaik-pv

If you don’t want to install this through PyPI, you can use pip to install the requirements.txt file:

pip install -r requirements.txt
  • To use this, you have to install at least version 3.2.0 of mosaik.

  • It is recommended, to use the mosaik-csv library to properly import DNI data.

How to Use

Specify simulators configurations within your scenario script:

LAT = 32.0
AREA = 1
EFF = 0.5
EL = 32.0
AZ = 0.0
START = "2014-01-01 01:00:00"
END = 3600 * 24
STEP_SIZE = 60 * 60
DNI_DATA = "solar_data.csv"


SIM_CONFIG = {
    'DNISim': {
        'python': 'mosaik_csv:CSV'
    },
    'PVSim': {
        'python': 'mosaik_components.pv.pvsimulator:PVSimulator'
    },
    ...
}

Initialize the PV- and DNI-simulator:

# Create DNI simulator
DNI_sim = world.start("DNISim",
                    sim_start=START,
                    datafile=DNI_DATA)

# Create PV system with certain configuration
pv_sim = world.start(
                    "PVSim",
                    start_date=START,
                    step_size=STEP_SIZE)

Instantiate model entities:

DNI_model = DNI_sim.DNI.create(1)

pv_model = pv_sim.PV.create(1, latitude=LAT, area=AREA,
                        efficiency=EFF, el_tilt=EL, az_tilt=AZ)

Connect DNI input with PV-simulator:

world.connect(
                    DNI_model[0],
                    pv_model[0],
                    ("DNI", "DNI[W/m2]"),
                )

CSV-Formatting

For the simulator to work correctly, both .csv files have to be specifically formatted!

DNI-data

The meteo_data.csv is formatted accordingly to the conventions of the mosaik_csv simulator:

Wind
Date,wind_speed
YYYY-MM-DD HH:mm:ss,v1
YYYY-MM-DD HH:mm:ss,v2
...
DNI
Time,DNI
YYYY-MM-DD HH:mm:ss,2.1,92.0,0.0,0.0
  • Each entry in the .csv needs a Date in the YYYY-MM-DD HH:mm:ss format and a set of values.

Changelog

1.2.2 - 2025-10-13

  • Removed direct dependency on mosaik; only mosaik_api_v3 is required directly.

1.2.1 - 2024-03-06

  • Minor changes: scipy dependance was removed

1.2 - 2024-02-13

  • Naming convention fixed

  • Minor changes

1.1 - 2024-01-11

  • Restructured as a mosaik component

  • Active power output in [MW]

  • scale_factor added as input

  • Readme and examples added

1.0 - 2023-05-10

  • Initial release of version implemented by Cornelius Steinbrink

Authors

The adapter was initially developed by Cornelius Steinbrink based on solution by Daniel Soto, extended by Thomas Raub and updated by Jan Sören Schwarz and Danila Valko.

Metadata

Release files for mosaik-pv 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mosaik-pv 1.2.2
File Size Uploaded
mosaik_pv-1.2.2.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mosaik-pv 1.2.2
File Interpreter ABI Platform
mosaik_pv-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / mosaik_pv-1.2.2.tar.gz

Download URL mosaik_pv-1.2.2.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c59e6c8fd88227a90d5faf29c5fb85ca85ccf4258698b09ed74d746a5b3f1a02
BLAKE2b-256 checksum
How to use checksums
563480e6b71939723ae600c7253789775232a69e0fc5d494f5ef25dd7f4280f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.10.19 Linux/5.15.154+

Release files / mosaik_pv-1.2.2-py3-none-any.whl

Download URL mosaik_pv-1.2.2-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ebff5d5cdd70e132acd7a5eda91eab2825fc5d21ae663ebd2f5745e6d76a02d2
BLAKE2b-256 checksum
How to use checksums
52fde9ed91971d2d4f949184aad5ba2c60b90c64d9fda0f92262573780415d31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.10.19 Linux/5.15.154+

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files

1.2.1

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page