> For the complete documentation index, see [llms.txt](https://vc-docs.gitbook.io/engine/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vc-docs.gitbook.io/engine/home/doxygen_synced/classes/class_p_v_calculations.md).

# PVCalculations

**Usage:** `api.PVCalculations.CalculatePIV(json, ok => {})`

Build and compare PV (solar panel) system models, and read the results of the latest PV curve.

## Public Functions

|        | Name                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| string | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_p_v_calculations.md#function-systemmodeltojson"><strong>SystemModelToJSON</strong></a>(EPESerializeData data)<br>Converts a system model to a JSON string.</p>                                                                                                                                                                                               |
| string | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_p_v_calculations.md#function-systemmodeltojson"><strong>SystemModelToJSON</strong></a>(Array pvarrays, Array moduleNames, Array ir\_data, Array temp\_data, Array npar, Array nser, bool bypassDiodes)<br>Builds a system model from arrays and converts it to a JSON string. Each array is indexed \[array]\[module] and all must have matching shapes.</p> |
| int    | [**CalculatePIV**](https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_p_v_calculations.md#function-calculatepiv)(string json, Action< bool > onCompleted)                                                                                                                                                                                                                                                                   |

## Public Attributes

|               | Name                                                                                                                                                                                                                                       |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| List< float > | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_p_v_calculations.md#variable-i_data"><strong>I\_Data</strong></a><br>Current (I) values of the most recently calculated curve.</p>       |
| List< float > | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_p_v_calculations.md#variable-v_data"><strong>V\_Data</strong></a><br>Voltage (V) values of the most recently calculated curve.</p>       |
| List< float > | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_p_v_calculations.md#variable-p_data"><strong>P\_Data</strong></a><br>Power (P) values of the most recently calculated curve.</p>         |
| int           | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_p_v_calculations.md#variable-mpptindex"><strong>MPPTIndex</strong></a><br>Index of the maximum-power point in the most recent curve.</p> |

## Public Functions Documentation

### function SystemModelToJSON

```csharp
static string SystemModelToJSON(
    EPESerializeData data
)
```

Converts a system model to a JSON string.

**Parameters**:

* **data** The model to convert.

**Return**: The model as JSON.

```csharp
static string SystemModelToJSON(
    Array pvarrays,
    Array moduleNames,
    Array ir_data,
    Array temp_data,
    Array npar,
    Array nser,
    bool bypassDiodes
)
```

Builds a system model from arrays and converts it to a JSON string. Each array is indexed \[array]\[module] and all must have matching shapes.

**Parameters**:

* **pvarrays** PV-array identifiers.
* **moduleNames** Module names.
* **ir\_data** Irradiance values.
* **temp\_data** Temperature values.
* **npar** Parallel-string counts.
* **nser** Series-string counts.
* **bypassDiodes** Whether bypass diodes are enabled.

**Return**: The model as JSON.

### function CalculatePIV

```csharp
static int CalculatePIV(
    string json,
    Action< bool > onCompleted
)
```

## Public Attributes Documentation

### variable I\_Data

```csharp
static List< float > I_Data;
```

Current (I) values of the most recently calculated curve.

### variable V\_Data

```csharp
static List< float > V_Data;
```

Voltage (V) values of the most recently calculated curve.

### variable P\_Data

```csharp
static List< float > P_Data;
```

Power (P) values of the most recently calculated curve.

### variable MPPTIndex

```csharp
static int MPPTIndex;
```

Index of the maximum-power point in the most recent curve.

***

Updated on 2026-07-22 at 12:00:00 +0800
