I am currently working on an optimization of chemical kinetic model. Starting points for FindMinimum is defined as: $k_{10} = 2.45\cdot 10^{-1}$ and $k_{20} = 8.65\cdot 10^{-11}$.

The step monitor is used to show calculated values of $k_1$ and $k_2$ and a value of the objective function.

The goal function is:

Diff[k1diff_, k2diff_] :=
 Sum[(TGexp[[i]] - 
      TG[k1diff, k2diff][texp[[i]]] /. ParEq)^2, {i,1, Length[texp], 1}];


 FindMinimum[{Diff[k1opt, k2opt], k1opt >= 0, k2opt >= 0,   {{k1opt,
 k10}, {k2opt, k20}}, StepMonitor :> {Print[i, ": k1=", k1opt, " k2=",
 k2opt," Error=", 
      Diff[k1opt, k2opt]], i++}, MaxIterations -> 200];

The problem is that on the 1st step, when $k_1$ and $k_2$ should be equal the starting points values, these values are $k_1=0.245$ and $k_2=0.001$. So the $k_2$ has probably a problem with precision. I have tried to solve this issue using WorkingPrecision option in FindMinimum, but nothing changed.

Could anyone help with the problem? I want that the $k_2$ value will be the same as the value of $k_{20}$ variable.

  • $\begingroup$ Without knowing anything about the objective function it is impossible to give specific advice about how accurate the starting values need to be for convergence to a local or global minimum. $\endgroup$ – hardmath Mar 25 '15 at 12:47
  • $\begingroup$ This question is probably more fit for Mathematica.SE. $\endgroup$ – A.P. Mar 25 '15 at 12:55
  • $\begingroup$ The post is edited, I have added the goal function. $\endgroup$ – Valentin Mar 25 '15 at 13:04
  • $\begingroup$ I agree. I am migrating this, because answering this may require (as far as I can tell) familiarity with Mathematica's syntax and logic. Valentin, I am migrating this to Mathematica.SE. They have their own standards for layouts of question. Follow your question there, ask locals for help, and try and edit the question to conform with what they want. They like the code snippets displayed a bit differently, because the answerers like it if they can copy/paste the code snippet to a notebook, and run/examine it there. I edit to give you the idea, but I'm not sure if that's exactly what they like. $\endgroup$ – Jyrki Lahtonen Mar 25 '15 at 15:23
  • $\begingroup$ Well. They didn't like it there, and rejected the migration. Reopening this, so that anyone so inclined can answer. $\endgroup$ – Jyrki Lahtonen Mar 26 '15 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.