> ## 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.

# Run a simulation in a study

> Run a protocol simulation inside a study — the Studies-page flow — against a saved parameterized model, and read its results.

On the Studies page you run a simulation against a saved parameterized model and it's filed under a study. From Python this is the same [`client.simulation.protocol`](/quickstarts/run-simulations) call, with a `study_id` so the run shows up on that study's **Simulations** tab.

<Note>
  Install and authenticate first: `pip install ionworks-api` and set `IONWORKS_API_KEY` and `IONWORKS_PROJECT_ID`. See the [Python API client](/api-client) page.
</Note>

```python theme={null}
from ionworks import Ionworks

client = Ionworks()

# A study to hold the run (see "Set up a new project"), and the parameterized
# model to simulate (see "Upload a model").
study = client.study.create({"name": "Cycling Test"}, project_id="your-project-id")
parameterized_model_id = "your-parameterized-model-id"

protocol = """
global:
  initial_soc: 1
  temperature: 25
steps:
  - Discharge:
      mode: C-rate
      value: 1
      ends:
        - "Voltage < 2.5"
"""

response = client.simulation.protocol({
    "parameterized_model": parameterized_model_id,
    "protocol_experiment": {"protocol": protocol, "name": "1C discharge"},
    "study_id": study.id,
})
client.simulation.wait_for_completion(response.simulation_id, timeout=120)

result = client.simulation.get_result(response.simulation_id)
print(result.time_series)   # DataFrame: one row per time point
print(result.metrics)       # dict of scalar metrics
```

**What's happening**

* This is the same call as [protocol simulations](/quickstarts/run-simulations); the `study_id` files the run under a study, so it appears on that study's **Simulations** tab in Studio.
* `parameterized_model` takes the id of a model you built (see [Upload a model](/quickstarts/upload-model)), or an inline quick model like `{"capacity": 5.0, "chemistry": "NMC/Graphite"}` for a throwaway run.
* Read results with `get_result(...)` — `.time_series`, `.steps`, `.metrics`. To sweep parameters across many runs, use `protocol_batch` (see [Run protocol simulations](/quickstarts/run-simulations)).

## Learn more

* [Studies](/simulate/studies) and [Simulations](/simulate/simulations)
* [Run protocol simulations](/quickstarts/run-simulations)
* [Set up a new project](/quickstarts/new-project) and [Upload a model](/quickstarts/upload-model)
