# Fitting sum of exponential function with experiment data

27 views (last 30 days)
I am trying to fit my experimental data with unipore diffusion model, which is a summation of exponential functions as given below. t is the time, De is the diffusion coefficient that I need to find from the experimental data as a fitting parameter. Vt/V can be considered as y variable, which is directly measured from the experiment.
Could you help me to code this to obtain the De?
The experimental data sheet is attached.
Thank you.

Sayyed Ahmad on 4 Jun 2019
you have to simplified your model to
y=1-c1exp(-c2*x*t)
c1 represent all other parameter outside your exp() function
c2 represent all parameters inside exp funtion
t is the time
and x would be your De
now you can use the polyfit to find out your De value
for example:
x=1:10;
y=1-exp(-0.1*x); % 0.1 in your case would be is c2*De;
plot(x,y);
p=polyfit(x,-1*log(1-y),1); % p(1) would be c2*De and p(2) would be close to zero and you can ignore this
%De=p(1)/c2;