Fit 2 parameters with fminsearch and use ODE15s to solve single differential equation
2 次查看(过去 30 天)
显示 更早的评论
Hello ! I am currently working on a project looking at tumor growth. I have to try different mathematical models from the litterature and fit them using some data.
For the momment I am trying to fit the Gompertz model of a tumor grotwh which is the following differential equation: (a-b*ln(v))*v)
In my code a is p(1) ; b is p(2) ; v is y(1).
I have made a first file to solve the differential equation.
Then I made a second file to fit the model with some data that I've got.
My code seems to work but I am getting estimated parameters very different from what I was expected which was around 1 or even less for a and b respectively. Also I shouldn't get a negative value.
I have tried to follow some previous examples of the MATLAB answers from Star Strider, so I am not at all sure about what I have done.
If someone could tell me if my code is correct It would be much appreciated. I have attached my 2 files.
Thanks in advance !!!
1 个评论
采纳的回答
Star Strider
2019-12-16
Using that model of the Gompertz equation, your code is correct.
If you want to avoid negative rate constants, use lsqcurvefit instead, with constraints on the lower limits of the parameters:
B = lsqcurvefit(@fit_GompModel, p0, t, y, [0 0])
producing:
B =
68.5834500164402
6.38601980323603e-12
This give a straight line, however that is likely the best you can do. I doubt that ga (genetic algorithm) or other solvers will produce any different result, although I did not try them.
6 个评论
Star Strider
2019-12-19
I cannot get your model and data to work with fitnlm. I am not certain what the problem is, however it may be that there are too few data. It works with nlinfit, however the parameters are both negative, so the statistics would be irrelevant.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interpolation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!