MATLAB Answers

How can I find 4 constants values from and indirect fitting value?

1 view (last 30 days)
Elena Alicia Robles Molina
Commented: Arthur Goldsipe on 30 Apr 2020
Hello!
I hope I could get some help with an issue, I have an ODE system of 7 equations with 4 parameters which I would like to have modified to find the best fit to my experimental value. Nevertheless I cant seem to direct the function to modify the k values.

  0 Comments

Sign in to comment.

Answers (1)

Arthur Goldsipe
Arthur Goldsipe on 29 Apr 2020
I see that the SimBiology product is tagged for this post, but the attached files are not using SimBiology. I'm one of the developers of SimBiology, and we try to make it easy to solve this exact sort of problem in SimBiology, so that you can focus on the modeling and analysis. If you want to learn how to translate this problem into SimBiology, let me know.
But it looks like you want to use lsqcurvefit for fitting, with your ODE model solved using ode45. To do that, you will need to construct your model function in the form that lsqcurvefit expects, as described here. Anonymous functions are often helpful for this. But you situation is a little too complicated to use anonymous functions alone. So, I wrote a helper function that solves the ODEs and calculates yield. See the attached upated files for my solution to your problem.

  3 Comments

Arthur Goldsipe
Arthur Goldsipe on 29 Apr 2020
I forgot to add that I also used some of my preferred options for lsqcurvefit. It's usually important to increase the finite differencing step size. You can find an example of fitting to ODEs and a brief discussion of step size in this example and a longer discussion here.
Elena Alicia Robles Molina
Thank you very much Arthur, I have received similar comments about the complications of the system and how simbiology would be a better approach. Could you recommend me a tutorial or example to implement on my system.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!