{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/electrical.battery.runtime_temp/1.2.1/output.json",
  "title": "Battery runtime with temperature — success output",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "status",
    "capability_id",
    "engine",
    "inputs",
    "result",
    "result_detail",
    "calculation_version",
    "verification"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Requested tool id"
    },
    "status": {
      "const": "success"
    },
    "capability_id": {
      "const": "electrical.battery.runtime_temp"
    },
    "tool": {
      "type": "string",
      "description": "Requested tool id"
    },
    "engine": {
      "type": "string"
    },
    "inputs": {
      "description": "Canonical echoed inputs after alias resolution. capacity_mAh → capacity_Ah; amps omits eta/P_W; defaults temperature_model and k_T filled.",
      "type": "object",
      "oneOf": [
        {
          "title": "watts",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "capacity_Ah",
            "V",
            "P_W",
            "dod",
            "eta",
            "T_C",
            "temperature_model",
            "k_T"
          ],
          "properties": {
            "mode": {
              "const": "watts"
            },
            "capacity_Ah": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "V": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "P_W": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "dod": {
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 1
            },
            "eta": {
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 1
            },
            "T_C": {
              "type": "number"
            },
            "temperature_model": {
              "type": "string",
              "enum": [
                "generic_cold_derating",
                "custom_symmetric_linear"
              ]
            },
            "k_T": {
              "type": "number",
              "minimum": 0
            }
          }
        },
        {
          "title": "amps",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode",
            "capacity_Ah",
            "V",
            "I_A",
            "dod",
            "T_C",
            "temperature_model",
            "k_T"
          ],
          "properties": {
            "mode": {
              "const": "amps"
            },
            "capacity_Ah": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "V": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "I_A": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "dod": {
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 1
            },
            "T_C": {
              "type": "number"
            },
            "temperature_model": {
              "type": "string",
              "enum": [
                "generic_cold_derating",
                "custom_symmetric_linear"
              ]
            },
            "k_T": {
              "type": "number",
              "minimum": 0
            }
          }
        }
      ]
    },
    "result": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "t_h",
        "t_d",
        "E_Wh",
        "temp_factor",
        "T_C",
        "k_T",
        "capacity_Ah_eff",
        "temperature"
      ],
      "properties": {
        "t_h": {
          "type": "number",
          "description": "Estimated runtime (hours) at T_C"
        },
        "t_d": {
          "type": "number",
          "description": "Estimated runtime (days = t_h/24)"
        },
        "E_Wh": {
          "type": "number",
          "description": "Usable energy in Wh after temperature factor. Watts: Ah_eff·V·DoD·η. Amps: Ah_eff·V·DoD."
        },
        "temp_factor": {
          "type": "number",
          "description": "Temperature capacity factor f_T (same as temperature.capacity_factor)"
        },
        "T_C": {
          "type": "number",
          "description": "Echo of input temperature (°C)"
        },
        "k_T": {
          "type": "number",
          "description": "Planning coefficient used (/°C); default 0.006 — not manufacturer validated"
        },
        "capacity_Ah_eff": {
          "type": "number",
          "description": "Ah × f_T after temperature derating"
        },
        "temperature": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "T_C",
            "reference_C",
            "model",
            "capacity_factor",
            "k_per_C",
            "clamp_min",
            "clamp_max",
            "clamped",
            "model_basis",
            "parameter_basis",
            "parameter_validated",
            "t_h_at_reference",
            "delta_t_h",
            "delta_percent"
          ],
          "properties": {
            "T_C": {
              "type": "number"
            },
            "reference_C": {
              "type": "number",
              "const": 25
            },
            "model": {
              "type": "string",
              "enum": [
                "generic_cold_derating",
                "custom_symmetric_linear"
              ]
            },
            "capacity_factor": {
              "type": "number",
              "description": "f_T capacity factor"
            },
            "k_per_C": {
              "type": "number"
            },
            "clamp_min": {
              "type": "number"
            },
            "clamp_max": {
              "type": "number"
            },
            "clamped": {
              "type": "boolean",
              "description": "True when numerical clamp applied (not an operating envelope)"
            },
            "model_basis": {
              "type": "string",
              "const": "heuristic_first_order"
            },
            "parameter_basis": {
              "type": "string",
              "const": "planning_default"
            },
            "parameter_validated": {
              "type": "boolean",
              "const": false
            },
            "t_h_at_reference": {
              "type": "number",
              "description": "Runtime hours if f_T were 1 (25 °C / no temp effect)"
            },
            "delta_t_h": {
              "type": "number",
              "description": "t_h − t_h_at_reference (temperature impact)"
            },
            "delta_percent": {
              "type": "number",
              "description": "100 × (t_h − t_h_at_reference) / t_h_at_reference — temperature impact percent vs 25 °C baseline"
            }
          }
        },
        "warnings": {
          "type": "array",
          "description": "Structured notices (also mirrored on the API envelope warnings[])",
          "items": {
            "allOf": [
              {
                "$ref": "https://www.calculatorx.com/schemas/common/structured-warning.json"
              }
            ]
          }
        }
      }
    },
    "result_detail": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value",
        "unit",
        "formatted"
      ],
      "properties": {
        "value": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "t_h",
            "t_d",
            "E_Wh",
            "temp_factor",
            "T_C",
            "k_T",
            "capacity_Ah_eff",
            "temperature"
          ],
          "properties": {
            "t_h": {
              "type": "number",
              "description": "Estimated runtime (hours) at T_C"
            },
            "t_d": {
              "type": "number",
              "description": "Estimated runtime (days = t_h/24)"
            },
            "E_Wh": {
              "type": "number",
              "description": "Usable energy in Wh after temperature factor. Watts: Ah_eff·V·DoD·η. Amps: Ah_eff·V·DoD."
            },
            "temp_factor": {
              "type": "number",
              "description": "Temperature capacity factor f_T (same as temperature.capacity_factor)"
            },
            "T_C": {
              "type": "number",
              "description": "Echo of input temperature (°C)"
            },
            "k_T": {
              "type": "number",
              "description": "Planning coefficient used (/°C); default 0.006 — not manufacturer validated"
            },
            "capacity_Ah_eff": {
              "type": "number",
              "description": "Ah × f_T after temperature derating"
            },
            "temperature": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "T_C",
                "reference_C",
                "model",
                "capacity_factor",
                "k_per_C",
                "clamp_min",
                "clamp_max",
                "clamped",
                "model_basis",
                "parameter_basis",
                "parameter_validated",
                "t_h_at_reference",
                "delta_t_h",
                "delta_percent"
              ],
              "properties": {
                "T_C": {
                  "type": "number"
                },
                "reference_C": {
                  "type": "number",
                  "const": 25
                },
                "model": {
                  "type": "string",
                  "enum": [
                    "generic_cold_derating",
                    "custom_symmetric_linear"
                  ]
                },
                "capacity_factor": {
                  "type": "number",
                  "description": "f_T capacity factor"
                },
                "k_per_C": {
                  "type": "number"
                },
                "clamp_min": {
                  "type": "number"
                },
                "clamp_max": {
                  "type": "number"
                },
                "clamped": {
                  "type": "boolean",
                  "description": "True when numerical clamp applied (not an operating envelope)"
                },
                "model_basis": {
                  "type": "string",
                  "const": "heuristic_first_order"
                },
                "parameter_basis": {
                  "type": "string",
                  "const": "planning_default"
                },
                "parameter_validated": {
                  "type": "boolean",
                  "const": false
                },
                "t_h_at_reference": {
                  "type": "number",
                  "description": "Runtime hours if f_T were 1 (25 °C / no temp effect)"
                },
                "delta_t_h": {
                  "type": "number",
                  "description": "t_h − t_h_at_reference (temperature impact)"
                },
                "delta_percent": {
                  "type": "number",
                  "description": "100 × (t_h − t_h_at_reference) / t_h_at_reference — temperature impact percent vs 25 °C baseline"
                }
              }
            },
            "warnings": {
              "type": "array",
              "description": "Structured notices (also mirrored on the API envelope warnings[])",
              "items": {
                "allOf": [
                  {
                    "$ref": "https://www.calculatorx.com/schemas/common/structured-warning.json"
                  }
                ]
              }
            }
          }
        },
        "unit": {
          "type": [
            "string",
            "null"
          ]
        },
        "formatted": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "formula": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "string"
            },
            "expression": {
              "type": "string"
            },
            "label": {
              "type": "string"
            }
          }
        }
      ]
    },
    "assumptions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "suggestion": {
            "type": "string"
          }
        }
      }
    },
    "verification": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "tier",
        "engine_tested",
        "expert_reviewed",
        "source_checked",
        "reviewed_by",
        "reviewer_role",
        "last_reviewed"
      ],
      "properties": {
        "tier": {
          "type": "string",
          "enum": [
            "candidate",
            "engine_tested",
            "internally_reviewed",
            "expert_verified"
          ]
        },
        "engine_tested": {
          "type": "boolean"
        },
        "expert_reviewed": {
          "type": "boolean"
        },
        "internally_reviewed": {
          "type": "boolean"
        },
        "review_kind": {
          "type": [
            "string",
            "null"
          ]
        },
        "source_checked": {
          "type": "boolean"
        },
        "reviewed_by": {
          "type": [
            "string",
            "null"
          ]
        },
        "reviewer_role": {
          "type": [
            "string",
            "null"
          ]
        },
        "last_reviewed": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "tier": {
                "const": "expert_verified"
              }
            },
            "required": [
              "tier"
            ]
          },
          "then": {
            "properties": {
              "engine_tested": {
                "const": true
              },
              "expert_reviewed": {
                "const": true
              },
              "source_checked": {
                "const": true
              },
              "reviewed_by": {
                "type": "string",
                "minLength": 1
              },
              "reviewer_role": {
                "type": "string",
                "minLength": 1
              },
              "last_reviewed": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "tier": {
                "const": "internally_reviewed"
              }
            },
            "required": [
              "tier"
            ]
          },
          "then": {
            "properties": {
              "engine_tested": {
                "const": true
              },
              "internally_reviewed": {
                "const": true
              },
              "source_checked": {
                "const": true
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "tier": {
                "const": "engine_tested"
              }
            },
            "required": [
              "tier"
            ]
          },
          "then": {
            "properties": {
              "engine_tested": {
                "const": true
              }
            }
          }
        }
      ]
    },
    "calculation_version": {
      "type": "string",
      "const": "1.2.1"
    },
    "api_version": {
      "type": "string"
    },
    "api_contract_version": {
      "type": "string"
    },
    "spec_version": {
      "type": "string"
    },
    "page": {
      "type": [
        "string",
        "null"
      ],
      "description": "Canonical calculator page URL"
    },
    "links": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema_input": {
          "type": "string",
          "format": "uri"
        },
        "schema_output": {
          "type": "string",
          "format": "uri"
        },
        "evidence": {
          "type": "string",
          "format": "uri"
        },
        "openapi": {
          "type": "string",
          "format": "uri"
        },
        "capabilities": {
          "type": "string",
          "format": "uri"
        },
        "mcp": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  }
}
