> 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/sac-dsgc-network/model-simulation.md).

# Model Simulation

Similar to the single SAC example you can simulate, trace the voltage at the soma and plot it:

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

import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 14})
fig = plt.figure(figsize=(7,5))
plt.plot(results[0]['1'][1]['t'], results[0]['1'][1]['v'], ls='-', c='r', label='Exp', linewidth=4)
plt.ylim([-75, -40])
plt.show()
```

Note that here we are showing the soma voltage of the DSGC:

![](https://3823822112-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlM7rr4VP7XMZK5DA9U%2Fuploads%2FMlI9AEpRgjGhnJp8YCQ4%2FRandom%20Con.jpg?alt=media\&token=19c65f5c-a6ca-438d-a28a-ee55ec0c9b43)

In this experiment, we used a moving bar stimulus. We can verify in using:&#x20;

```
simulation.visualize_results()
```

The generated voltage traces are:

![](https://3823822112-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlM7rr4VP7XMZK5DA9U%2Fuploads%2FKgkvZPB7z09NKfz9o2l1%2Fv_trace.png?alt=media\&token=50b8009f-3fff-4170-861f-618287b2946e)

And the stimulus:

![](https://3823822112-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlM7rr4VP7XMZK5DA9U%2Fuploads%2F4JWHfrsgrgSbI5OlDFss%2FScreen%20Shot%202021-10-12%20at%2021.57.45.png?alt=media\&token=97124d8a-9ff8-486e-a69b-cb4300cf0ba7)
