Group Abstract Group Abstract

Message Boards Message Boards

Nonlinear fitting of reaction kinetics data with Kronecker delta and bootstrapping

6 Replies

Mathematica can solve with one condition: Prod[0] =0

POSTED BY: Mariusz Iwaniuk

From the initial attempt to fit the data I gather that Ald is the benzaldehyde. The data has numerous y values for the same x values though. Was this from multiple experiments? If so, it would make sense to perhaps ,average those y values.

Maybe more important is the question of what exactly is needed. Is it the DE solution? Or identification of the parameter value for kzero? If the latter, I would suggest using ParametricNDSolve, especially if there are known values for initial concentrations. One could proceed like so, using data from this post's notebook.

Average the values:

newdatabenz = 
 Map[{#[[1, 1]], Mean[#[[All, 2]]]} &, SplitBy[databenz, First]]

(* Out[118]= {{0., 0.0174805}, {361., 0.0102426}, {659., 
  0.006913}, {944., 0.00504}, {1241., 0.00391667}, {1528., 
  0.0037}, {1825., 0.00334333}} *)

Get a parametricized numeric ODE solution function for the aldehyde.

solP = ParametricNDSolveValue[{Ald'[t] == -kzero Ald[t] Hydr[t],
    Hydr'[t] == -kzero Ald[t] Hydr[t],
    Prod'[t] == kzero Ald[t] Hydr[t], Ald[0] == .026, Hydr[0] == .025,
     Prod[0] == 0}, Ald, {t, 0, 2000}, kzero];

Find a fit to the averaged data:

(* kzfit = 
 FindFit[newdatabenz, solP[kzero][t], {{kzero, .1}}, t]

Out[121]= {kzero -> 0.181871} *)

Plot the solution curve and data points:

kzval = kzero /. kzfit;
Show[ListPlot[newdatabenz, PlotStyle -> PointSize[0.025]], 
 Plot[solP[kzval][t], {t, 0, 1825}, PlotRange -> All],
 PlotRange -> All]

enter image description here

Not bad except for the first point.

POSTED BY: Daniel Lichtblau
POSTED BY: Daniel Lichtblau

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial columns Staff Picks http://wolfr.am/StaffPicks and Publication Materials https://wolfr.am/PubMat and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard