invoke data in the NDSOLVE

 theta = .2;
sol = NDSolve[{D[g[x, t], t] == x (1 - x) D[g[x, t], x, x]  , g[1, t] == 0,
g[0, t] == theta (1 - Exp[-10000000 t]) }, g, {t, 0, 2 }, {x, 0, 1}]
f[x_, t_] := (g /. sol[[1, 1]])[x, t];
t = 0.5;
LogLogPlot[{f[x, t]/(x (1 - x)), 0.2/x}, {x, 0, 1}, PlotRange -> All,
PlotStyle -> {Red, Blue}]


One initial condition is required to solve the above equation as g[x, 0]. I do not have the functional form of g[x,0] whereas i have the data for

 g[x,0]={19., 5., 4., 3., 3., 1., 3., 2., 2., 2., 3., 2., 0., 1., 0., 0., 0.,0., 0., 0., 0., 1., 0., 0., 0., 1., 1., 1., 1., 0., 0., 0., 1., 0.,1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 1., 0., 1., 0., 0., 0.,0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.} in steps of 0.01 and x varies from 0 to 1.


Can I use the values of g[x,0] from the list and invoke into the NDSolve to obtain the final numerical solution.

• You could create an InterpolatingFunction and use that. May 12, 2022 at 7:11
• Could you please write the commands for this? May 12, 2022 at 7:14
• You have second order in x but only gave one boundary condition at x=0 May 12, 2022 at 7:15
• There are two boundary conditions, one at x=0 and other at x=1 and there is one initial condition too which is given by list g[x,0]. May 12, 2022 at 7:24
• I did not see g[1, t] == 0. Just an advice. always write the pde on its own, write the BC on its own, and the ic on its own (i.e. on separate lines) and use these later in the call to NDSolve. This always makes things more clear instead of writing everything in one long command. May 12, 2022 at 7:31

Try to interpolate g (see @user21 comment)

gi = {19., 5., 4., 3., 3., 1., 3., 2., 2., 2., 3., 2., 0., 1., 0., 0.,
0., 0., 0., 0., 0., 1., 0., 0., 0., 1., 1., 1., 1., 0., 0., 0.,
1., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 1., 0., 1., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};

tg = Transpose[{Subdivide[0, 1, Length[gi] - 1], gi}];
ipg = Interpolation[tg, InterpolationOrder -> 1]


ipg[x] fits the points tg!

theta = .2;
G = NDSolveValue[{D[g[x, t], t] == x (1 - x) D[g[x, t], x, x], g[1, t] == 0, g[0, t] == theta (1 - Exp[-10000000 t]), g[x, 0] == ipg[x]}, g, {t, 0, 2}, {x, 0, 1}]


G[x,t]is the solution of your pde