I have a Beer's Law problem where the absorbing species is given as an InverseFunction. More details are given in the attached notebook. If you run the code or look at the attached notebook, you will see NDSolve produces and error. I have tried a few Method options to no avail.
Any suggestions?
The problem code is
ClearAll[ a, x, t, tmin, tmax, \[Sigma], nN, \[Sigma]N, lgtI, lgtIo,
lgtIx0t0, soln, tmp, time0]
tmin = 0.0; d = 1.0 10^-3; tmax = 2400.0;
\[Sigma] = 1.78 10^-17; nN =
1.0 10^21; \[Sigma]N = \[Sigma] nN; lgtIx0t0 = 3.1*10^15;
lgtIo[x_] :=
lgtIx0t0 Exp[-\[Sigma]N x] (*we are sure of values only at time 0*)(* \
but for non zero times *)
a[x_, t_] := InverseFunction[
( -(1/lgtI[x, t])
6.610388104920668`*^14 (-1391.97544007514` Log[
9.732394366197182` - 8.732394366197182` #1] +
1476.962545808129` Log[#1])) &] [t]
eqns = {D[lgtI[x, t], x ] == - \[Sigma]N a[x, t] lgtI[x, t],
lgtI[0, t] == lgtIx0t0, lgtI[x, 0] == lgtIo[x]
};
time0 = AbsoluteTime[];
soln =
NDSolve[eqns, lgtI, {x, 0.0, d}, {t, 0.00, tmax}]
Print[(AbsoluteTime[] - time0)/60 minutes]
Speak["Done"]
Plot3D[Evaluate[lgtI[x, t] /. soln], {x, 0, 0.000352}, {t, 0, tmax},
PlotRange -> All,
AxesLabel -> {" x ", " t ", " lgtI "}, ImageSize -> Large]
Plot3D[Evaluate[a[x, t] /. soln], {x, 0, 0.000352}, {t, 0, tmax},
PlotRange -> All,
AxesLabel -> {" x ", " t ", " a "}, ImageSize -> Large]
Attachments: