Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. data = {{18.283, 0.0003365}, {39.415, 0.0003892}, {60.547,
  2. 0.00045}, {81.679, 0.0005631}, {102.811, 0.0006446}, {123.943,
  3. 0.0006756}, {145.075, 0.0007655}, {166.207, 0.0008306}, {187.339,
  4. 0.0008814}, {208.471, 0.000896}, {229.603, 0.0009816}, {250.735,
  5. 0.0011191}, {271.867, 0.0010797}, {292.999, 0.0011473}, {314.131,
  6. 0.0012265}, {335.263, 0.0013187}, {356.395, 0.0012809}, {377.527,
  7. 0.0013523}, {398.659, 0.0013841}, {419.791, 0.0014507}, {440.923,
  8. 0.0014885}, {462.055, 0.0014898}, {483.187, 0.0015491}, {504.319,
  9. 0.0015838}, {525.451, 0.0015651}, {546.583, 0.0015903}, {567.715,
  10. 0.0016328}, {588.847, 0.0016423}, {609.979, 0.0016149}, {631.111,
  11. 0.0016508}, {652.243, 0.0016296}, {673.375, 0.0016465}, {694.507,
  12. 0.0016776}, {715.639, 0.0016668}, {736.771, 0.0016685}, {757.903,
  13. 0.0016967}, {779.035, 0.001717}, {800.167, 0.0016997}, {821.299,
  14. 0.001721}};
  15. tmax = Max[data[[All, 1]]];
  16. e0 == 0.0002;
  17. k21 == 0.001;
  18. kh == 0.0001;
  19. model = ParametricNDSolveValue[{s'[
  20. t] == -16 s[t] (0.0002 - x1[t] - x2[t]) + k21 x1[t] - kh s[t],
  21. x1'[t] == 16 s[t] (0.0002 - x1[t] - x2[t]) - (k21 + k2) x1[t],
  22. x2'[t] == k2 x1[t] - k3 x2[t],
  23. p1'[t] == k2 x1[t] + kh s[t],
  24. s[0] == 0.002, x1[0] == 0, x2[0] == 0, p1[0] == 0},
  25. p1, {t, 0, tmax}, {k2, k3}];
  26. fit = NonlinearModelFit[data,
  27. model[k2, k3][t], {{k2, 0.4}, {k3, 0.7}}, {t, 0, tmax}]
  28. plotfit = Plot[fit[t], {t, 0, tmax}, PlotRange -> {0, 0.0021}];
  29. plotdata = ListPlot[data, PlotStyle -> PointSize[0.01]];
  30. Show[plotfit, plotdata]
  31.  
  32. NDSolve::deqn: Equation or list of equations expected instead of True in the first argument
  33. General::ivar: 0 is not a valid variable. >>
  34. ParametricNDSolve::dsvar: 0.016777965285714284` cannot be used as a variable. >>
  35. General::ivar: 0.016777965285714284` is not a valid variable. >>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement