Hello everyone! I am trying to model the kinetics of an experimental system. I am trying to find the values of 3 variables in a system of differential equations by fitting them to an experimental data set. I have values for "g" as a function of time and I would like to find the values of "k1", "k2", and "k3" that provide the best fit to my data with minimun and maximum value constraints. The values of the k's in my example below are the correct values, as I have set this up to learn how so I can apply it to a more complex system. I've tried to learn through the online resources of Mathematica but I am having trouble getting it to work for me.
So in short, I would like to find the values of k1, k2, and k3 that solve my set of equations to best fit my experimental values of g. Notebook below:
k1 = 20;
k2 = 10;
k3 = 2;
totaltime = 3;
dataset1 = {{0, 0}, {0.15, 0.271161}, {0.3, 0.525314}, {0.45,
0.68284}, {0.6, 0.782049}, {0.75, 0.846992}, {0.9,
0.890934}, {1.05, 0.921414}, {1.5, 0.969472}};
solution = NDSolve[
{a'[t] == -k1*a[t]*b[t],
b'[t] == -k1*a[t]*b[t],
c'[t] == k1*a[t]*b[t] - k3*c[t]*f[t],
d'[t] == -k2*d[t]*e[t],
e'[t] == -k2*d[t]*e[t],
f'[t] == k2*d[t]*e[t] - k3*c[t]*f[t],
g'[t] == k3*c[t]*f[t],
a[0] == 5,
b[0] == 2,
c[0] == 0,
d[0] == 2,
e[0] == 1,
f[0] == 0,
g[0] == 0},
{a, b, c, d, e, f, g},
{t, 0, totaltime},
MaxSteps -> Infinity];
Show[{ListPlot[dataset1, PlotRange -> {{0, 1.6}, {0, 1}},
PlotRangeClipping -> True]},
Plot[Evaluate[{f[t], g[t]} /. solution],
{t, 0, totaltime}, PlotLegends -> {"f", "g"}]]