필터 지우기
필터 지우기

Fit 2 parameters with fminsearch and use ODE15s to solve single differential equation

조회 수: 3 (최근 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 !!!

채택된 답변

Star Strider
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
hna
hna 2019년 12월 19일
Thanks again. Last question ..
I tried to code my model using fitnlm just to see the difference in terms of parameters with fminsearch but it dosn't seem to work... I have attached my file if you have time to get a quick look..
Also what is the most accurate in terms of paramters calculation between the 2 functions ?
Star Strider
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 CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by