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.
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.
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 "Browse" 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.
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.
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. You can see a progress bar at the bottom, which indicates how far through the integration you are(in terms of points computed).
Integration can be cancelled by either
Cancelling the integration will keep the integrator running, but will stop the current integration from completing.
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. You can quickly enable or disable all lines on the graph using the "Show All" and "Hide All" buttons.
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.
You can export the results of the integration as a comma-separated values file(CSV). This can then be loaded into spreadsheet or statistical programs for further analysis. To do this, enter a save filename into the text-box under the "Export" heading, and then click on the "Export CSV" button.
You can also browse for the filename to save to using the "Browse" button. Once you have selected a file, you must still click on the "Export CSV" button.
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.
You can use the fitter to determine model parameters using experimental measurements. To bring up the fitter dialog, click on To do this, load the model, and then click on the "Fitter" button in the "CellML Model Viewer" window. A tabbed dialog called "Fit Experimental Data" will appear.
The next step is to enter the parameters for the model. To add a parameter, click on the variable drop-down list, and select the variable to add. You must also enter an a priori estimate for the parameter. These should, at least, be able to give rise to a working model. mozCellML will attempt to refine your estimate to give better agreement with the data. When you have selected the correct variable and intial value, click on "Add Parameter". You can also remove parameters using the "Remove Parameter" button. Once you have removed a parameter, the details for that parameter are copied down to the boxes at the bottom. Clicking on "Add Parameter" will re-add the parameter unchanged.
To enter the measurements you have taken, click on the "Measured Values" tab in the fitter dialog. You have several options for data entry. Measurements must be at a certain point on the bound axis, and may be of either a differential variable or a mathematical expression in the model derived from differentials, constants, and other such mathematical expressions.
The simplest way is to manually add every measurement. To do this, enter the value of the bound variable, select the variable that was measured from the drop down list, and enter the value. Click on "Add Measurement" when you have finished with that measurement. Repeat for all measurements.
If you have a large number of measurements, you may wish to import them from a spreadsheet or statistical package. To do this, export the data as CSV from your package. You must lay out the file so that it has a heading row listing all the variables that have been measured(including the bound variable), and down the columns it has the measurements. Make sure that the names used for the columns match the names used in the CellML model. If you did not measure a certain variable at a certain time, leave that field blank. If you took two measurements of the same variable at the same time, create two rows with the same time. To load this CSV file into mozCellML, enter the filename into the textbox on the same row as the "Load CSV" button, and then press the "Load CSV" button. You can also use the "Browse" button on the same row to browse for files.
If you have entered your measurements into the user interface and you wish to save the measurements in a CSV format suitable for loading back into mozCellML, you can enter the filename into the text-box on the same row as the "Save CSV" button. You can also use the "Browse" button to select the filename. Once the filename has been entered or selected, click on the "Save CSV" button to save the measurements.
Once you have entered your measurements and parameters, you can click on the "Model Fitter" tab, and then click on "Compile Fitter". Once you have compiled the fitter, you can change model constants, parameters, and measurements without recompiling the fitter. Click on "Start Fit" to begin the fitting process.
Once you have fitted the data to the model, a new window appears with the estimated parameters.
You should NOT rely on these parameters without first integrating the model and confirming the output is satisfactory. The reason for this is that mozCellML will give parameters even if there is a large residual. If mozCellML gives poor results, it may be that your experimental data is inconsistant with the model, or mozCellML may have found a local minimum. You should fit the model several times using different a priori parameter estimates to get better results.
To create a new model from your fitted variables(which can be saved or integrated), click on the "Make CellML Model" button.