{
  "openapi": "3.1.1",
  "info": {
    "title": "Ohmforge API",
    "version": "1.0.0",
    "summary": "Deterministic tools for people and AI agents.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://ohmforge.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/tools": {
      "get": {
        "operationId": "listTools",
        "summary": "Catalog of all tools",
        "responses": {
          "200": {
            "description": "Tool list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/{id}": {
      "get": {
        "operationId": "getTool",
        "summary": "Definition of one tool",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ohmforge-dc-operating-point",
                "ohmforge-transient",
                "ohmforge-ac-sweep",
                "ohmforge-led-resistor"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/ohmforge-dc-operating-point/calculate": {
      "post": {
        "operationId": "calculateOhmforgeDcOperatingPoint",
        "summary": "SPICE netlist in, node voltages, branch currents, power and overload warnings out.",
        "description": "Solves the DC operating point of a circuit with Ohmforge's SPICE-style engine (Modified Nodal Analysis, Newton–Raphson with junction limiting, damping, gmin and source stepping). Returns every node voltage, the current and power of every element, total supply power, parts beyond their ratings and plain-language convergence diagnostics.\n\nMethodology:\n- The netlist is parsed (SPICE subset) and compiled into Modified Nodal Analysis unknowns: one voltage per node plus one current per voltage source, inductor and controlled-source output.\n- Nonlinear devices (Shockley diode with series resistance and breakdown, Ebers–Moll BJT with Early effect, Shichman–Hodges level-1 MOSFET) are linearised at each Newton–Raphson iteration; junction voltages are limited with the SPICE3 pnjlim rule.\n- If plain Newton–Raphson fails, the solver retries with damping (≤ 0.5 V per iteration), then gmin stepping (1e-2 S → 1e-12 S to ground on every node) and finally source stepping (all sources ramped 0 → 100 %). Every attempt is reported in plain words.\n- Topology checks run first: missing ground, loops of voltage sources/inductors (no unique solution) and nodes without a DC path to ground.\n- Element power is Σ(terminal current × node voltage); sources show negative power when delivering. Ratings (resistor watts, LED current, diode/transistor limits, capacitor voltage) are compared with the result.\n\nTeaching-grade simulation: device models are simplified (Ebers–Moll BJT, level-1 MOSFET, behavioural op-amps and 555) and part ratings are typical values. Verify real designs on the bench and against manufacturer data before building anything connected to mains voltage.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "ohmforge_dc_operating_point",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OhmforgeDcOperatingPointInput"
              },
              "examples": {
                "example1": {
                  "summary": "Voltage divider (10 V, 1k/3k → 7.5 V)",
                  "value": {
                    "netlist": "* Voltage divider\nV1 in 0 DC 10\nR1 in out 1k\nR2 out 0 3k\n.op\n.end"
                  }
                },
                "example2": {
                  "summary": "Transistor switching an LED",
                  "value": {
                    "netlist": "* LED with series resistor and a 2N3904 switch\nVCC vcc 0 9\nRB vcc b 10k\nRC vcc a 470\nD1 a c LED_RED\nQ1 c b 0 2N3904\n.op"
                  }
                },
                "example3": {
                  "summary": "Diode forward drop (Shockley)",
                  "value": {
                    "netlist": "* Shockley diode check\nV1 in 0 5\nR1 in a 1k\nD1 a 0 DMOD\n.model DMOD D(IS=1e-14 N=1)\n.op"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OhmforgeDcOperatingPointResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/ohmforge-transient/calculate": {
      "post": {
        "operationId": "calculateOhmforgeTransient",
        "summary": "Simulate a circuit over time: waveforms, Vpp/RMS/frequency, CSV and a chart.",
        "description": "Runs a transient (time-domain) simulation of a SPICE netlist with trapezoidal or backward-Euler integration, adaptive time steps and breakpoints at source corners. Returns resampled waveforms of the chosen nodes, oscilloscope-style measurements (min, max, Vpp, mean, RMS, frequency, duty cycle, rise time), rating warnings, a chart and CSV.\n\nMethodology:\n- Starts from the DC operating point (or from initial conditions with \"uic\"), then integrates capacitors and inductors with companion models: trapezoidal (2C/h) or backward Euler (C/h); inductors and coupled inductors use branch currents.\n- Each time step is solved with Newton–Raphson. The step size adapts: the difference between the corrector and a linear predictor estimates the local truncation error; failed steps are retried with h/8.\n- Source corners (PULSE edges, PWL points) are breakpoints: the integrator lands on them and restarts with backward Euler to avoid trapezoidal ringing. Behavioural events (555 latch, relay pull-in, fuse, current limit) are localised by step bisection.\n- Returned samples are linearly interpolated onto a uniform grid (output step). Measurements: time-weighted mean and RMS, Vpp, frequency from mid-level crossings with 10 % hysteresis, 10–90 % rise time.\n\nTeaching-grade simulation: device models are simplified (Ebers–Moll BJT, level-1 MOSFET, behavioural op-amps and 555) and part ratings are typical values. Verify real designs on the bench and against manufacturer data before building anything connected to mains voltage.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "ohmforge_transient",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OhmforgeTransientInput"
              },
              "examples": {
                "example1": {
                  "summary": "RC step response (τ = 1 ms)",
                  "value": {
                    "netlist": "* RC step response, tau = 1 ms\nV1 in 0 PULSE(0 1 0 1n 1n 10m 20m)\nR1 in out 1k\nC1 out 0 1u\n.tran 10u 5m\n.end",
                    "probes": [
                      "in",
                      "out"
                    ]
                  }
                },
                "example2": {
                  "summary": "Half-wave rectifier with smoothing",
                  "value": {
                    "netlist": "* Half-wave rectifier with reservoir capacitor\nV1 ac 0 SIN(0 12 50)\nD1 ac out 1N4007\nC1 out 0 470u\nRL out 0 1k\n.tran 50u 100m",
                    "probes": [
                      "ac",
                      "out"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OhmforgeTransientResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/ohmforge-ac-sweep/calculate": {
      "post": {
        "operationId": "calculateOhmforgeAcSweep",
        "summary": "Frequency response of a circuit: Bode magnitude/phase, −3 dB corner and unity gain.",
        "description": "Linearises the circuit at its DC operating point and solves the complex MNA equations across a logarithmic frequency sweep. Returns magnitude in dB and unwrapped phase of an output node (optionally relative to an input node), the peak gain, lower/upper −3 dB frequencies, the unity-gain frequency, a Bode chart and CSV.\n\nMethodology:\n- The DC operating point is solved first; every nonlinear device is replaced by its small-signal conductances at that point (diode gd, BJT gm/gπ/go, MOSFET gm/gds, op-amp output slope).\n- Capacitors become admittances jωC, inductors impedances jωL in their branch equations, coupled inductors jωM; the complex system is solved by dense LU with partial pivoting at every frequency.\n- Magnitude is 20·log10|H|, phase is unwrapped to be continuous. The −3 dB points are found 3.01 dB below the peak by logarithmic interpolation; unity gain is the 0 dB crossing.\n\nTeaching-grade simulation: device models are simplified (Ebers–Moll BJT, level-1 MOSFET, behavioural op-amps and 555) and part ratings are typical values. Verify real designs on the bench and against manufacturer data before building anything connected to mains voltage.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "ohmforge_ac_sweep",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OhmforgeAcSweepInput"
              },
              "examples": {
                "example1": {
                  "summary": "RC low-pass (fc ≈ 1.59 kHz)",
                  "value": {
                    "netlist": "* RC low-pass, fc = 1/(2*pi*1k*100n) = 1591.5 Hz\nV1 in 0 DC 0 AC 1\nR1 in out 1k\nC1 out 0 100n\n.ac dec 20 10 1meg",
                    "output": "out",
                    "input": "V1"
                  }
                },
                "example2": {
                  "summary": "Inverting op-amp, gain −10",
                  "value": {
                    "netlist": "* Inverting amplifier, gain -10 (ideal op-amp as VCVS)\nV1 in 0 AC 1\nR1 in m 1k\nR2 m out 10k\nE1 out 0 0 m 100k\n.ac dec 10 10 10meg",
                    "output": "out",
                    "input": "V1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OhmforgeAcSweepResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/ohmforge-led-resistor/calculate": {
      "post": {
        "operationId": "calculateOhmforgeLedResistor",
        "summary": "Series resistor for LEDs, rounded to a standard value and checked with a real diode model.",
        "description": "Calculates the series resistor for one or more LEDs in series: R = (Vs − n·Vf) / I, rounds up to the next E6/E12/E24 value, and then verifies the actual current, LED voltage and resistor dissipation by simulating the circuit with Ohmforge's diode model. Suggests a power rating with 2× margin.\n\nMethodology:\n- Exact value R = (Vs − n·Vf) / I with the typical forward voltage of the chosen colour at 20 mA.\n- Rounded UP to the next preferred value of the chosen E-series so the current never exceeds the target.\n- The circuit (supply, resistor, n LEDs) is then simulated with Ohmforge's LED diode model (n = 2, Rs = 4 Ω, fitted to Vf at 20 mA) to report the real current, which is slightly different because Vf depends on current.\n- Resistor rating: next of 0.125/0.25/0.5/1/2/5 W at or above twice the dissipation.\n\nForward voltages vary by LED type and batch (±0.2 V is common); check the datasheet of your LED. Mains-powered LED circuits need proper isolation – do not build them from this calculation.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "ohmforge_led_resistor",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OhmforgeLedResistorInput"
              },
              "examples": {
                "example1": {
                  "summary": "Red LED on 9 V at 20 mA",
                  "value": {
                    "supply": 9,
                    "colour": "red",
                    "current": 20,
                    "count": 1,
                    "series": "E12"
                  }
                },
                "example2": {
                  "summary": "Three white LEDs on 12 V at 15 mA",
                  "value": {
                    "supply": 12,
                    "colour": "white",
                    "current": 15,
                    "count": 3,
                    "series": "E24"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OhmforgeLedResistorResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows": {
      "get": {
        "operationId": "listWorkflows",
        "summary": "Multi-tool workflows",
        "responses": {
          "200": {
            "description": "Workflow list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "OhmforgeDcOperatingPointInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "netlist": {
            "title": "SPICE netlist",
            "description": "Subset: R C L V I D Q M E G K, .model, SIN/PULSE/PWL sources, engineering suffixes (k, m, u, n, p, meg). Node 0 is ground. Leave empty when you pass an Ohmforge project instead.",
            "type": "string",
            "maxLength": 60000
          },
          "project": {
            "title": "Ohmforge project JSON (optional)",
            "description": "Alternative to the netlist: a .ohmforge.json project as saved by the app (format \"ohmforge\", version 1).",
            "type": "string",
            "maxLength": 200000
          }
        },
        "required": []
      },
      "OhmforgeDcOperatingPointResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "required": [
              "converged",
              "nodes",
              "elements",
              "stress",
              "diagnostics"
            ],
            "properties": {
              "title": {
                "type": "string"
              },
              "converged": {
                "type": "boolean"
              },
              "strategy": {
                "type": "string"
              },
              "iterations": {
                "type": "integer"
              },
              "nodes": {
                "type": "object",
                "additionalProperties": {
                  "type": "number"
                },
                "description": "Node voltages in V (ground = 0 is implicit)."
              },
              "elements": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "current": {
                      "type": "number"
                    },
                    "voltage": {
                      "type": "number"
                    },
                    "power": {
                      "type": "number"
                    },
                    "state": {
                      "type": "string"
                    }
                  }
                }
              },
              "totalSupplyPower": {
                "type": "number"
              },
              "stress": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "element": {
                      "type": "string"
                    },
                    "level": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              },
              "diagnostics": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "OhmforgeTransientInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "netlist": {
            "title": "SPICE netlist",
            "description": "Subset: R C L V I D Q M E G K, .model, SIN/PULSE/PWL sources, engineering suffixes (k, m, u, n, p, meg). Node 0 is ground. Leave empty when you pass an Ohmforge project instead.",
            "type": "string",
            "maxLength": 60000
          },
          "project": {
            "title": "Ohmforge project JSON (optional)",
            "description": "Alternative to the netlist: a .ohmforge.json project as saved by the app (format \"ohmforge\", version 1).",
            "type": "string",
            "maxLength": 200000
          },
          "tstop": {
            "title": "Stop time",
            "description": "Simulated duration. Empty = use the .tran line of the netlist (or the project's transient settings).",
            "type": "number",
            "minimum": 0,
            "maximum": 1000,
            "x-unit": "s"
          },
          "tstep": {
            "title": "Output step",
            "description": "Spacing of the returned samples (also the largest internal step). Empty = .tran value or stop time / 1000.",
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "x-unit": "s"
          },
          "method": {
            "title": "Integration",
            "type": "string",
            "enum": [
              "trap",
              "be"
            ],
            "default": "trap"
          },
          "uic": {
            "title": "Start from initial conditions (skip the operating point)",
            "description": "Capacitors start at their IC (default 0 V). Needed for oscillators.",
            "type": "boolean",
            "default": false
          },
          "probes": {
            "title": "Nodes to return",
            "description": "Node names; empty = all nodes (max 8 in the chart).",
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 8
          }
        },
        "required": []
      },
      "OhmforgeTransientResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "required": [
              "ok",
              "tstop",
              "tstep",
              "time",
              "waveforms",
              "measurements"
            ],
            "properties": {
              "ok": {
                "type": "boolean"
              },
              "tstop": {
                "type": "number"
              },
              "tstep": {
                "type": "number"
              },
              "method": {
                "type": "string"
              },
              "start": {
                "type": "string"
              },
              "steps": {
                "type": "integer"
              },
              "rejectedSteps": {
                "type": "integer"
              },
              "time": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "waveforms": {
                "type": "object",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                }
              },
              "measurements": {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "min": {
                      "type": "number"
                    },
                    "max": {
                      "type": "number"
                    },
                    "vpp": {
                      "type": "number"
                    },
                    "mean": {
                      "type": "number"
                    },
                    "rms": {
                      "type": "number"
                    },
                    "frequency": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "duty": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "riseTime": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  }
                }
              },
              "stress": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "diagnostics": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "OhmforgeAcSweepInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "netlist": {
            "title": "SPICE netlist",
            "description": "Subset: R C L V I D Q M E G K, .model, SIN/PULSE/PWL sources, engineering suffixes (k, m, u, n, p, meg). Node 0 is ground. Leave empty when you pass an Ohmforge project instead.",
            "type": "string",
            "maxLength": 60000
          },
          "project": {
            "title": "Ohmforge project JSON (optional)",
            "description": "Alternative to the netlist: a .ohmforge.json project as saved by the app (format \"ohmforge\", version 1).",
            "type": "string",
            "maxLength": 200000
          },
          "output": {
            "title": "Output node",
            "type": "string",
            "maxLength": 64,
            "default": "out"
          },
          "input": {
            "title": "Input source (gets AC = 1)",
            "description": "Name of the V or I source to excite (e.g. V1). Empty = keep the AC magnitudes from the netlist.",
            "type": "string",
            "maxLength": 64
          },
          "inputNode": {
            "title": "Reference node (optional)",
            "description": "Report V(out)/V(ref) instead of V(out).",
            "type": "string",
            "maxLength": 64
          },
          "fstart": {
            "title": "Start frequency",
            "description": "Empty = .ac line or 1 Hz.",
            "type": "number",
            "minimum": 0.001,
            "maximum": 10000000000,
            "x-unit": "Hz"
          },
          "fstop": {
            "title": "Stop frequency",
            "description": "Empty = .ac line or 10 MHz.",
            "type": "number",
            "minimum": 0.001,
            "maximum": 100000000000,
            "x-unit": "Hz"
          },
          "pointsPerDecade": {
            "title": "Points per decade",
            "description": "Empty = .ac line or 20.",
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          }
        },
        "required": [
          "output"
        ]
      },
      "OhmforgeAcSweepResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "required": [
              "output",
              "frequencies",
              "magnitudeDb",
              "phaseDeg",
              "peakDb"
            ],
            "properties": {
              "output": {
                "type": "string"
              },
              "input": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "frequencies": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "magnitudeDb": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "phaseDeg": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "peakDb": {
                "type": "number"
              },
              "peakFrequency": {
                "type": "number"
              },
              "lowGainDb": {
                "type": "number"
              },
              "lower3dB": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "upper3dB": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "unityGainFrequency": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "diagnostics": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "OhmforgeLedResistorInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "supply": {
            "title": "Supply voltage",
            "type": "number",
            "minimum": 0.5,
            "maximum": 400,
            "default": 9,
            "x-unit": "V"
          },
          "colour": {
            "title": "LED colour",
            "type": "string",
            "enum": [
              "red",
              "orange",
              "yellow",
              "green",
              "blue",
              "white",
              "ir",
              "custom"
            ],
            "default": "red"
          },
          "vf": {
            "title": "Forward voltage (custom)",
            "description": "Only used for \"Custom\".",
            "type": "number",
            "minimum": 0.5,
            "maximum": 50,
            "x-unit": "V"
          },
          "current": {
            "title": "LED current",
            "type": "number",
            "minimum": 0.1,
            "maximum": 1000,
            "default": 20,
            "x-unit": "mA"
          },
          "count": {
            "title": "LEDs in series",
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "default": 1
          },
          "series": {
            "title": "Resistor series",
            "type": "string",
            "enum": [
              "E6",
              "E12",
              "E24"
            ],
            "default": "E12"
          }
        },
        "required": [
          "supply",
          "current"
        ]
      },
      "OhmforgeLedResistorResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "required": [
              "exactOhms",
              "standardOhms",
              "simulatedCurrent",
              "resistorPower",
              "recommendedRating"
            ],
            "properties": {
              "vf": {
                "type": "number"
              },
              "exactOhms": {
                "type": "number"
              },
              "standardOhms": {
                "type": "number"
              },
              "series": {
                "type": "string"
              },
              "simulatedCurrent": {
                "type": "number"
              },
              "simulatedLedVoltage": {
                "type": "number"
              },
              "resistorPower": {
                "type": "number"
              },
              "ledPower": {
                "type": "number"
              },
              "recommendedRating": {
                "type": "number"
              },
              "efficiency": {
                "type": "number"
              },
              "netlist": {
                "type": "string"
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}