The Physiome CellML Environment basic tutorial
Starting up PCEnv
- Download the PCEnv binaries that you want to run.
- Decompress the binaries as follows:
- On Linux: tar -xjf <path to binary>
- On Win32: Run the installer binary, and follow the instructions from there.
- Run PCEnv:
- On Linux: <path to extracted files>/pcenv
- On Win32: Use the Start Menu option you created (default Start => Programs
=> Physiome CellML Environment => PCEnv)
Loading a model
- On the menu at the top of the PCEnv window, choose File => Open
- In the file selector dialog, navigate to tutorial in the PCEnv install
directory, and select coupled_pendulum_model.xml
- When the model has loaded, it will appear in the model selector on the
left hand side of the screen.
- You can open more than one model at one time, but only one model will ever
be selected in the model selector.
Changing an initial condition
- Locate the model tree view control. This is, by default, at the top of
the screen in the centre.
- Click on the variable 'a_angular_velocity'. You will see text-boxes
appear in both columns of the control. Now click on the text-box in
the Value column, delete the old value (0), and enter 1
- You have now changed the initial value of a_angular_velocity to 1
rad/s
- Note: If you want to see the units of a variable, click on the "+" symbol
left of the variable name, and it will expand to show this.
Changing the range of times to integrate across
- In the area below the model tree view, find the text-box to the right
of the words 'End time point'.
- Change the value in this box from 100 to 50. This will cause the
integration to be run between 0 and 50s
- Now click the big Integrate button below the textboxes. The integration
may take a few seconds to complete. You should still be able to use PCEnv
while it is running, and when it is done, it will say Integration
Complete.
Plotting your data
- In the bottom right corner of the screen, find the list of lines on
the graph (the key). It is an empty list right now, but you need to make
room for more entries. To do this, click on the thick line separating the
key (with the table containing columns Model, X, Y, Type) from the
graph axis above it, and drag the line up, so you have some more space
in the table.
- Click on the 'New' button at the bottom of the key. A new entry should
appear in the key.
- Left click on the little coloured square at the start of the row. A colour
selector will pop up. Click on a new colour. This is the new colour of
your line.
- Now left-click on the new entry, in the Y column. In the popup menu,
choose Pendulum Upper Segment => a.
- Now left-click on the new entry, in the X column. In the popup menu,
choose Environment => time. A plot should now appear on the axes.
- You can now try left-clicking in the Type column of the graph, and trying
out different glyphs.
Zooming in on data features
- Choose an interesting feature on the graph, for example, the little cusp
at around time 10. Press the left mouse button, and drag a box around the
data feature. When you release the mouse, you will be zoomed in on the
feature.
- To zoom out by 50%, right click on the graph, and choose Zoom Out.
- To go back to showing all data, right click, and choose Zoom Full.
Cloning models
- Once you have integrated a model, the model can no longer be changed,
otherwise it wouldn't correspond to the data. To enforce this, PCEnv
will 'freeze' your model once you integrate it.
- If you want to work with different parameterisations of the same model,
you need to 'Clone' it. Right-click on the Coupled Pendulum Model, and
choose 'Clone'.
- The clone is initially named by the date and time it was created.
Right click on the new cloned model, and choose 'Rename'. In the box that
pops up, enter a better name, e.g. 'Pendulum 2'.
- Now select the original model, and then left click on the line a vs time
line in the key, beneath the 'Model' column. Choose 'Copy selected model'.
This will tie this line to the initial model. We could have done this
later, but then the graph would keep getting redrawn as new data comes in
from the second pendulum, which slows things down somewhat.
Comparing data between model runs
- Select the 'Pendulum 2' model in the model selector.
- Change the initial value of a_angular_velocity to -1, and click the
Integrate button.
- Now repeat the process of adding a graph line. Make sure you choose
a different colour this time.
- You will now have two lines on the same axis, one for when
a_angular_velocity starts off at 1, and one for when a_angular_velocity
starts at -1.