3
$\begingroup$

Below is the code I am using to generate a velocity profile and temperature profile for flow over a wedge.

sol[ξ_] := 
  NDSolve[{
   D[f[η], {η, 3}] + (m + 1)/2 f[η] f''[η] + m* (1 - (f'[η])^2) == 0,
   D[θ[η], {η, 2}] + f[η] θ'[η]*(m + 1)*0.5*0.7 == 0,
   θ[0] ==  1, θ[5] == 0, f[0] == -2/(m + 1)*bsp, 
   f'[0] == 0, 
   f''[0] == ξ}, 
   {f[η], θ[η], θ'[η]}, {η, 0, 9}] 

m = β/(2 π - β);
m = 0;
DFEnd[ξ_?NumericQ] := D[f[η] /. sol[ξ], {η, 1}] /. η -> 9
SOL1[bsp_] := FindRoot[DFEnd[ξ] == 1, {ξ, 0.5}]

plt1 = 
  Plot[Evaluate[
        Flatten[Table[D[f[η] /. sol[ξ /. SOL1[bsp]], {η, 1}], {bsp, 0, -1, -0.25}]] /. 
          η -> x], 
    {x, 0, 9},  
    PlotLegends -> Range[BSP = 0, BSP = -1, BSP = -0.25], 
    PlotRange -> All]
plt2 = 
  Plot[Evaluate[
         Flatten[Table[D[θ[η] /. sol[ξ /. SOL1[bsp]], {η,  1}], {bsp, 0, -1, -0.25}]] /. 
           η -> x], 
    {x, 0, 5}, 
    PlotLegends -> Range[0, 1, .25], 
    PlotRange -> All]

Here is how I am generating values of f''[0], varying the bsp parameter for various values of m.

I wish to generate a table having values of η for which f'[η] is equal to 0.99 for different values of bsp for a given m, and then I wish to vary m as well.

Let's say, for example, I first want a table for m = 0, where bsp ranges over {-2.5,2.5,0.5}; then m = 1, etc.

Is there a way to generate such a table for f'[η] == 0.99 and similarly θ'[0] for different values of m and bsp.

$\endgroup$
4
  • $\begingroup$ Is there a way to solve f'[n]= 0.99. I am not able to use Solve function for that $\endgroup$ – user11948 Apr 4 '14 at 5:27
  • $\begingroup$ Does my answer solve your problem, or is there some issue? $\endgroup$ – Michael E2 Jul 30 '14 at 16:31
  • $\begingroup$ Hi Michael, it worked . Thanks alot for your answer $\endgroup$ – user11948 Aug 1 '14 at 4:47
  • $\begingroup$ If you feel satisfied with an answer, you can click the checkmark sign to accept it. $\endgroup$ – xzczd Nov 3 '14 at 7:39
3
$\begingroup$

You mention two parameters, m and bsp, but not the third ξ. I will concentrate on solving f'[η] == 0.99 for ξ == 0.2. Use ParametricNDSolveValue to set up the differential equations, and use WhenEvent to solve any ancillary equations that you wish, for example f'[η] == 0.99. If you use Sow as I did, you need to turn the caching off, or the root will be sown only on the first call for the given parameters.

Clear[m, bsp, ξ, f, η];
sol = ParametricNDSolveValue[
  {D[f[η], {η, 3}] + (m + 1)/2 f[η] f''[η] + m*(1 - (f'[η])^2) == 0,
   D[θ[η], {η, 2}] + f[η] θ'[η]*(m + 1)*0.5*0.7 == 0,
   θ[0] == 1, θ[5] == 0,
   f[0] == -2/(m + 1)*bsp, f'[0] == 0, f''[0] == ξ,
   WhenEvent[f'[η] == 0.99, Sow[η]]},
  {f, θ, Derivative[1][θ]},
  {η, 0, 9},
  {m, bsp, ξ},
  Method -> {"ParametricCaching" -> None}]

Mathematica graphics

Flatten@Table[Last@Reap[sol[0, bsp, 0.2]] /. {} -> None, {bsp, -2.5, 2.5, 0.5}]
(*
  {None, None, None, None, None, None, 2.70527, 1.83437, 1.44146, 1.20493, 1.04352}
*)

If you don't want to use Sow, the equation may be solved after getting the solution to the differential equation like this:

With[{f = First[sol[0, 1., 0.2]]},
 FindRoot[
  f'[η] == 0.99, {η, 1}]
 ]
(*
  {η -> 1.83437}
*)
$\endgroup$
2
  • $\begingroup$ Hi Thanks for the answer. It really helped me alot $\endgroup$ – user11948 Aug 1 '14 at 4:46
  • $\begingroup$ You're welcome! $\endgroup$ – Michael E2 Aug 1 '14 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.