# Using output of DSolve/NDSolve as a function with “variable” constants

I've already looked through the questions similar to this one, but I couldn't figure out how to modify them so that they work, and I suspect that there are deeper issues than just the syntax. Here is my code attempt:

fFunction[a_, b_, c_, z_] =
alpha[z] /.
First@DSolve[{c*
alpha[z]*(alpha[z]^2 + alpha[z]) / ((alpha[z] + 1)^2 + b^2) -
1 == alpha'[z], alpha[0] == a}, alpha[z], z]


Basically there are four variables, where a,b,c are constants related to the physical apparatus which I'll put in later, and then alpha, which is the main variable I want to consider. Basically I want to solve the differential equation for alpha, which I suppose is actually a function of four variables. I understand how to do it for the one variable case, but this multivariable case, which I believe shouldn't be substantially harder, is eluding me.

Is the problem that Mathematica is trying to evaluate the inside first, but can't?

• The difficulties you may be encountering are due primarily to the fact that DSolve is not returning an explicit solution for alpha[z]. This has nothing to do with the three constants. I would add that you should be careful when making fFunction an explicit function of z. – bbgodfrey Nov 26 '16 at 2:30
• If I change it to NDSolve like this:　fFunction[a_, b_] = alpha[z] /. First@NDSolve[{alpha[ z]*(alpha[z]^2 + alpha[z]) / ((alpha[z] + 1)^2 + b^2) - 1 == alpha'[z], alpha[0] == a}, alpha[z], {z, 0.1, 10}], it has a different error where it says that a is not a number – Jensen Lo Nov 26 '16 at 2:43

This seems like a good time to use ParametricNDSolveValue:
zmax = 2;