Loading CellML models

You can load new models using the CellML main interface. The location of a model is specified using a uniform resource locator(URL). The URL can use any protocol supported by your Mozilla installation. For example, you could use a http:// URL, or an ftp:// URL, or a file:// URL. If you know the URL, type it in the textbox at the top of the CellML Main Interface, and then click the button to the right of the textbox, labelled "Load CellML".

Because you will often want to load a model from your filesystem, you can click on "Browse Local Files". You will now get a dialog box prompting you for the location of the file. You can use this box to navigate your filesystem. When the box first comes up, it will show all files with the extension .cml and .xml. You can change this by clicking on the drop-down box labelled "Files of Type" and choosing another option from the list. After you click okay, the file:// URL for the file you selected will appear in the box. You can now click "Load CellML" to load the file.

Editing Boundary Conditions

Before you can edit boundary conditions, you should be in the "CellML model viewer" window. If you are not, you need to load the model first.

In the model viewer window, you should see a listbox listing all the variables in the model, with their name, type, value, and units. Click on a row in this box, and below the box, you will see that the initial value of that variable appears in the textbox labelled "Initial Value". You can edit this textbox to change the initial value.

Only differential and constant variables may be edited in this fashion.

Saving Models

Once you have changed some boundary conditions for a model, you can save this edited model as a new model. To do this, you can type the filename(not URL) into the textbox under the "Save Model" heading, and then click on the "Save CellML" button.

If you don't know the exact filename, you can also click on the "Browse" button to pick a file from your filesystem. After you click the "Okay" button on the dialog that comes up, the textbox will be filled in for you, and you can click "Save CellML".

Warning: The "Save CellML" button will overwrite existing files. If you use the "Pick Local Filename" dialog to select the file, you will get a warning when selecting the filename. However, if you type in the filename manually, you will receive no warning before overwriting the file.

Compiling an integrator

Before you can integrate the model, you must compile an integrator. To do this, load the model, and in the CellML Model Viewer window, click on the "Compile Integrator" button. There will be some delay as the integrator is compiled, and when the process is complete, the "Compile Integrator" button will disappear, and the "Start Integration" and "Cancel Integrator" buttons will appear.

Once you have compiled an integrator, you can use it to integrate the model as many times as you like, provided you keep the CellML Model Viewer window open. You do not need to recompile the integrator if you change the integration parameters or the boundary conditions.

Integrating a model

Before you can integrate the model, you must compile an integrator.

In the CellML Model Viewer window, there are a number of parameters you can modify under the "Numerical Integration" caption.

The interval parameters specify the range of X values over which integration will take place. The units are the same as the bound variable units in the model. You should note that the starting X value is the bound variable point at which the boundary conditions apply. This will usually be zero, unless you are continuing an integration which is partially complete.

The grid resolution specifies the interval at which results are reported from the integrator back to mozCellML. This affects the resolution of the data that you can see on the graph, and when stepping through time to view values, but it does not affect the accuracy of the numerical integration points themselves. This is not the step size, it only controls the reporting of data.

The relative and absolute error control parameters set a tolerance for relative and absolute errors. A single tolerance value is used for all variables.

Once you have set the parameters of integration to values of your liking, you can click on the "Start Integration" button. A new window will open, called "CellML Integration Results". This window will open immediately, and doesn't wait for integration to complete.

Cancelling Integration

Integration can be cancelled by either

Cancelling the integration will keep the integrator running, but will stop the current integration from completing.

Graphing the integration results

To graph the integration results, you must first integrate the model. You can then select which values you want to plot on the graph, and the colours in which they should be plotted. To enable a certain value to be plotted, or to disable plotting, select the value in the list of variables in the "CellML Integration Results" window, and click on the visible checkbox to turn it on or off. You can also change the colour of the line on the graph by clicking on the coloured rectangle labelled "Graph Colour" and selecting a new colour. Graphing has not been added to this release.

Browsing the integration results

To browse the integration results, select a variable to view in the list. You can now drag the slider to change the point on the bound variable that you are viewing the model at. You can also type a value into the textbox to the right of the slider.

Once you have selected a point on the bound variable, you can now click on other variables in the listbox to see the values of the other variables at a particular time.

Making a new model from the integration results

You can also create a new CellML model, by putting the integration results as the boundary conditions for the new model. To do this, select the point on the bound variable by using the slider or the textbox to the right of the slider in the "CellML integration results" window, and then click on the "Clone Model At Time" button. A new "CellML Model Viewer" window will open, containing the new model. You can now save this model, or continue the integration from this point.

Bear in mind that the boundary conditions have been set to values at a specific point on the bound variable. Therefore, if you wish to continue the integration from the point at which it stopped using the new model, you should start the time interval at the same time at which you previously stopped it.