Plotting vs Fitting, why is different?

Hello, I want to follow up another problem regarding my previous question ( link here ). So, I have tried fitting the graph to the experimental data and also plot the model, both with the exact same parameters, however the results are different. I expect the plot to be similar looking, but they are not.
(left figure is for fitting, right figure is for plotting the model)
Here is the reference of what I actually want to achieve from the fitting and plotting the graph:
I have attach both of the files. Can you help me with this? Why are my fitting and plotting have different result? And maybe does anyone know how to do fitting like the reference I send above? I feel like it needs a different code (probably like a discontinue method or something, it seems like that to me because the reference's model is not a smooth curve). Thank you so much for your attention, any advices and answers are super welcomed!

7 commentaires

Cris LaPierre
Cris LaPierre le 3 Jan 2022
Look at your blue Y-axis values in the plot on the right. They start at -45. This suggests that your model for Substrat is not very good, meaning it does not do a good job modeling the data. Try seeing if you can improve the fit of that model.
Regina Maria
Regina Maria le 3 Jan 2022
@Cris LaPierre thank you so much for your advice, I also think that the Substrat model is not doing a great job. By any chance, do you maybe know how to improve the model?
Cris LaPierre
Cris LaPierre le 3 Jan 2022
Modifié(e) : Cris LaPierre le 3 Jan 2022
You're not really fitting if you are using ode45. How did you come up with the parameters for your differential equations?
  • Miumax,Ks,Kxi,KXI,CXm,CPm,Miupx,YPX,KPS,Kpi,KPI,KP,Miusx,YXS,YPS
Edit: Nevermind. I found the publication.
Cris LaPierre
Cris LaPierre le 4 Jan 2022
How did you determine the values of the experimental data (matrix c)?
How did you come up with your equation for dCx/dt: dCdt(1,:) = mu*C(1);
I used your equations to try to recreate figures 3 and 4 in the linked paper, which I figured would be easier, and got nothing close.
Regina Maria
Regina Maria le 4 Jan 2022
@Cris LaPierre for the experimental data, I use webplotdigitizer (free online software) to determine the values. It is not 100% accurate, but at least it makes the work easier to instantly give out the values.
Second, for the equation of dCx/dt, it is not stated in the paper, but the common kinetic equation of dCx/dt is miu*X, so I made it like that. I have tried fitting the data using dCx/dt as miu equation only (without X), and the code runs for a long time and I seem to not get the result from it.
Cris LaPierre
Cris LaPierre le 4 Jan 2022
Modifié(e) : Cris LaPierre le 4 Jan 2022
A couple other things to look into. First, consider adding a 'NonNegative' contraint on the solution. Your bioreactor cannot create negative concentrations.
opts = odeset('NonNegative',1:3);
Second, verify the units. The paper appears to be quite careless about this. For example, has units mg/L, and has units of g/L, yet somehow works. I'm even more concerned about light intensity with units . For example, in equation 4 (μ), part of the calculation is yet has units g/L. Then somehow the resulting unit of the entire calculation is 1/day. Where did and go?
Star Strider
Star Strider le 8 Jan 2022
Please check the coding for the differential equations (specifically ‘miu’ and all the ‘dcdt’), since I suspect there may be problems.
I ran this optimisation for two days (with occasional interruptions and re-starts when the integration crashed) using the ga (genetic algorithm) function (that is in my esperience extremely robust), and could not get it to converge on a solution.
.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Get Started with Curve Fitting Toolbox dans Centre d'aide et File Exchange

Produits

Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by