0
$\begingroup$

I need to solve the following BVP: $$(g^{-1/3}f'')'+ff''=0$$ $$(g^{-1/3}g')'+0.71fg'=-1.43775g^{-1/3}(f'')^2$$ With the following constraints: $$f[0]=0,f'[0]=0,f'[20]=1,g[0]=0.944175,g[20]=1$$ I used the following code:

s=NDSolve[{((g[neta]^(-1/3))*f''[neta])'+f[neta] (f^\[Prime]\[Prime]) [neta]==0,((g[neta]^(-1/3))*g'[neta])'+0.71 f[neta] (g^\[Prime])[neta]==-2.025 *0.71 (g^(-1/3))'[neta]((f^\[Prime]\[Prime])[neta])^2,f[0]==0,(f^\[Prime])[0]==0,(f^\[Prime])[20]==1,g[0]==0.9441751033,g[20]==1},{f,g},{neta,0,20}]

But I get the error "NDSolve::derarg: "The derivative operator Derivative[1] in... ...should act on the pure function." in Mathematica 8 and "NDSolve::dvnoarg The function f appears with no arguments." in Mathematica online. How should I be solving such a system of ODES for the boundary value problem?

$\endgroup$
3
  • $\begingroup$ Just change the derivatives in your ode. For example (g^(-1/3))'[neta] should be substituted by D[(g[neta]^(-1/3)), neta] $\endgroup$ Commented Nov 7, 2018 at 12:24
  • $\begingroup$ @UlrichNeumann Thanks! That seemed to do the trick. However, only mathematica online was able to solve this BVP. Mathematica 8 failed to solve this. Anyways, thanks for the tip. $\endgroup$
    – mmrbest
    Commented Nov 7, 2018 at 13:12
  • $\begingroup$ It's because the "Shooting" method has been silently improved since v8. If you have to use v8 for the task, then you need to choose initial guess very carefully. There're many related posts in this site, just search Shooting here. $\endgroup$
    – xzczd
    Commented Dec 7, 2018 at 16:58

1 Answer 1

1
$\begingroup$

All derivatives must be expressed explicitly. After that, the numerical solution is found without any additional conditions, which is surprising

eq1 = {f[neta] (f^\[Prime]\[Prime])[neta] - (
     Derivative[1][g][neta] (f^\[Prime]\[Prime])[neta])/(
     3 g[neta]^(4/3)) + 
\!\(\*SuperscriptBox[\(f\), 
TagBox[
RowBox[{"(", "3", ")"}],
Derivative],
MultilineFunction->None]\)[neta]/g[neta]^(1/3) == 
    0, -(Derivative[1][g][neta]^2/(3 g[neta]^(4/3))) + (
      g^\[Prime]\[Prime])[neta]/g[neta]^(1/3) + 
     0.71` f[neta] Derivative[1][g][neta] == -1.4377499999999999`*(-(
       Derivative[1][g][neta]/(3 g[neta]^(4/3))))* (
      f^\[Prime]\[Prime])[neta]^2};
bc = {f[0] == 0, f'[0] == 0, f'[20] == 1, g[0] == 0.9441751033, 
   g[20] == 1};
s = NDSolve[{eq1, bc}, {f, g}, {neta, 0, 20}]

{Plot[Evaluate[{f[x], g[x]} /. s], {x, 0, 20}, PlotLegends -> {f, g}],
  Plot[Evaluate[{g[x]} /. s], {x, 0, 20}, AxesLabel -> {"neta", "g"}, 
  PlotRange -> All]}

fig1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.