Week 8: LSODA Gets Smarter

Hi all,

Okay, Continuing our story from last blog. So, after spending the past week chasing down the issue with SBML Test Suite failures (which I elaborated on in my last blog post), I finally got a breakthrough that brought us closer to a robust and reliable LSODA integration in SBSCL.

Revisiting the SBML Test Suite Challenges

Previously, around 12% of the tests were failing and 2% were throwing outright errors. After narrowing the root cause down to event handling discrepancies, I spent this entire week diving deeper into tackling this challenge.

Dr. Dräger shared a fantastic resource (link), which not only confirmed my theory but also revealed that previous developers had faced similar problems while implementing the Rosenbrock solver in SBSCL. It turns out that precise event time detection is a non-trivial challenge when dealing with SBML models.

When events are triggered between timepoints (say at , which lies between tτ−1 and tτ+1), evaluating events only at those boundary points may completely miss the triggering condition. This demands a step-size adaptation mechanism capable of “hitting” the exact event time.

The Rosenbrock solver addressed this by adapting its step size whenever an event alters the computed state vector. The minimal step size ultimately defines how finely events can be captured.

Simulating Event-Aware LSODA Behavior

Taking inspiration from that mechanism, I refactored the computeChange() method of LSODA. Here's what I did:

  • Let Sol(next) be the result from LSODA at time t + h.

  • Process events and rules after computing this result.

  • If processing causes any change in Sol(next), it implies an event was triggered.

  • In that case, reduce h (by a factor of 1/10) and try again.

  • If the solution stabilizes, increase h (by a factor of 6) for the next step.

This loop ensures that event-triggered changes are captured at the most precise point possible.

Results?

After making these changes, I ran the test suite again. The outcome was fantastic. Finally, I saw some actual progress:

  • Over 95% of the test cases passed immediately!

  • A small number still failed, mostly related to fast reaction tags.

  • After further digging and fixing a subtle issue — ~99% of the test cases passed.

This is the result map from the SBMLTestRunner.

For the remaining 1% that still fails, I couldn’t track down the precise cause. However, with this result I'm convinced that the core LSODA integration is now working correctly and is well-aligned with the SBSCL pipeline, including SBML compatibility. As suggested by Taichi, I’ve opened this issue with all the details around the remaining test failures. 

Next Steps

  • Start working on comprehensive documentation for LSODA including internal working, algorithm flow, and best practices.

  • Collaborate with mentors to finalize any loose ends in integration.

Personal Note

Due to a some miscommunication, we couldn't have our weekly meeting. We’ll catch up on Slack and resume discussions next week. And yes — on a personal note, I received my midterm evaluations result and the feedback. I passed! I can’t express how happy and grateful I feel. Thank you Google, NRNB and my wonderful mentors for this incredible opportunity. 

Thanks for reading!
- Bye! 👋

Comments

Popular posts from this blog

Week 7: Events, Exhaustion and Evaluations

My GSoC 2025 Journey Begins

Week 1: Coding Period Begins