{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/electrical.mosfet.total_loss/1.1.2/input.json",
  "title": "MOSFET total loss — input",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "I": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Conduction current (A). Meaning set by current_basis."
    },
    "Rds": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Rds(on) at Tref (Ω). Scale with temperature_model."
    },
    "D": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 1,
      "description": "Duty cycle in (0, 1]. Used only for current_basis=on_interval_rms."
    },
    "current_basis": {
      "type": "string",
      "enum": [
        "dc",
        "on_interval_rms",
        "full_cycle_rms"
      ],
      "description": "How I is defined. Required. Same contract as electrical.mosfet.conduction_loss v1.2.1+."
    },
    "temperature_model": {
      "type": "string",
      "enum": [
        "none",
        "linear",
        "ratio"
      ],
      "description": "Optional Rds(Tj). Same contract as electrical.mosfet.conduction_loss: omitted temperature_model infers ratio if rds_ratio is set (ratio wins even when Tj_C is also present), else linear if Tj_C or alpha_per_C is set."
    },
    "Tj_C": {
      "type": "number",
      "description": "Junction temperature for linear Rds(Tj) (°C)."
    },
    "Tref_C": {
      "type": "number",
      "description": "Rds reference temperature (°C). Default 25."
    },
    "alpha_per_C": {
      "type": "number",
      "description": "Linear α (1/°C). Default 0.006 planning."
    },
    "rds_ratio": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Datasheet Rds(Tj)/Rds(Tref)."
    },
    "Vds": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Switched drain-source voltage (V)."
    },
    "Id": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Switched current (A). Often equal to conduction I for rectangular PWM."
    },
    "tr": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Effective rise/overlap time (s)."
    },
    "tf": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Effective fall/overlap time (s)."
    },
    "f_sw": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Switching frequency (Hz)."
    },
    "Qg": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Total gate charge (C). Requires Vdrive."
    },
    "Vdrive": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Gate-drive voltage (V). Requires Qg."
    },
    "coss_model": {
      "type": "string",
      "enum": [
        "none",
        "coss_eq",
        "eoss"
      ],
      "description": "Output-capacitance loss. none (default): omit. coss_eq: ½·Coss·Vds²·f. eoss: Eoss·f. Omitting infers eoss if Eoss set, else coss_eq if Coss set."
    },
    "Coss": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Equivalent Coss (F) for coss_eq."
    },
    "Eoss": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Output switching energy (J) at Vds for eoss."
    },
    "Qrr": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Body-diode reverse-recovery charge (C). P_rr = Qrr·Vds·f_sw is commutation loss, usually attributed to the complementary switch — not this MOSFET's junction."
    },
    "Ta_C": {
      "type": "number",
      "description": "Ambient temperature (°C) for optional Tj estimate."
    },
    "Rth_JA": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Junction-to-ambient thermal resistance (°C/W)."
    }
  },
  "required": [
    "I",
    "Rds",
    "current_basis",
    "Vds",
    "Id",
    "tr",
    "tf",
    "f_sw"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "temperature_model": {
            "const": "linear"
          }
        },
        "required": [
          "temperature_model"
        ]
      },
      "then": {
        "required": [
          "Tj_C"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "temperature_model": {
            "const": "ratio"
          }
        },
        "required": [
          "temperature_model"
        ]
      },
      "then": {
        "required": [
          "rds_ratio"
        ]
      }
    },
    {
      "if": {
        "required": [
          "Qg"
        ]
      },
      "then": {
        "required": [
          "Vdrive"
        ]
      }
    },
    {
      "if": {
        "required": [
          "Vdrive"
        ]
      },
      "then": {
        "required": [
          "Qg"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "coss_model": {
            "const": "eoss"
          }
        },
        "required": [
          "coss_model"
        ]
      },
      "then": {
        "required": [
          "Eoss"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "coss_model": {
            "const": "coss_eq"
          }
        },
        "required": [
          "coss_model"
        ]
      },
      "then": {
        "required": [
          "Coss"
        ]
      }
    }
  ],
  "description": "Compose MOSFET loss workspace: device dissipation (conduction + hard-switching + optional Coss/Eoss) plus optional gate-drive and Qrr commutation, with optional Tj = Ta + P_device·Rth. Omitted optional terms are not treated as 0 W. (calculation_version 1.1.2)"
}
