# Question:Fitting a "complex" function to measured data.

## Question:Fitting a "complex" function to measured data.

Maple

I am trying to compute the diffusion coefficient from the diffusion equation. I can compute the analytical solution and evaluate it for the parameters I know and for the known time t to get this function:

f:=x->
646.0548255+(309.8026777+568.8289152*I)*((.8781989023+.4782956073*I)*ln(1.+(-.8781989023+I*((-1)*.4782956073))*exp(10000000*((-1)*9.013850411)*Dif+(61.46924721*I)*x))+(.8781989023+.4782956073*I)*ln(1.+(-.8781989023+I*((-1)*.4782956073))*exp(10000000*((-1)*9.013850411)*Dif+I*((-1)*61.46924721)*x))+(-.8781989023+I*((-1)*.4782956072))*ln((.8781989023+I*((-1)*.4782956073))*(((-1)*1.)*exp(10000000*((-1)*9.013850411)*Dif+(61.46924721*I)*x)+.8781989023+.4782956073*I))+(-.8781989023+I*((-1)*.4782956072))*ln((.8781989023+I*((-1)*.4782956073))*(((-1)*1.)*exp(10000000*((-1)*9.013850411)*Dif+I*((-1)*61.46924721)*x)+.8781989023+.4782956073*I)));

I have also some measured data:

x_values:=[0.4056604928e-2, 0.1242487078e-1, 0.2106033816e-1, 0.2965936896e-1, 0.3814909006e-1, 0.4673597534e-1]:
y_values:=[3274.140334, 746.1905199, 2.356309641, 0, 0, 0]:

Is there a way to fit the function f to these data to obtain the Dif coefficient? I have tried to use Statistics[Fit] and Statistics[NonlinearFit], also tried to minimize the sum of squares with Optimization[Minimize] and nothing worked. From the plot the Dif coefficient should be equal approximately to 1e-9.

﻿