Writing the script for an ODE model versus simbiology

2 views (last 30 days)
Hi There,
I recently read a paper related to mathematical modelling of a biological system. All the ODEs were there in the article, so I tried to reproduce the dynamics of the model using “SIMBIOLOGY’ toolbox. It worked well and all the dynamics were similar to ones in the article. Later, I tried to write the code by myself (without using toolbox). Since it was my first time working with ODE functions in Matlab, I read the corresponding help documents in Matlab and tried to write the code. Surprisingly, the time course of results are completely wrong! I double check all the equations and other things (initial values and parameters) but everything was correct. I attached the simbiology file as well as the code I wrote. There are some equations that have “time” at the right side of equation like: dY25/dt = k60 + (k61 * Y27) – (deg(t) * Y26) … and deg(t) is a function of time (I attached the corresponding file). I read a post about this problem (of having time at the right side of equation) and did the same as the offered answer, but the problem is still remained! Do you think the problem is related to that?
Can you please tell me what the problem is why the dynamics of Simbiology and Matlab script are different? Can you please have a look at the overall structure of my script to see if I did a mistake (I am not talking about details, just the overall structure of writing a code to solve a set of ODEs)?
Another strange thing is that when I use the time span of [1:8000], which has 8000 time points, the results (dynamics) come out fast but when I use another time span [1: 60 :86400] , which has 1441 time points, the system will be very slow! Why is that?
I used the same process for a simpler model (mitotic oscillator), which is available in simbliology, but never get the correct dynamics (the corresponding file is mitotic_model).
Thanks you,
  2 Comments
Ingrid Tigges
Ingrid Tigges on 10 Nov 2014
Hi Ali,
How do you know that everything is correct in your set of ODEs? How did you verify it? There is a number of things that can lead to different results in SimBiology and when programming the same model by hand. Finding out the root cause in code which is more than just 10 lines is quite time consuming. Hence I am not sure whether anyone will do this for you here. Compare the equations very carefully with the ones in the paper (I like printing my code out for this kind of situation), check whether each parameter is correct, use the debugger. All these things will take time but this is how debugging of code is and what another person would have to do as well :-).
With respect to performance: What happens if you do not specify the time points? It might be that your system is stiff at late time points and hence MATLAB takes longer for its calculations. Hence it might be worth checking the performance if you do not specify time points. Also changing the ODE solver might help.
I hope this helps.
Ingrid
al
al on 12 Nov 2014
Thanks Ingrid. I found out that I made a mistake in just one equation.

Sign in to comment.

Answers (0)

Communities

More Answers in the  SimBiology Community

Categories

Find more on Scan Parameter Ranges in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!