Register to reply

Curve fitting to diffusion equation(Matlab)

Share this thread:
Nov25-10, 12:49 AM
P: 1
We have been trying to fit experimental diffusion results to the diffusion equation using Matlab to evaluate the Diffusion coefficient.
The equation we used:
Experimental values [x],[y] and t are given. C and D are to be evaluated from the curve fit.
We used cftool of Matlab.
We have a problem in getting the results. We get error message as:

"Error using ==> <a href="error:C:\Program Files\MATLAB\R2007b\toolbox\curvefit\curvefit\@fittype\feval.m,97,0">fi ttype.feval at 97</a>
Error in fittype expression ==> C.*erfc(x./(2.*sqrt(D.*300)))
??? Error using ==> erfcore
Input must be real."

Can anyone help?
Phys.Org News Partner Physics news on
Symphony of nanoplasmonic and optical resonators produces laser-like light emission
Do we live in a 2-D hologram? New Fermilab experiment will test the nature of the universe
Duality principle is 'safe and sound': Researchers clear up apparent violation of wave-particle duality
Nov25-10, 03:39 AM
P: 231
It looks like the problem is that the error function requires real input arguments. Looking at your expression I would say the most likely problem is that the D parameter gets negative during the fitting, and as such maybe you could try to use abs(D) instead, although this could lead to the fitting algorithm having problems finding the right values.

Register to reply

Related Discussions
Curve fitting using matlab Engineering, Comp Sci, & Technology Homework 1
MATLAB Curve Fitting Question? Introductory Physics Homework 1
Curve-to-curve fitting trouble! Programming & Computer Science 5
Curve fitting in Matlab Math & Science Software 1
Curve fitting using Matlab Math & Science Software 0