Skip to main content

Week 5

  

Progress this Week

This week I implemented the Runge-Kutta 4th order method in the simulator. I have also added support for command-line arguments for model filename, duration and step size. The RK4 method is the default for now. Command-line argument support is built using the clap library.

Here's how the simulator can be run:

    
> cargo run -- -h
SBML Simulator in Rust 1.0 Pranav Ballaney <ballaneypranav@gmail.com> A simulator for SBML models. USAGE: sbml-sim [FLAGS] <INPUT> <TIME> <STEPS> FLAGS: -h, --help Prints help information -v Sets the level of verbosity -V, --version Prints version information ARGS: <INPUT> Sets the input file to use <TIME> Simulation duration in seconds <STEPS> Number of steps for numerical integration


To check my implementation, I compared the results with the standard results in the SBML test suite as well as the results of the libsbmlsim simulator. For the first 25 models, the results of my simulator match with the standard when the step size is 0.1, but for larger step sizes like 0.3, the results match with an absolute error of around 0.01, which is probably a limitation of the RK method itself.

Comparing with the libsbmlsim results, I found that the results match with a step size of 0.3 as well, but some of the models in the test suite have fractional durations in their settings (for example, simulating from 0 to 5.5 seconds). This is something I haven't implemented yet, so the tests fail here. 

While I can confirm that the underlying implementation of the Runge-Kutta 4th order method is correct, more rigorous testing is required for a few models out of the first 25 in the test suite. I plan to work on this in the coming week.

Progress so Far

According to the proposed timeline, the Runge-Kutta integrator was supposed to be implemented last week and that is complete. So, despite some delays initially with the parser, I'm back on track with the timeline. 

Plan for the Coming Week

  1. More rigorously resting my implementation of the Runge-Kutta method
  2. Improving the command-line interface
  3. Implementing evaluation of function definitions in SBML and lambda functions in MathML (this is partially done)
  4. Runge Kutta Fehlberg integrator

Comments