{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/electrical.rf.smith.input.json",
  "title": "Smith Chart (Impedance Matching) — input",
  "type": "object",
  "oneOf": [
    {
      "title": "z-gamma",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "z_r"
      ],
      "properties": {
        "mode": {
          "const": "z-gamma"
        },
        "z_r": {
          "type": "number",
          "minimum": 0
        },
        "z_i": {
          "type": "number",
          "default": 0
        },
        "Z0_ohm": {
          "type": "number",
          "exclusiveMinimum": 0
        }
      }
    },
    {
      "title": "gamma-z",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "gamma_r"
      ],
      "properties": {
        "mode": {
          "const": "gamma-z"
        },
        "gamma_r": {
          "type": "number"
        },
        "gamma_i": {
          "type": "number",
          "default": 0
        },
        "Z0_ohm": {
          "type": "number",
          "exclusiveMinimum": 0
        }
      }
    },
    {
      "title": "match",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "Z0_ohm",
        "RL_ohm",
        "f_Hz"
      ],
      "properties": {
        "mode": {
          "const": "match"
        },
        "Z0_ohm": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "RL_ohm": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "f_Hz": {
          "type": "number",
          "exclusiveMinimum": 0
        }
      }
    },
    {
      "title": "match-steps",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "z_r",
        "Z0_ohm",
        "f_Hz",
        "steps"
      ],
      "properties": {
        "mode": {
          "const": "match-steps"
        },
        "z_r": {
          "type": "number",
          "minimum": 0
        },
        "z_i": {
          "type": "number",
          "default": 0
        },
        "Z0_ohm": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "f_Hz": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "kind"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "series-L",
                  "series-C",
                  "series-R",
                  "series-X",
                  "shunt-L",
                  "shunt-C",
                  "shunt-R",
                  "shunt-B",
                  "tline",
                  "stub-open",
                  "stub-short",
                  "transformer",
                  "parallel-RLC"
                ]
              },
              "L_H": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "C_F": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "R_ohm": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "x_norm": {
                "type": "number"
              },
              "b_norm": {
                "type": "number"
              },
              "n": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "theta_deg": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "Z0_line_ohm": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "Z0_stub_ohm": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "value": {
                "type": "number"
              }
            },
            "allOf": [
              {
                "if": {
                  "properties": {
                    "kind": {
                      "enum": [
                        "series-L",
                        "shunt-L"
                      ]
                    }
                  },
                  "required": [
                    "kind"
                  ]
                },
                "then": {
                  "required": [
                    "L_H"
                  ]
                }
              },
              {
                "if": {
                  "properties": {
                    "kind": {
                      "enum": [
                        "series-C",
                        "shunt-C"
                      ]
                    }
                  },
                  "required": [
                    "kind"
                  ]
                },
                "then": {
                  "required": [
                    "C_F"
                  ]
                }
              },
              {
                "if": {
                  "properties": {
                    "kind": {
                      "enum": [
                        "series-R",
                        "shunt-R"
                      ]
                    }
                  },
                  "required": [
                    "kind"
                  ]
                },
                "then": {
                  "anyOf": [
                    {
                      "required": [
                        "R_ohm"
                      ]
                    },
                    {
                      "required": [
                        "value"
                      ]
                    }
                  ]
                }
              },
              {
                "if": {
                  "properties": {
                    "kind": {
                      "const": "series-X"
                    }
                  },
                  "required": [
                    "kind"
                  ]
                },
                "then": {
                  "anyOf": [
                    {
                      "required": [
                        "x_norm"
                      ]
                    },
                    {
                      "required": [
                        "value"
                      ]
                    }
                  ]
                }
              },
              {
                "if": {
                  "properties": {
                    "kind": {
                      "const": "shunt-B"
                    }
                  },
                  "required": [
                    "kind"
                  ]
                },
                "then": {
                  "anyOf": [
                    {
                      "required": [
                        "b_norm"
                      ]
                    },
                    {
                      "required": [
                        "value"
                      ]
                    }
                  ]
                }
              },
              {
                "if": {
                  "properties": {
                    "kind": {
                      "enum": [
                        "tline",
                        "stub-open",
                        "stub-short"
                      ]
                    }
                  },
                  "required": [
                    "kind"
                  ]
                },
                "then": {
                  "anyOf": [
                    {
                      "required": [
                        "theta_deg"
                      ]
                    },
                    {
                      "required": [
                        "value"
                      ]
                    }
                  ]
                }
              },
              {
                "if": {
                  "properties": {
                    "kind": {
                      "const": "transformer"
                    }
                  },
                  "required": [
                    "kind"
                  ]
                },
                "then": {
                  "required": [
                    "n"
                  ]
                }
              },
              {
                "if": {
                  "properties": {
                    "kind": {
                      "const": "parallel-RLC"
                    }
                  },
                  "required": [
                    "kind"
                  ]
                },
                "then": {
                  "required": [
                    "R_ohm",
                    "L_H",
                    "C_F"
                  ]
                }
              }
            ]
          }
        }
      }
    },
    {
      "title": "s11-touchstone",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "touchstone"
      ],
      "properties": {
        "mode": {
          "const": "s11-touchstone"
        },
        "touchstone": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    {
      "title": "auto-match",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "z_r",
        "Z0_ohm",
        "f_Hz"
      ],
      "properties": {
        "mode": {
          "const": "auto-match"
        },
        "z_r": {
          "type": "number",
          "minimum": 0
        },
        "z_i": {
          "type": "number",
          "default": 0
        },
        "Z0_ohm": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "f_Hz": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "topology": {
          "type": "string",
          "enum": [
            "all",
            "l-section",
            "stub",
            "qw"
          ],
          "default": "all"
        }
      }
    }
  ],
  "description": "RF Smith Chart & Matching Workspace: mode-discriminated Agent API, strict match-steps, Touchstone S11, auto-match, SVG overlays. (calculation_version 1.6.3)"
}
