|
"Steven_Lord" <slord@mathworks.com> wrote in message <ivkjbn$827$1@newscl01ah.mathworks.com>...
> "Jeremy " <morrisje@william.jewell.edu> wrote in message
> news:ivkgcd$s5f$1@newscl01ah.mathworks.com...
> > I'm trying to compute the following complementary error function:
> >
> > I(x,t)=(1/2)*(Io)*erfc((x/(2t)*(1/sqrt(d)))
> >
> > where x is a distance, t is the time, and D is a dilution constant (which
> > is what I'm trying to calculate). How would I go about doing this?
>
> So you know I(x, t), x, t, and Io and want to compute d? Rewrite your
> equation so it's in the form F(d) = 0 [where F can also depend on I(x, t),
> x, t, and Io] then use FZERO.
- - - - - - - -
If as Steve says, you know I, x, t, and Io, then you can solve for d. However, you don't really need to use fzero because the erfcinv function is available. The equation
I=Io/2*erfc(x/(2t)/sqrt(d))
converts to this:
d = (x/2/t/erfcinv(2*I/Io))^2
Of course you must have 0 <= I <= Io.
Roger Stafford
|