2
$\begingroup$
NDSolve[{(2 π ϵ Cos[2 π x] Sech[κ + ϵ κ Sin[2 π x]]^2 (2 κ + 2 ϵ κ Sin[2 π x] - 
         Sinh[2 κ (1 + ϵ Sin[2 π x])]))/(κ (1 + ϵ Sin[2 π x])^2) + 
         4 π ϵ Cos[2 π x] (1 + ϵ Sin[2 π x])^2 Derivative[1][p][x] + 
         2/3 (1 + ϵ Sin[2 π x])^3 (p'')[x] == 0, 
  p[0] == 0, p[1] == 0}, p, x, 
  Method -> {"Shooting", "StartingInitialConditions" -> {p[0] == 0, p'[0] == 1}}]

On running this code, the error getting displayed is

NDSolve::ndnum: Encountered non-numerical value for a derivative at x == 0.

$\endgroup$
2
  • $\begingroup$ In the environment click on the triple dot symbol and click on the entry NDSolve::ndnum. There is instruction that will help You further. For me the instruction tells, give a value to the parameters with With! $\endgroup$ Commented Dec 30, 2023 at 15:10
  • $\begingroup$ @Trueee Parameter \[Epsilon],\[Kappa] are undefined. Check the form of the derivatives in your ode, should be p'[x],p''[x] $\endgroup$ Commented Dec 30, 2023 at 17:23

1 Answer 1

4
$\begingroup$

Try ParametricNDSolveValue (I corrected the derivatives ...)

P = ParametricNDSolveValue[
      {(2 π ϵ Cos[2 π x] Sech[κ + ϵ κ Sin[2 π x]]^2 (2 κ + 2 ϵ κ Sin[2 π x] - Sinh[2 κ (1 + ϵ Sin[2 π x])]))/(κ (1 + ϵ Sin[2 π x])^2) + 4 π ϵ Cos[2 π x] (1 + ϵ Sin[2 π x])^2  p'[x] + 2/3 (1 + ϵ Sin[2 π x])^3  p''[x] == 0,
       p[0] == 0, p[1] == 0},
      p,
      {x, 0, 1},
      {ϵ, κ}, Method -> {"Shooting", "StartingInitialConditions" -> {p[0] == 0, p'[0] == 1}}
    ]

Plot[P[.5, 0.15][x], {x, 0, 1}]

enter image description here

$\endgroup$

Your Answer

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

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