---
title: "Evaluate Expression"
method: POST
path: "/variables/evaluate-expression"
tags: ["variables"]
---

# Evaluate Expression

`POST /variables/evaluate-expression`

Evaluate a dependent parameter expression using current parameter values.

The expression is given as a JSON-serialized PyBaMM symbol (json_value).
Parameters are the full frontend parameters dict; they are converted and
used to substitute Parameter("...") nodes, then the expression is
evaluated to a scalar.

Parameters
----------
request : EvaluateExpressionRequest
    json_value: JSON symbol tree; parameters: current parameters dict

Returns
-------
EvaluateExpressionResponse
    value: evaluated numeric result

## Request body

- EvaluateExpressionRequest — Request body for evaluating an expression with current parameters.
  - `json_value` object, required
  - `parameters` object, required

## Response `200`

Successful Response

- EvaluateExpressionResponse — Response body with the evaluated numeric value.
  - `value` number, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/ionworks/apis/fastapi.md) · [All operations](https://skmtc.dev/ionworks/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ionworks/fastapi/revisions/7337a3cbdaf2/schema)
