Clear Filters
Clear Filters

Modeling Mitochondria Voltage depending on the Sodium/Potassium Pumps results in Algebraic loops Error.

2 views (last 30 days)
Hello All,
I am having this error in my code.
--> Error reported from ODE Compilation:
Initial assignment rules and repeated assignment rules cannot create explicit or implicit algebraic loops (for example, 'x = y' and 'y = x'). Implicit references to compartments occur when referencing a species in concentration. The following rules introduce algebraic loops into the model:
The equation is to calculate the mitocondria voltage based on the chemical pumps and electrodefusion. however, the reaction rates for these pumps depend on the miltocondria voltage. As a result, my code has algebraic loop problem. How should I work around this issue?

Accepted Answer

Arthur Goldsipe
Arthur Goldsipe on 4 Apr 2024
Can you share your model? That would allow me to offer more specific advice. (If you're not comfortable posting it publicly, please feel free to reach out to me directly.)
The error message normally lists the rules that are involved in algebraic rules. That information might give you a little more insight into where the loops are occurring. But ultimately, we will probably need your modeling expertise to figure out how to break the algebraic loop.
Here's a concrete example. Let's say you have these repeated assignment rules in the error message:
a = b + 1
b = c + 1
c = a + N
These rules create an algebraic loop for a, b, and c. Depending on the value of N, there may be no valid solution to equations. Or there may be an infinite number of solutions to the system. So you need to figure out HOW these values are supposed to be uniquely determined. For example, maybe you intended for c(t) = a(t=0) + N(t). One way to fix the model would be to create a separate parameter a0 that where you hard-code the value of a at t=0. Then, update the final repeated assignment rule to
c = a0 + N
That way, SimBiology determines that (at each time) c must be calcuated first, then b (from c), and a (from b).
-Arthur

More Answers (0)

Communities

More Answers in the  SimBiology Community

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!