# Replacing solution NDSolve

I have an equation that I solve :

 sol = NDSolve[{  Div[(1 - f[x]) Grad[f[x], {x, y}, "Polar"], {x, y},
"Polar"] == -(1 - f[x]) f[x] (f[x] - 0.8), f == 0.7, f'[0.00001] == 0.0001}, f,
{x, 0.0001, 1}]


I want to plot the function : $(1-f(x))f'(x)/f(x)$. How can I do it simply, meaning, by replacing the interpolating function by a function. I do not want to do :

Plot[1-InterpolatingFunction[..][x]...]


because it is too long, and not easy to handle if I change the equation.

I tried :

f[x]/.sol[]
Plot[(1-f[x])f'[x]/f[x],{x,0.0001,1}]


but it doesn't work

• This knowledge base article should help. If you need additional help, read through other questions on this site - there are countless questions on this exact topic (maybe not for NDSolve specifically, but for Solve, NSolve and related functions - and they all work the same in terms of using their output) – Lukas Lang Jun 11 '18 at 8:55
• In addition, your code example does not evaluate because the definition for alpha is missing. People, in general, are more likely to help if they have a working minimal example. You can simply edit your question and add what you use for alpha. – halirutan Jun 11 '18 at 9:03
• Also might want to use NDSolveValue. – Daniel Lichtblau Jun 11 '18 at 9:40

## 1 Answer

Like Daniel Lichtblau, I recommend using NDSolveValue rather than NDSolve, because it returns the interpolation function directly.

Clear[f]
f =
NDSolveValue[
{Div[(1 - f[x]) Grad[f[x], {x, y}, "Polar"], {x, y}, "Polar"] ==
-(1 - f[x]) f[x] (f[x] - 0.8),
f == 0.7,
f'[0.00001] == 0.0001},
f, {x, 0.0001, 1}];
g[x_] = (1 - f[x]) f'[x]/f[x];
Plot[g[x], {x, 0.0001, 1}] 