{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.numerical.ode/1.1.1/input.json",
  "title": "Ordinary differential equation — input",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "y0": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite binary64 decimal number or decimal text; nonzero text underflow is rejected. Numerical cross-field/range constraints are checked by the engine."
    },
    "t0": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite binary64 decimal number or decimal text; nonzero text underflow is rejected. Numerical cross-field/range constraints are checked by the engine."
    },
    "t1": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite binary64 decimal number or decimal text; nonzero text underflow is rejected. Numerical cross-field/range constraints are checked by the engine."
    },
    "k": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite binary64 decimal number or decimal text; nonzero text underflow is rejected. Numerical cross-field/range constraints are checked by the engine."
    },
    "n": {
      "oneOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 10000
        },
        {
          "type": "string",
          "pattern": "^\\s*\\+?\\d+(?:\\.0*)?(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "default": 20,
      "description": "Must evaluate to an integer1–10000."
    },
    "method": {
      "type": "string",
      "pattern": "^\\s*(?:[eE][uU][lL][eE][rR]|[fF][oO][rR][wW][aA][rR][dD][\\s_-]+[eE][uU][lL][eE][rR]|[eE][xX][pP][lL][iI][cC][iI][tT][\\s_-]+[eE][uU][lL][eE][rR]|[fF][wW][dD][\\s_-]+[eE][uU][lL][eE][rR]|[rR][kK]4|[rR][uU][nN][gG][eE][\\s_-]+[kK][uU][tT][tT][aA]|[rR][uU][nN][gG][eE][\\s_-]+[kK][uU][tT][tT][aA][\\s_-]+4|[rR][kK]|[cC][lL][aA][sS][sS][iI][cC][\\s_-]+[rR][kK]4)\\s*$",
      "default": "rk4"
    },
    "rhs": {
      "type": "string",
      "pattern": "^\\s*(?:[lL][iI][nN][eE][aA][rR]|[gG][rR][oO][wW][tT][hH]|[kK][yY]|[pP][oO][lL][yY]|[pP][oO][lL][yY][nN][oO][mM][iI][aA][lL]|[pP][\\s_-]+[tT])\\s*$",
      "default": "linear"
    },
    "coeffs": {
      "oneOf": [
        {
          "type": "string",
          "minLength": 1,
          "description": "1–9 nonempty decimal tokens separated by comma, semicolon or whitespace."
        },
        {
          "type": "array",
          "minItems": 1,
          "maxItems": 9,
          "items": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
              }
            ],
            "description": "Finite binary64 decimal number or decimal text; nonzero text underflow is rejected. Numerical cross-field/range constraints are checked by the engine."
          }
        }
      ],
      "description": "Constant-first degree0–8 coefficients. All explicitly supplied fields are validated even when inactive."
    },
    "mode": {
      "type": "string",
      "pattern": "^\\s*(?:[eE][uU][lL][eE][rR]|[fF][oO][rR][wW][aA][rR][dD][\\s_-]+[eE][uU][lL][eE][rR]|[eE][xX][pP][lL][iI][cC][iI][tT][\\s_-]+[eE][uU][lL][eE][rR]|[fF][wW][dD][\\s_-]+[eE][uU][lL][eE][rR]|[rR][kK]4|[rR][uU][nN][gG][eE][\\s_-]+[kK][uU][tT][tT][aA]|[rR][uU][nN][gG][eE][\\s_-]+[kK][uU][tT][tT][aA][\\s_-]+4|[rR][kK]|[cC][lL][aA][sS][sS][iI][cC][\\s_-]+[rR][kK]4)\\s*$"
    },
    "f": {
      "type": "string",
      "pattern": "^\\s*(?:[lL][iI][nN][eE][aA][rR]|[gG][rR][oO][wW][tT][hH]|[kK][yY]|[pP][oO][lL][yY]|[pP][oO][lL][yY][nN][oO][mM][iI][aA][lL]|[pP][\\s_-]+[tT])\\s*$"
    },
    "integrand": {
      "type": "string",
      "pattern": "^\\s*(?:[lL][iI][nN][eE][aA][rR]|[gG][rR][oO][wW][tT][hH]|[kK][yY]|[pP][oO][lL][yY]|[pP][oO][lL][yY][nN][oO][mM][iI][aA][lL]|[pP][\\s_-]+[tT])\\s*$"
    },
    "y_0": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite binary64 decimal number or decimal text; nonzero text underflow is rejected. Numerical cross-field/range constraints are checked by the engine."
    },
    "initial": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite binary64 decimal number or decimal text; nonzero text underflow is rejected. Numerical cross-field/range constraints are checked by the engine."
    },
    "t_0": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite binary64 decimal number or decimal text; nonzero text underflow is rejected. Numerical cross-field/range constraints are checked by the engine."
    },
    "a": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite binary64 decimal number or decimal text; nonzero text underflow is rejected. Numerical cross-field/range constraints are checked by the engine."
    },
    "t_1": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite binary64 decimal number or decimal text; nonzero text underflow is rejected. Numerical cross-field/range constraints are checked by the engine."
    },
    "b": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite binary64 decimal number or decimal text; nonzero text underflow is rejected. Numerical cross-field/range constraints are checked by the engine."
    },
    "coefficients": {
      "oneOf": [
        {
          "type": "string",
          "minLength": 1,
          "description": "1–9 nonempty decimal tokens separated by comma, semicolon or whitespace."
        },
        {
          "type": "array",
          "minItems": 1,
          "maxItems": 9,
          "items": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
              }
            ],
            "description": "Finite binary64 decimal number or decimal text; nonzero text underflow is rejected. Numerical cross-field/range constraints are checked by the engine."
          }
        }
      ],
      "description": "Constant-first degree0–8 coefficients. All explicitly supplied fields are validated even when inactive."
    }
  },
  "allOf": [
    {
      "anyOf": [
        {
          "required": [
            "y0"
          ]
        },
        {
          "required": [
            "y_0"
          ]
        },
        {
          "required": [
            "initial"
          ]
        }
      ]
    },
    {
      "anyOf": [
        {
          "required": [
            "t0"
          ]
        },
        {
          "required": [
            "t_0"
          ]
        },
        {
          "required": [
            "a"
          ]
        }
      ]
    },
    {
      "anyOf": [
        {
          "required": [
            "t1"
          ]
        },
        {
          "required": [
            "t_1"
          ]
        },
        {
          "required": [
            "b"
          ]
        }
      ]
    },
    {
      "if": {
        "required": [
          "rhs"
        ],
        "properties": {
          "rhs": {
            "type": "string",
            "pattern": "^\\s*(?:[pP][oO][lL][yY](?:[nN][oO][mM][iI][aA][lL])?|[pP][\\s_-]+[tT])\\s*$"
          }
        }
      },
      "then": {
        "anyOf": [
          {
            "required": [
              "coeffs"
            ]
          },
          {
            "required": [
              "coefficients"
            ]
          }
        ]
      }
    },
    {
      "if": {
        "required": [
          "f"
        ],
        "properties": {
          "f": {
            "type": "string",
            "pattern": "^\\s*(?:[pP][oO][lL][yY](?:[nN][oO][mM][iI][aA][lL])?|[pP][\\s_-]+[tT])\\s*$"
          }
        }
      },
      "then": {
        "anyOf": [
          {
            "required": [
              "coeffs"
            ]
          },
          {
            "required": [
              "coefficients"
            ]
          }
        ]
      }
    },
    {
      "if": {
        "required": [
          "integrand"
        ],
        "properties": {
          "integrand": {
            "type": "string",
            "pattern": "^\\s*(?:[pP][oO][lL][yY](?:[nN][oO][mM][iI][aA][lL])?|[pP][\\s_-]+[tT])\\s*$"
          }
        }
      },
      "then": {
        "anyOf": [
          {
            "required": [
              "coeffs"
            ]
          },
          {
            "required": [
              "coefficients"
            ]
          }
        ]
      }
    }
  ],
  "description": "Scalar fixed-step ODE. Supplied aliases must agree after normalization. Defaults apply only to absent fields. See engine domain for finite range/time-grid constraints. (calculation_version 1.1.1)"
}
