# 三相電網 (`grid3`)

> 含中性點的三相電壓源，用於併網轉換器。

![grid3](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/img/grid3.svg)

[元件參考](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/) · [English](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/sources/grid3/)

**分類:** 電源 · **種類:** `{"kind":"grid3"}`

## 何時使用

用於併網逆變器、整流器、充電器與電力品質研究。可在部分或全部的相加入不平衡、諧波與電壓驟降或驟升。線路短路請另外加入故障元件。

## 接腳

| 接腳 | 訊號域 | 意義 |
|---|---|---|
| `a` | 電氣 | a 相 |
| `b` | 電氣 | b 相 |
| `c` | 電氣 | c 相 |
| `n` | 電氣 | 中性點 |

## 常用參數

- `vll`: Line-to-line rms voltage (預設值: 380)
- `freq`: Frequency (預設值: 60)
- `harmonics`: Harmonic order and percent pairs, such as 5 4 7 3 (預設值: 選填（預設關閉）)
- `sagDepth`: How far the voltage drops during the sag, 0 to 1; below 0 it rises (a swell) (預設值: 0)

## 參數

| 鍵 | 單位 | 預設值 | 典型範圍 | 說明 |
|---|---|---|---|---|
| `vll` | V | 380 |  | Line-to-line rms voltage |
| `freq` | Hz | 60 |  | Frequency |
| `phase` | ° | 0 |  | Angle of phase a at the start |
| `ka` | — | 1 |  | Size of phase a compared with normal |
| `kb` | — | 1 |  | Size of phase b compared with normal |
| `kc` | — | 1 |  | Size of phase c compared with normal |
| `harmonics` | — | 選填（預設關閉） |  | Harmonic order and percent pairs, such as 5 4 7 3 |
| `sagDepth` | — | 0 |  | How far the voltage drops during the sag, 0 to 1; below 0 it rises (a swell) |
| `sagStart` | s | 0 |  | When the sag starts |
| `sagEnd` | s | 0 |  | When the sag ends |
| `sagPhases` | — | abc |  | Phases the sag or swell touches, such as a or abc |
| `fDev` | Hz | 0 |  | How far the frequency moves in the excursion; below 0 it falls |
| `fStart` | s | 0 |  | When the frequency starts to move |
| `fEnd` | s | 0 |  | When the frequency starts back to normal |
| `fRate` | Hz/s | 選填（預設關閉） |  | How fast the frequency moves; none steps it at once |
| `jumpDeg` | ° | 0 |  | How far the phase angle jumps; below 0 it falls behind |
| `jumpAt` | s | 0 |  | When the phase angle jumps |
| `jumpPhases` | — | abc |  | Phases the jump touches, such as a or abc |
| `rs` | Ω | 0 |  | Resistance inside the source |
| `ls` | H | 0 |  | Inductance inside the source |

_參數說明在兩種語言中都是英文。_

**適用於:** 併網逆變器與充電器 · 電力品質研究 · 電壓穿越測試

**不適用於:** 理想平衡的三相電源 → [`sine3VoltageSource`](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/sources/sine3VoltageSource/)

## 公式

| 公式 | 方程式 | 出處 |
|---|---|---|
| 相電壓有效值 | Vph = Vll/√3 | Grainger & Stevenson, Power System Analysis (1994), ch. 2 (balanced three-phase voltages) |
| 相電壓峰值 | Vpk = √2·Vll/√3 | Grainger & Stevenson, Power System Analysis (1994), ch. 2 (balanced three-phase voltages) |
| 驟降期間的相電壓 | Vsag = Vph·(1 − depth) | IEEE Std 1159-2019, voltage sag definition |
| 電壓畸變率 | THD = √(h5² + h7²) in percent | IEEE Std 519-2022, definition of total harmonic distortion |

## 快速驗算

輸入:

- `vll`: 線電壓有效值 = 380 V, `vll`
- `sagDepth`: 驟降深度 = 0 —, `sagDepth`
- `h5`: 5 次諧波 = 0 %
- `h7`: 7 次諧波 = 0 %

輸出:

- `vph`: 相電壓有效值 = `vll/sqrt(3)` V
- `vpk`: 相電壓峰值 = `vll*sqrt(2)/sqrt(3)` V
- `vsag`: 驟降期間的相電壓 = `vph*(1 - sagDepth)` V
- `thd`: 電壓畸變率 = `sqrt(h5^2 + h7^2)` %

## 模型邏輯

- 每一相都是由 n 起算的電壓，峰值為 vll * sqrt(2) / sqrt(3)，再乘上 ka、kb 或 kc。
- b 相落後 a 相 120 度，c 相超前；5 次諧波反向旋轉，3 次諧波三相相同。
- 從 sagStart 到 sagEnd，sagPhases 列出的相乘上 1 - sagDepth；sagDepth 為負值時是驟升。
- rs 與 ls 與每一相串聯，name.a 的電流是流入 a 端的電流。

## 模型

每一相都是由 n 起算的電壓，峰值為 vll * sqrt(2) / sqrt(3)，再乘上 ka、kb 或 kc。a 相從角度 phase 開始，b 相落後 120 度，c 相超前 120 度。清單中的每個諧波以基波的百分比加入，相位移是次數乘上該相的相位移，所以 5 次諧波反向旋轉，3 次諧波三相相同。從 sagStart 到 sagEnd，sagPhases 列出的相（abc 為三相，a 為單相驟降）乘上 1 - sagDepth；sagDepth 為負值時是電壓驟升，例如 -0.2 會把電壓升到 120 %。rs 與 ls 是與每一相串聯的電阻與電感。名為 name.a 的元件的電流，是流入該相電源 a 端的電流。

## 常見錯誤

- vll 是線電壓的有效值，所以 380 會讓每相對 n 約為 220 V 有效值。請不要填相電壓。
- 請把 n 接地或接到負載的中性點，否則電源會浮接，模擬會失敗。
- 沒有 rs 或 ls 時，接大電容的整流器會抽出不實際的突波電流。請設定電網阻抗。

## 規格書與來源

vll 與 freq 取自你要連接的電源。諧波取自量測值或電網規範的限值，電壓驟降的深度與時間取自你要做的低電壓穿越測試。

## 範例

以指令 `file.openExample` 開啟範例，名稱為 `demo:grid3`.

---
由 `cargo xtask reference` 依使用說明文字與參數規格產生，請勿手動編輯。
