> For the complete documentation index, see [llms.txt](https://elishai.gitbook.io/retinal-stimulation-modeling-environment/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://elishai.gitbook.io/retinal-stimulation-modeling-environment/single-sac-model/model-simulation.md).

# Model Simulation

Simply simulate the model using:

```
simulation.simulate()
```

Simulation results can be obtained in various ways.

Retrieve voltage trace in the cell soma:

```
results = simulation.trace_voltages_at_soma()
```

Now, two files are automatically generated in the corresponding results folder: trace graph (see below), and a pickle file containing a Python dictionary with the retrieved data.

You can retrieve and plot the soma voltage using:

```
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(8,5))
plt.plot(results[0]['0'][1]['t'], results[0]['0'][1]['v'], ls='-', c='r', label='Expanding stimulus',linewidth=3)
plt.legend()
plt.show()
```

![](/files/-MlQmVkARDj9tpamTVZQ)

You can also call the visualize results function:

```
simulation.visualize_results()
```

The following files will be generated:

* Stimulus
* Voltage traces across all sections

![Part of the generated stimulus](/files/-MlQnw0jIwsoZ4ZC1KSc)

![Part of the traced voltage across the model](/files/-MlQo92vPCjBG9AHSVEL)
