How to use ecell from an ipython console with pylab

If you use Ecell simulator sometimes it’s handy to have a way to use it inside an ipython/pylab session to quickly test some features and try some small thing.

For this reason I’ve created a class called quickEcell which takes care to initialize ecell simulator, create the ses object and offer a qcuik way to create loggers and plot the variable.

Below is the minimal to run a model and plot it. All the code is on http://github.com/mattions/QuickEcell

"""Demo method. This should be the skeleton of your simulation"""

qE = QuickEcell('simple_ecell_mod.eml')
variables = ['S', 'P']
loggers = qE.create_loggers(variables)
qE.run_and_plot(1000, variables, loggers)
plt.title("Test for Michaelis-Menten")
plt.show()

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s