You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This section is a draft to be revised and expanded.
5
6
6
-
There are a few example python scripts using PySAM in the Examples directory of the github repository.
7
+
For PySAM code examples see the `PySAM repository on GitHub <https://github.com/NREL/pysam/tree/master/Examples>`_.
7
8
8
-
Accessing Variables
9
-
*******************
9
+
Generate Inputs for a REopt API Call
10
+
-------------------------------------
10
11
11
-
All variables in a PySAM class are organized into subclasses called Groups.
12
-
There are several ways to access a variable. The subclass and variable names
13
-
and descriptions are given in the :doc:`Models` documentation.
12
+
The Pvwattsv8 and Pvsamv1 compute modules, when used in a configuration with battery storage, have and option to size and dispatch the battery using the `ReOpt API <https://developer.nrel.gov/docs/energy-optimization/reopt-v1/>`_.
14
13
15
-
Variables may be accessed directly as `<class>.<subclass>.<variable>`.
16
-
For example, `the solar_resource_file` which is part of the subclass `SolarResource` group in Pvwattsv7::
14
+
This basic code example shows how to use the ``Reopt_size_battery_post()`` function in preparation for a call to the REopt API. The function returns a dictionary of REopt inputs that can be converted to JSON for the API call. A complete model would require the ``Utilityrate5`` compute module for electricity bill calculations, and the ``Cashloan`` module for cash flow calculations.
17
15
18
-
import PySAM.Pvwattsv8 as pv
19
-
20
-
system_model = pv.new()
21
-
system_model.SolarResource.solar_resource_file
22
-
23
-
24
-
Groups and variables can also be accessed using `getattr`. Variables can be set with `setattr`::
0 commit comments