# Numerical integration of first order differential equation & fitting to experimental data

We are working on phase transformation kinetics in Advanced High Strength steels and we are trying to fit our experimental data to the following differential for recristallization, by Kulakov et. al 2014. The variable model parameters are $$b_0$$, n, Q .

We put this model into an Excel sheet and used both RK4 and Forward Euler, however this does not seem to yield the results.

Possible causes of problem:

• Type-o's in the sheet. [Have been ruled out after 2 days I guess]
• Incorrect use of constant $$b_0$$, I do not know what to do with the part withing square brackets of this variable: $$1.1*10^{29}*[s^{-1.7}]$$
• Wrong application of numerical integration methods.

I used my textbook for the RK4 method and this little tutorial for the Forward Euler: http://bmi.bmt.tue.nl/sysbio/Education/Excel_Euler_simulation.pdf

If anyone can give me any tips ( or tell me how to upload my spreadsheet to let someone take a look ) please help me out. This is a rather big bump in the road towards finishing my bachelor thesis =]

Kind regards and thanks in advance!

• 1. Perhaps this is a silly question, but I have to ask it: does your experimental data correspond to a recrystallization? 2. Your DE there has no $t$ on the RHS, so far as I can see. (Is the $T$ in the equation for $b$ really upper-case? Or is it lower-case? Mathematics is case-sensitive!) That means it's theoretically separable. Have you tried integrating it that way? It actually looks doable. – Adrian Keister Dec 14 '18 at 15:24
• Could you write your computations in some code or pseudo-code form into a code environment? It is not clear from the image what variables are connected, the same, ... – LutzL Dec 14 '18 at 15:24
• Is it $\left(\ln\left(\dfrac{1}{1-X}\right)\right)^{(n-1)/n}$ or $\ln\left(\left(\frac{1}{1-X}\right)^{(n-1)/n}\right)?$ – Adrian Keister Dec 14 '18 at 15:41
• @AdrianKeister : Looking at the original formula, it is more reasonable to assume that it is the first form. – LutzL Dec 14 '18 at 15:44
• I think $s$ is the unit, seconds. This fits with $b^{1/n}$ having the unit $1/s$. In whatever way it makes sense to have fractional powers of units. – LutzL Dec 14 '18 at 15:56

Assuming the model is correct for your experimental data, it integrates directly: \begin{align*} \frac{df}{dt}&=\left[n(1-f)\ln\left(\frac{1}{1-X}\right)^{(n-1)/n}\right]b^{1/n} \\ -\frac{df}{f-1}&=\left[n\ln\left(\frac{1}{1-X}\right)^{(n-1)/n}\right]b^{1/n}\,dt \\ -(\ln|f-1|-\ln|f_0-1|)&=\left[n\ln\left(\frac{1}{1-X}\right)^{(n-1)/n}\right]b^{1/n}(t-t_0) \\ \ln\left(\frac{|f-1|}{|f_0-1|}\right)&=-\left[n\ln\left(\frac{1}{1-X}\right)^{(n-1)/n}\right]b^{1/n}(t-t_0) \\ \frac{|f-1|}{|f_0-1|}&=\exp\left\{-\left[n\ln\left(\frac{1}{1-X}\right)^{(n-1)/n}\right]b^{1/n}(t-t_0)\right\} \\ |f-1|&=|f_0-1|\exp\left\{-\left[n\ln\left(\frac{1}{1-X}\right)^{(n-1)/n}\right]b^{1/n}(t-t_0)\right\}. \end{align*}
Other comments: your $$n, b_0,$$ and $$Q$$ are by no means independent. Depending on whether you're dealing with Ferrite-pearlite, Ferrite-bainite-pearlite, or Martensite, you'll have a relationship among those parameters that restricts the degrees of freedom considerably. It appears to me that you really only have one parameter: $$Q$$. So you can set up Excel's Solver routine to minimize the sum of squares of the errors between your experimental data and your model values by changing $$Q$$.