Progress this Week Last week I had almost finished working on RateRules but I was having some trouble with models where the compartment size was being changed through a RateRule. Species in SBML models can be expressed in terms of their concentrations or their amounts. This is an issue that the SBML reference describes in great detail, so I had taken appropriate care to distinguish between the two while developing the simulator, however, there were still a few issues that caused the error I described above. In our weekly meeting, we spent some time discussing this and the mentors suggested that I try an alternative approach, where the AST nodes will be modified before running the simulator. So, wherever a species occurs in an AST in concentration units, it is changed to (species / compartment). This allows the simulator to substitute amount values while evaluating mathematical expressions and makes integration easier and more accurate. While doing this, I found another error, where I h...
Progress this Week The Runge Kutta Fehlberg integrator was completed last week with help from mentors during our weekly meeting. After that, I started working on Rate Rules. I also modified the data structure I had built earlier and it's a lot more robust now. Earlier, I was using the parsed model directly from the sbml-rs package. That was a problem because the SBML specification allows various ways to set values for quantities like species. For example, it is possible to assign initial amounts/concentrations to species using the initialAmount or initialConcentration attributes on <species> tags directly, but it's also possible to assign these values using an initialAssignment . Due to this, while parsing the model, the amount field on a species struct is an Option<f64>. This creates trouble later while simulating because you have to pattern-match at each step. Hence, this week I created similar structs in the sbml-sim package whi...