Skip to main content
Add a custom variable to an existing model
curl --request POST \
  --url https://api.ionworks.com/models/{model_id}/custom-variables \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "expression": "<string>"
}
'
{
  "name": "<string>",
  "id": "<string>",
  "user_id": "<string>",
  "organization_id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "config": {},
  "is_custom_model": true,
  "description": "<string>",
  "pybamm_version": "<string>",
  "created_by_email": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.ionworks.com/llms.txt

Use this file to discover all available pages before exploring further.

Path Parameters

model_id
string
required

Body

application/json

Request body for adding a custom variable to an existing model.

name
string
required

Display name of the custom variable.

Minimum string length: 1
expression
string
required

PyBaMM expression string (e.g. CoupledVariable('Voltage [V]') - Parameter('Offset')).

Response

Successful Response

Model with config loaded from database.

name
string
required

The name of the model.

id
string
required

The unique identifier for the model.

user_id
string
required

The ID of the user who created the model.

organization_id
string
required

The ID of the organization this model belongs to.

created_at
string<date-time>
required

Timestamp of when the model was created.

updated_at
string<date-time>
required

Timestamp of when the model was last updated.

config
Config · object
required

Model configuration stored as JSON.

is_custom_model
boolean
required
read-only

Check if this is a custom model (has compressed model data).

description
string | null

An optional description for the model.

pybamm_version
string | null

PyBaMM version used for this model. If not provided, will be read from pybamm.version.

created_by_email
string | null

Email of the user who created the model.