SimBiology: 'Integration Tolerance Not Met' error occurs when the dose start time is set later than a fixed value.
Mostrar comentarios más antiguos
I am using the simbiology QSP model from H Wang et al., "Dynamics of tumor-associated macrophages in a quantitative systems pharmacology model of immunotherapy in triple-negative breast cancer", iScience, 2022.
The model includes a drug treatment that works fine with both the SUNDIALS and ODE15s solvers when the dose start time is set to day 0. However, when the dose start time is set to a value later than 0, I encounter the 'Integration Tolerance Not Met' error. The error appears earlier with SUNDIALS; for example, it occurs when the dose start time is set to 7 days. In contrast, the simulation runs without issues using ODE15s until the dose start time is set to 15 days.
Surprisingly, with ODE15s, when I reduce the dose amount from 100 units to 20 units, the simulation runs fine with the delayed dose start time set to 40 days. However, if I further delay the dose start time to 50 days, the simulation fails again.
Any help will be higly appreciated.
8 comentarios
Arthur Goldsipe
el 20 de Mzo. de 2025
Can you clarify how to reproduce this error? I downloaded the code from here, but I don't know what to do next.
Debojyoti Biswas
el 20 de Mzo. de 2025
Arthur Goldsipe
el 20 de Mzo. de 2025
Just to set expectations, I won't be able to look at this until Monday.
Debojyoti Biswas
el 21 de Mzo. de 2025
Debojyoti Biswas
el 23 de Mzo. de 2025
Arthur Goldsipe
el 24 de Mzo. de 2025
I'm having trouble reproducing the error. Also, the line numbers you mention don't quite match what I see when downloading the file. Is it possible you have a different version of the code? Please double-check what I did.
After downloading the code from here, I uncommented line 83 of immune_oncology_model_TNBC.m, which looks like this:
dose_schedule = schedule_dosing({'nabPaclitaxel'});
Then, I changed line 48 of schedule_dosing to the following:
addParameter(in,'nabPaclitaxel_schedule',[42,28,15]);
Finally, I ran immune_oncology_model_TNBC. It worked without error. I tried in R2024b, R2023b, and R2022b, on both Mac and Windows.
If it's easier, please feel free to attach your version of the code in a zip file. Also, it might be helpful to share the output of "ver" in the MATLAB version(s) where you see the failure so that I can get more details about your setup.
Debojyoti Biswas
el 31 de Mzo. de 2025
Editada: Debojyoti Biswas
el 31 de Mzo. de 2025
Arthur Goldsipe
el 31 de Mzo. de 2025
Thanks. That is extremely helpful. I can now reproduce the error. I will investigate.
Respuestas (1)
Arthur Goldsipe
el 2 de Abr. de 2025
Editada: Arthur Goldsipe
el 2 de Abr. de 2025
0 votos
The error is due to an inability to solve the equations within the specified error tolerances. Unfortunately, I believe this is a fundamental characteristic of your model. If I loosen the absolute tolerance to 1e-6 (instead of 1e-9) then I am able to simulate without error for a longer simulation time. However, even with the looser tolerance the equations solve very slowly. In fact, even when I use sbioaccelerate (which typically speeds things up maybe 10 or 20 fold), I estimate it would take several days to simulate this model for the full 400 days on my M2 Max Mac Studio. This is just an indication of how hard these equations are to solve.
When I plot the results, I see that V_1.NabP and V_2.NabP rise very quickly after the first dose is applied. Decreasing the dose amount decreases the rate of increase of these species, allowing the equations to be solved with a tighter tolerance. But the exact conditions that will trigger a solver error will vary depending on a lot of factors.
Unfortunately, I don't have the time to dig deeper into what makes this model so difficult to solve. You could consider doing some sort of analysis, say local sensitivity analysis, if you want to figure out exactly what makes the model so challenging.
1 comentario
Arthur Goldsipe
el 2 de Abr. de 2025
I have an update. If I run your run_me script and then make the following changes, I can successfully and quickly simulate the for the entire 400 days.
cs = getconfigset(model);
cs.SolverOptions.AbsoluteTolerance = 1e-6;
cs.SolverOptions.AbsoluteToleranceScaling = true;
simData = sbiosimulate(model,[],[],dose_schedule);
These changes significantly relax the error control. But it's possible that this means you aren't solving other parts of your model with sufficient accuracy. One reason I say that is because I also tried updating your script to set these options at the beginning (that is, before calling initial_conditions). If I do that, I get the message that 'Tumour did not reach specified initial tumour diameter with current parameters.'
Comunidades de usuarios
Más respuestas en SimBiology Community
Categorías
Más información sobre Scan Parameter Ranges en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!