Plotting vs Fitting, why is different?
2 views (last 30 days)
Show older comments
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 Comments
Cris LaPierre
on 4 Jan 2022
Edited: Cris LaPierre
on 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
on 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.
.
Answers (0)
See Also
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!