omni_harmonic_distortion_thd
Calculate total harmonic distortion (THD) for voltage and current from harmonic magnitudes, then check IEEE 519 compliance and derive true RMS and crest factor.
Instructions
Electrical Power Quality Total Harmonic Distortion (THD) Calculator. Calculate Total Harmonic Distortion (THD % for voltage and current) from individual harmonic magnitudes compliant with IEEE 519 standards. Discipline: ENERGY. Governing mathematical model / formula: THD (%) = (√[V₂² + V₃² + V₄² + ... + Vₙ²] / V₁) × 100.
USAGE GUIDELINES:
WHEN TO USE: Invoke for deterministic calculation of total_thd_pct (Total Harmonic Distortion (THD)), ieee_519_status (IEEE 519 Compliance Status), total_rms_magnitude (True RMS Voltage / Current), crest_factor (Estimated Waveform Crest Factor) using fundamental_v1 (Fundamental Frequency Magnitude (V₁ or I₁) in V or A), harmonic_3rd (3rd Harmonic Component (180 Hz) in V), harmonic_5th (5th Harmonic Component (300 Hz) in V), harmonic_7th (7th Harmonic Component (420 Hz) in V). Guarantees exact machine floating-point precision, eliminating LLM arithmetic mistakes and formula hallucinations.
WHEN NOT TO USE: Do not use for qualitative evaluations or unquantified reasoning. All input parameters must be valid numerical values.
DISAMBIGUATION & BOUNDARIES:
Use this dedicated specialist tool for 'Electrical Power Quality Total Harmonic Distortion (THD) Calculator' rather than generic dispatchers like omni_universal_query.
For multi-calculation chained jobs, use 'omni_batch_calculate'.
To inspect schema fields, see 'omni_describe_solver'.
BEHAVIOR & SAFETY:
Pure deterministic computation with machine floating-point precision.
Read-only, idempotent, and stateless. Zero side effects or persistent state mutations.
Input validation: All arguments are validated against physical and domain bounds. Out-of-bounds inputs return a safe diagnostic error status without throwing runtime exceptions.
RETURNS:
Structured JSON object containing:
status (string): "success" on valid execution or "error" if validation fails
calculator (string): "harmonic-distortion-thd"
category (string): "energy"
name (string): "Electrical Power Quality Total Harmonic Distortion (THD) Calculator"
formula (string): Governing mathematical formula string
inputs (object): Echoed input parameter dictionary with applied defaults
metrics (object): Dictionary of computed outputs:
metrics.total_thd_pct (Total Harmonic Distortion (THD)): Formatted display string (e.g. '6.64%')
metrics.ieee_519_status (IEEE 519 Compliance Status): Formatted display string (e.g. 'Exceeds 5% Limit (Mitigation Required)')
metrics.total_rms_magnitude (True RMS Voltage / Current): Formatted display string (e.g. '120.3 V')
metrics.crest_factor (Estimated Waveform Crest Factor): Formatted display string (e.g. '1.46 (Pure sine = 1.414)')
execution_time_ms (number): Latency in milliseconds.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "omni_harmonic_distortion_thd"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| harmonic_3rd | No | 3rd Harmonic Component (180 Hz) (V). Typical triplen harmonic from single-phase electronics. Default: 4.8. Min: 0. Max: 50. | |
| harmonic_5th | No | 5th Harmonic Component (300 Hz) (V). Prevalent harmonic from 6-pulse VFD rectifiers. Default: 5.4. Min: 0. Max: 50. | |
| harmonic_7th | No | 7th Harmonic Component (420 Hz) (V). High-frequency non-linear load component. Default: 3.2. Min: 0. Max: 50. | |
| fundamental_v1 | No | Fundamental Frequency Magnitude (V₁ or I₁) (V or A). Fundamental 60 Hz component magnitude. Default: 120. Min: 10. Max: 480. |