solve_for
Determine the input value needed to hit a target system result, such as setting pump speed to achieve a specified flow rate, by searching between lower and upper bounds.
Instructions
Goal seek: the value of one input or parameter that gives a target result.
Brent's method on vary between lower and upper until target equals value, e.g. the pump speed for 15 m3/h. If the target does not cross the value inside the bounds, the error reports it at both bounds and nothing changes. On success vary stays at the value found; the result is the operating point there, as from solve.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vary | Yes | Numeric input, parameter or state to adjust, e.g. 'pump.speed'. | |
| lower | Yes | Lower bound of `vary` (declared unit or with unit). | |
| units | No | Unit per path, e.g. {'v.volume_flow': 'L/s', 'mains.port.p': 'bar absolute'}; a key '*.<name>' matches every path ending in '.<name>'. | |
| upper | Yes | Upper bound of `vary`. | |
| value | Yes | Target value: a number in the target's reported unit, or a string with a unit such as '15 m3/h'. | |
| target | Yes | Result path to reach, e.g. 'pump.volume_flow'. | |
| system_id | Yes | ||
| variables | No | Paths ('v.volume_flow', 'v.port_a.p'), instance names, 'control' or '*'. Default: observables, states, port pressures and control results. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vary | Yes | ||
| found | Yes | ||
| modes | Yes | ||
| issues | Yes | ||
| target | Yes | ||
| values | Yes | ||
| achieved | Yes | ||
| controls | No | ||
| warnings | Yes | ||
| converged | Yes | ||
| system_id | Yes | ||
| iterations | Yes | ||
| evaluations | Yes | ||
| max_residual | Yes | ||
| target_value | Yes |