PEARSim

v0.2.0
io.github.PEAR-power/pear-sim Checked 2 days ago Published 10 days ago

Deterministic power-electronics simulator: write, check and simulate converter models; sweeps.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_examples

List shipped example models (buck, boost, LLC, DAB, rectifiers, inverters, NPC, machines, closed loop, losses/thermal) with a one-line summary each.

get_example

Return the full YAML of a shipped example. Adapting an example is the fastest correct way to write a new model.

ParameterTypeDescription
name *string

get_model_format

The model-format reference. Without `section` returns the table of contents; with `section` (a title or its leading number, e.g. "5") returns that section.

ParameterTypeDescription
section

capabilities

Fail-closed capability registry: what is supported, experimental or unsupported. Pass capability_id for the full statement and the evidence.

ParameterTypeDescription
capability_id

validate_model

Parse and fully validate a model and explain the resolved circuit (parameters, topology, assumptions, limitations). `overrides` maps parameter names to values with units, e.g. {"duty": "45 %"}. Give exactly one of: model_yaml (full model text), model_path (a file inside the project directory) or example (a shipped example name).

ParameterTypeDescription
example
model_path
model_yaml
overrides

render_schematic

Render a deterministic SVG schematic of the model, returned as SVG text. Give exactly one of: model_yaml (full model text), model_path (a file inside the project directory) or example (a shipped example name).

ParameterTypeDescription
example
model_path
model_yaml

simulate

Run a transient simulation. Returns a run_id, per-signal mean/rms/min/max/ peak-to-peak over the LAST HALF of the run, loss and THD summaries when the model requests them, mean powers from the run's energy audit, warnings and a confidence level — never full waveforms. When `losses` shows null powers or tj_max_c, read `electrothermal_status` (global and per device): thermal_runaway, beyond_card_temperature_axis and not_converged withhold every number. `overrides` maps parameter names to values with units. `efficiency_output` (component ids, e.g. ["load"]) adds efficiency = P(those components)…

ParameterTypeDescription
efficiency_output
example
model_path
model_yaml
overrides
timeout_s

steady_state

Periodic steady state of a PWM-driven converter by Newton shooting: the state (inductor currents, capacitor voltages) at the start of a switching period and its cycle averages, plus a fresh run started ON the orbit that reports steady-state ripple and powers. `efficiency_output` (component ids, e.g. ["load"]) adds steady-state efficiency. Needs at least one PWM control; refuses models with a controller in the loop (use `floquet` for those). Give exactly one of: model_yaml (full model text), model_path (a file inside the project directory) or example (a shipped example name).

ParameterTypeDescription
efficiency_output
example
model_path
model_yaml
overrides
timeout_s

loop_gain

