Basically I solved a problem, consequently I wanna define a function which uses part of that problem to use later on as a function. So I tried the SetDelay (:=)
fw[x_] := -2*Sqrt[2 x]*vCH2Cl2[x] - 4 x*Evaluate[D[f[x, 0], x] /. Sol];
Which yields no errors, but doesn't define a function. Then someone suggested that I just set the function with the = command. But when I define the same function as before.
fw[x_] = -2*Sqrt[2 x]*vCH2Cl2[x] - 4 x*Evaluate[D[f[x, 0], x] /. Sol];
I get the Error:
ReplaceAll::reps: "{Sol} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
Any ideas?
EDIT: Since it was suggested that I add the complete try:
Sc = 18.7*10^(-6)/(1.2041*2.522^(-9)*301.15^1.462);
Sol = NDSolve[{
D[f[x, η], η] == g[x, η],
D[g[x, η], {η, 2}] +
f[x, η]*D[g[x, η], η] +
2*x*(D[g[x, η], η]*D[f[x, η], x] -
g[x, η]*D[g[x, η], x]) == 0,
D[φ[x, η], {η, 2}] +
Sc*f[x, η]*D[φ[x, η], η] +
2*x*Sc*D[f[x, η], x]*D[φ[x, η], η] -
2*x*Sc*g[
x, η]*(D[φ[x, η], x] + φ[
x, η]) == 0,
(*Boundary values*)
(*η \[Rule] 0*)
f[x, 0] == 1.14267*Exp[-10000*x](*+((1-Exp[-10000*x])*fw[x])*),
g[x, 0] == 1 - Exp[-10000 x],
φ[x, 0] == 1 - Exp[-10000*x],
(*x \[Rule] 0; Initial Condition, guesses from Blasius solution*)
f[0, η] == 1.14267,
g[0, η] == 0,
φ[0, η] == 0,
(*η \[Rule] ∞*)
g[x, 10] == 0,
φ[x, 10] == 0},
{f, g, φ}, (*Unknown Variables*)
{x, 0,
1}, (*Range of x*)
{η, 0, 10}, (*Range of η*)
MaxStepSize -> 0.1, AccuracyGoal -> 3,
PrecisionGoal -> 3(*MaxStepSize\[Rule]0.01,AccuracyGoal\[Rule]4,
PrecisionGoal\[Rule]4*),
Method -> {"PDEDiscretization" -> {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid",
"MinPoints" -> 150}}}
];
and vCH2Cl2[x] is basically the same thing as in my question:
vCH2Cl2[x_] = constant*(Evaluate[
D[φ[x, 0], ξ] /. Sol]*(-1));
f[x,0]
, include it in the question? $\endgroup$