Plecs Simulate
plecs_simulateRun PLECS simulations and parallel parameter sweeps, then return time-series data, per-signal summaries, or save results to a MatFile for analysis.
Instructions
Run a simulation (blocking).
options is the PLECS optStruct (ModelVars / SolverOpts / OutputFormat);
pass a LIST of optStructs to let PLECS parallelize parameter sweeps.
Only models with top-level Outports return data ({"Time": [...], "Values": [...]};
over JSON-RPC, Values is signals x time). save_to writes a MatFile result to disk.
summary=true replaces the raw arrays with per-signal min/max/mean/p2p/rms.
Results above max_points (default 20000) are written to the MCP output dir and
returned as a summary. SolverOpts.Timeout is injected (default 600 s) so PLECS
aborts on its own even if the client gives up.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model_name": "<model_name>"
},
"name": "plecs_simulate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| options | No | ||
| save_to | No | ||
| summary | No | ||
| timeout | No | ||
| overwrite | No | ||
| max_points | No | ||
| model_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||