Small-signal loop gain and phase/gain margins of an OPEN-LOOP PWM plant with a DECLARED compensator (averaged model around the periodic steady state, including the ZOH and computation delay of digital control). `request` fields: output (signal, e.g. "v(out)"), compensator {numerator, denominator} as polynomial coefficients in s, sensor_gain, f_min_hz, f_max_hz, points, margins {min_phase_margin_deg, min_gain_margin_db}, sampling {update_frequency_hz, computation_delay_s}. Give exactly one of: model_yaml (full model text), model_path (a file inside the project directory) or example (a shipped e…

ParameterTypeDescription
request *object
example
model_path
model_yaml
timeout_s

floquet

Is a CLOSED-LOOP converter stable? Finds the periodic orbit of the exact switching model WITH its digital controller (control law written in signal blocks driving signal_pwm; state = inductor currents, capacitor voltages and every unit_delay register) and returns its Floquet multipliers: all |mu| < 1 = locally stable, any |mu| >= 1 = unstable, and the angle of the dominant mu gives the frequency of the oscillation to expect. No averaging, no declared compensator — unlike loop_gain. A stable verdict also needs a Lyapunov certificate (second, eigenvalue-free check). Claims LOCAL stability of t…

ParameterTypeDescription
example
initial_state
model_path
model_yaml
overrides
timeout_s

measure_loop_gain

Loop gain of a CLOSED-LOOP converter MEASURED on the exact switching model, the way a bench does it: a small sinusoid is injected at a signal block (default: the block the PWM duty reads), the run starts on the closed-loop periodic orbit, and L = -X/Y is fitted on the controller's own samples. Returns phase margin, gain margin and the Bode points; no averaging and no compensator declared twice (unlike loop_gain). Needs a locally stable orbit (an unstable one is refused: use `floquet`). Refuses an amplitude that clamps a limiter or changes the switching mode sequence (e.g. CCM tipping into DCM)…

ParameterTypeDescription
start_hz *number
stop_hz *number
amplitude
example
initial_state
inject_at
model_path
model_yaml
overrides
pointsinteger
timeout_s

sweep_parameter

Bounded 1-D sweep of one model parameter; every point is a retained run. `request`: {"parameter": "load", "values": ["5 ohm", "10 ohm"], "projections": [{"id": "vout", "signal": "v(out)", "metric": "mean_last_half", "unit": "V"}]}. Give exactly one of: model_yaml (full model text), model_path (a file inside the project directory) or example (a shipped example name).

ParameterTypeDescription
request *object
example
model_path
model_yaml
timeout_s

sweep_tolerance_corners

Worst case over parameter tolerance corners (nominal point plus every corner); names the binding corner. `request`: {"tolerances": [{"parameter": "load", "percent": 10}], "band_metrics": [{"signal": "v(out)", "field": "mean_last_half"}]}. Give exactly one of: model_yaml (full model text), model_path (a file inside the project directory) or example (a shipped example name).

ParameterTypeDescription
request *object
example
model_path
model_yaml
timeout_s

evaluate_designs

Screen many designs of one model and rank them: best design OF THE SAMPLE, not an optimum. Designs are sampled (Latin hypercube or grid) or listed; up to 2000 per call, run in parallel. Feasible designs are ranked by the objective; the top `finalists` are re-run in full and must reproduce their screening values. A design whose constraint or objective is a sampled extremum (max, min, peak_to_peak) on an output grid with fewer than 10 samples per switching period is listed under `not_comparable` and never ranked: use a finer output_step. `request`: {"designs": {"method": "lhs", "count": 40, "see…

ParameterTypeDescription
request *object
example
model_path
model_yaml
timeout_s

sensitivity

Global sensitivity of outputs to parameters over declared ranges. "morris" (r*(k+1) runs): mu_star = typical output change across a parameter's whole range, sigma = interaction/non-linearity. "sobol" (N*(k+2) runs, N a power of two): S1 = share of output variance a parameter explains alone, ST = including interactions. Every index has a bootstrap 95 % interval. Parameters are independent and uniform over their ranges, so indices describe the model in THIS box only. `request`: {"method": "sobol", "parameters": [{"name": "duty", "from": "35 %", "to": "45 %"}, {"name": "fsw", "from": "10 kHz", "t…

ParameterTypeDescription
request *object
example
model_path
model_yaml
timeout_s

get_metrics

All (or selected) metrics of one recorded signal: full-window and last-half mean, rms, min, max, peak-to-peak, integrals.

ParameterTypeDescription
run_id *string
signal *string
fields

get_waveform

A bounded, downsampled window of one recorded signal (max 2048 points). Zoom with start_s/stop_s to see switching ripple.

ParameterTypeDescription
run_id *string
signal *string
max_pointsinteger
start_s
stop_s

get_artifact

Read a JSON artifact of a run (e.g. losses-thermal.json, harmonics.json, physics-audit.json, confidence-card.json), optionally narrowed with a slash-separated path such as "devices/0/thermal". Line artifacts (.jsonl: events, control-trace, signal-trace, machine-trace) are read by line range, path="0-100".

ParameterTypeDescription
name *string
run_id *string
path

compare_runs

Side-by-side metrics of 2-12 runs (default: mean, rms and peak-to-peak over the last half), e.g. to compare two design variants.

ParameterTypeDescription
run_ids *array
metrics
signals

list_runs

Run ids retained in this server's workspace, newest first.

doctor

Versions, package integrity, available oracle backends, enforced limits and a float-determinism probe for this installation.