Schema
These are JSON schemas for the model configuration, normalization factors, sensitivity loss configuration, clamping loss configuration, and trained model blocks. These appear in various files for a specific model:
In model_config.json, the section HWPV Model Configuration must appear. Optionally, Sensitivity Losses and Clamping Losses may appear. The user must create this file.
A training run creates normfacs.json at the beginning. The section Normalization Factors appears. The pecblocks package creates this file in a subdirectory that was specified in model_config.json.
A model export creates model_fhf.json in a subdirectory that was specified in model_config.json. The sections Block F1 or F2, Block H1, Block H1s, and Block Q1s appear. In addition, recognized sections from model_config.json and normfacs.json will be copied into model_fhf.json. The pecblocks package creates this file in the same directory as normfacs.json.
The user may add other JSON objects to model_config.json, but these are not copied into model_folder/model_fhf.json during model export.
HWPV Model Configuration
Training and evaluation parameters. This object is un-named, but it may have optional named objects clamping and sensitivity. |
|||
type |
object |
||
properties |
|||
|
Name of this model, usually PV3. Limited to 6 characters for ATP. |
||
type |
string |
||
|
Indicates the block structure, typically F1+H1+F2. |
||
type |
string |
||
|
Discretization time step, to match the HDF5 file. |
||
type |
number |
||
|
Path name to the exported model files. |
||
type |
string |
||
|
Root name for the exported model JSON file. |
||
type |
string |
||
|
Path and filename to the HDF5 data. |
||
type |
string |
||
|
Learning rate for the Adam optimizer in PyTorch. |
||
type |
number |
||
|
Numerical stability parameter for the Adam optimizer in PyTorch. |
||
type |
number |
||
|
Optional prefix to the case or event number in the HDF5 file, e.g., ‘case’, ‘scope’, or ‘’ |
||
type |
string |
||
|
Number of epochs to perform in the next training run. |
||
type |
integer |
||
minimum |
1 |
||
|
Start with the most recently trained model coefficients rather than randomized initial model coefficients. |
||
type |
boolean |
||
|
Number of training epochs between status messages printed to console. |
||
type |
integer |
||
|
The batch size for more efficient training in PyTorch. Typically no larger than 10% of the number of training cases in the HDF5 file. |
||
type |
integer |
||
minimum |
1 |
||
|
Percentage of HDF5 cases to reserve for non-optimized validation in each epoch |
||
type |
integer |
||
minimum |
5 |
||
|
A number to randomize the selection of HDF5 cases reserved for validation |
||
type |
integer |
||
|
Number of data points to ignore from the start of the HDF5 data series, before decimation. Typically 0 unless there is a long startup period for each series, as in some EMT simulators. |
||
type |
integer |
||
minimum |
0 |
||
|
Number of data points to ignore from the end of the HDF5 data series, before decimation. Typically 0 unless there is extraneous data at the end of each series. |
||
type |
integer |
||
minimum |
0 |
||
|
Decimation or down-sampling interval of the HDF5 data points to the data series used for training. Specify 1 for no down-smapling. |
||
type |
integer |
||
minimum |
1 |
||
|
Number of decimated points to skip at the beginning of each data series for the fitting and validation loss evaluation. Typically 50% the value of n_pad. |
||
type |
integer |
||
minimum |
0 |
||
|
Number of decimated points to pre-pad the training data series with initial input and output values. This helps mitigate startup transients in the H1 block. Typically 25% of the number of decimated points in the training data series. |
||
type |
integer |
||
minimum |
0 |
||
|
Linear filter form of the H1 block. |
||
type |
string |
||
enum |
iir, fir, stable2ndx, stable2nd |
||
|
Number of trainable denominator coefficients in H1. Excludes a0=1. Specify 2 for the stable2nd or stable2ndx gtype. |
||
type |
integer |
||
minimum |
1 |
||
|
Number of trainable numerator coefficients in H1. Specify 3 for the stable2nd or stable2ndx gtype. |
||
type |
integer |
||
minimum |
1 |
||
|
Number of delay steps in the output of H1. |
||
type |
integer |
||
minimum |
0 |
||
|
Nonlinear activation function in the F1 and F2 blocks. |
||
type |
string |
||
enum |
tanh, sigmoid, relu |
||
|
Number of hidden layer cells in the F1 block. Approximately equal to number of inputs, len(COL_U). |
||
type |
integer |
||
|
Number of hidden layer cells in the F2 block. Approximately equal to number of outputs, len(COL_Y). |
||
type |
integer |
||
|
Time point channel name, usually t |
||
type |
array |
||
items |
type |
string |
|
maxItems |
1 |
||
minItems |
1 |
||
|
Input channel names, minimally Vd and Vq for a Norton model, or Id and Iq for a Thevenin model. Usually G, T, Ctl, Fc, Ud, Uq, GVrms for a Norton model, GIrms for a Thevenin model. |
||
type |
array |
||
items |
type |
string |
|
minItems |
2 |
||
|
Output channel names, minimally Id and Iq for a Norton model, or Vd and Vq for a Thevenin model. Usually Vdc and Idc. |
||
type |
array |
||
items |
type |
string |
|
minItems |
2 |
||
Normalization Factors
Map all channels to the range 0-1 per-unit. pu = val * scale + offset This object is unnamed in a standalone normfacs.json file. Must be named normfacs when part of a model_fhf.json file. |
|||
type |
object |
||
additionalProperties |
type |
object |
|
properties |
|||
|
Scaling factor or weight. After normalization, the range will be 1.0 over all times and records. |
||
type |
number |
||
|
Mean channel value over all times and records. Defines the bias or offset in normalization. |
||
type |
number |
||
|
Minimum channel value over all times and records. |
||
type |
number |
||
|
Maximum channel value over all times and records. |
||
type |
number |
||
Sensitivity Losses
Add sensitivity losses to the fitting loss. The name of this object must be sensitivity. |
||||
type |
object |
|||
properties |
||||
|
Maximum value for partial derivatives, outputs w.r.t. inputs Units are ohms for a Norton model, mhos for a Thevenin model. (Deprecated in favor of the weight attribute because a stiff limit causes discontinuity in fitting loss vs. epoch). |
|||
type |
number |
|||
|
Per-unit multiplier for sensitivity loss added to fitting loss contributions to the total loss in each epoch. Use 0.001 as a starting value, then adjust so that contributions of the fitting and sensitivity losses, as shown in the log, are about equal. |
|||
type |
number |
|||
|
Change in the input values used to numerically estimate partial derivatives, outputs w.r.t. inputs. Units are the same as for input columns. Use about 0.001 of the input range. |
|||
type |
number |
|||
|
max |
|||
Column or channel names from COL_U. Typically Vd and Vq for a Norton model. Typically Id and Iq for a Thevenin model. |
||||
type |
array |
|||
items |
type |
string |
||
maxItems |
2 |
|||
minItems |
2 |
|||
|
max |
|||
Column or channel names from COL_Y. Typically Id and Iq for a Norton model. Typically Vd and Vq for a Thevenin model. |
||||
type |
array |
|||
items |
type |
string |
||
maxItems |
2 |
|||
minItems |
2 |
|||
|
Defines the polynomial feature for Thevenin models. This input varies with Id and Iq. Unused for Norton models. |
|||
type |
object |
|||
properties |
||||
|
Name of solar irradiance input channel, e.g., G |
|||
type |
string |
|||
|
Name of d-axis current input channel, e.g., Id |
|||
type |
string |
|||
|
Name of q-axis current input channel, e.g., Iq |
|||
type |
string |
|||
|
Multiplier for Irms from Id and Iq. Use sqrt(3/2) for three-phase, 1 for single-phase. |
|||
type |
number |
|||
|
Defines the polynomial feature for Norton models. This input varies with Vd and Vq. Unused for Thevenin models. |
|||
type |
object |
|||
properties |
||||
|
Name of solar irradiance input channel, e.g., G |
|||
type |
string |
|||
|
Name of d-axis voltage input channel, e.g., Vd |
|||
type |
string |
|||
|
Name of q-axis voltage input channel, e.g., Vq |
|||
type |
string |
|||
|
Multiplier for Vrms from Vd and Vq. Use sqrt(3/2) for three-phase, 1 for single-phase. |
|||
type |
number |
|||
|
Defines the baseline operating points for evaluating the model sensitivities, i.e., partial derivatives of the outputs w.r.t. inputs at each epoch. There should be one set for each channel in COL_U, excluding the polynomial feature GVrms or GIrms. Polynomial features are calculated from the other channels. |
|||
type |
object |
|||
additionalProperties |
Data values to use for this input channel in evaluating the sensitivity. Use judiciously to avoid combinatorial explosion. |
|||
type |
array |
|||
items |
type |
number |
||
minItems |
1 |
|||
Clamping Losses
Add clamping losses to the fitting loss. The name of this object must be clamping. |
|||
type |
object |
||
additionalProperties |
Define one set of limits for each output channel. First value is minimum, second value is maximum. |
||
type |
array |
||
items |
type |
number |
|
maxItems |
2 |
||
minItems |
2 |
||
Block F1 or F2
Neural network layers for static nonlinearities. |
||||
type |
object |
|||
properties |
||||
|
Number of input channels for this block. |
|||
type |
integer |
|||
minimum |
1 |
|||
|
Number of neurons in the hidden layer. |
|||
type |
integer |
|||
minimum |
1 |
|||
|
Number of output channels for this block. |
|||
type |
integer |
|||
minimum |
1 |
|||
|
Activation function type for the neurons. |
|||
type |
string |
|||
enum |
tanh, sigmoid, relu |
|||
|
2D array of weights for the input layer, n_hid rows. |
|||
type |
array |
|||
items |
n_in columns |
|||
type |
array |
|||
items |
type |
number |
||
|
1D array of bias values for the input layer, n_hid rows. |
|||
type |
array |
|||
items |
type |
number |
||
|
2D array of weights for the output layer, n_out rows. |
|||
type |
array |
|||
items |
n_hid columns |
|||
type |
array |
|||
items |
type |
number |
||
|
1D array of bias values for the output layer, n_out rows. |
|||
type |
array |
|||
items |
type |
number |
||
Block H1
Multiple-input multiple-output (MIMO) transfer functions for H1(z) in discrete time domain. Defined pair-wise between input and output channels. |
|||
type |
object |
||
properties |
|||
|
Number of input channels for this block. |
||
type |
integer |
||
minimum |
1 |
||
|
Number of output channels for this block. |
||
type |
integer |
||
minimum |
1 |
||
|
Number of learnable numerator coefficients in each H(z). |
||
type |
integer |
||
minimum |
1 |
||
|
Number of learnable denominator coefficients in each H(z). In addition, a0=1 should be included; it’s not learnable. |
||
type |
integer |
||
minimum |
1 |
||
|
Number of delay steps in the output. |
||
type |
integer |
||
minimum |
0 |
||
|
Defines the coefficients by increasing order of z^(-1). Numerator coefficients are in objects named b_i_j, and Denominator coefficients are in objects named a_i_j, where i is the output channel number, 0..n_out-1, and j is the input channel number, 0..n_in-1. (For stable2nd and stable2ndx models, the named objects alpha1_i_j and alpha2_i_j also appear. These are defined for model training only, and not necessary for model evaluation. Their types are number, not array.) |
||
type |
array |
||
items |
type |
number |
|
minItems |
1 |
||
Block H1s
Multiple-input multiple-output (MIMO) transfer functions for H1(s) in continuous time domain. Defined pair-wise between input and output channels. |
|||
type |
object |
||
properties |
|||
|
Number of input channels for this block. |
||
type |
integer |
||
minimum |
1 |
||
|
Number of output channels for this block. |
||
type |
integer |
||
minimum |
1 |
||
|
Number of numerator coefficients in each H(s). |
||
type |
integer |
||
minimum |
1 |
||
|
Number of denominator coefficients in each H(s). |
||
type |
integer |
||
minimum |
1 |
||
|
Defines the coefficients by increasing order of s, beginning with 0. Numerator coefficients are in objects named b_i_j, and Denominator coefficients are in objects named a_i_j, where i is the output channel number, 0..n_out-1, and j is the input channel number, 0..n_in-1. |
||
type |
array |
||
items |
type |
number |
|
minItems |
1 |
||
Block Q1s
State transition matrices for H1(s) in continuous time domain. The state-space form is Ax_dot + Bu = x, y = Cx + Du. These are serialized as numpy arrays, squeezed to lists which cannot be validated in JSON Schema. Defined pair-wise between multiple input and multiple output (MIMO) channels. |
|||
type |
object |
||
properties |
|||
|
Number of input channels for this block. |
||
type |
integer |
||
minimum |
1 |
||
|
Number of output channels for this block. |
||
type |
integer |
||
minimum |
1 |
||
|
Number of columns in the A matrix. |
||
type |
integer |
||
minimum |
1 |
||
|
Number of rows in the A matrix. |
||
type |
integer |
||
minimum |
1 |
||
|
Matrices in objects named A_i_j, B_i_j, C_i_j, and D_i_j, where i is the output channel number, 0..n_out-1, and j is the input channel number, 0..n_in-1. |
||
type |
numpy array |
||
items |
type |
number |
|
minItems |
1 |
||