Message Boards Message Boards

Error solving nonlinear coupled ODE: ndnum: Encountered non-numerical value for a derivative

Posted 3 months ago

I am trying to solve the coupled non linear ODEs using ParametricNDSolveValue and it is not generating the results. Here is the code:

We = 0.4; alpha = 0.9; beta = 0.2; phi = 0.7; P = -1.3; Br = 0.1; K1 = We^2*(1 - alpha^2); K2 = phi*K1;
system = {{u''[y] + 
     3*((phi - 1)/(phi + 1))*We^2*(1 - alpha^2) (u'[y])^2*u''[y] - 
     5*((phi - 1)/(phi + 1))*We^4*(1 - alpha^2)^2 (u'[y])^4*
      u''[y] - (1/(phi + 1))*P*(1 + beta . t[y]) == 0, 
   t''[y] + 
     Br*(1 - beta . t[y])*((u'[y])^2 - K1*(u'[y])^4 + K2*(u'[y])^4 - 
        K1*K2*(u'[y])^6) == 0, u[0] == 1, u[1] == c, t[0] == 0, 
   t[1] == c}}
sols = ParametricNDSolveValue[system, {u, t}, {y, 0, 1}, {c}]
Plot[Evaluate[Table[sols[c][y], {c, -1, 1, 0.1}]], {y, 0, 1}, 
 PlotRange -> All]

I am now getting the error. "ParametricNDSolveValue::ndnum: Encountered non-numerical value for a derivative at y$17528 == 0.`." Please help me to generate the results.

POSTED BY: Muhammad Usman
2 Replies
Posted 3 months ago

Several typing errors are removed. I used the ParametricNDSolve, rather than ParametricNDSolveValue.

We = 0.4; alpha = 0.9; beta = 0.2; phi = 0.7; P = -1.3; Br = 0.1; K1 =
  We^2*(1 - alpha^2); K2 = phi*K1;

system = {
  u''[y] + 
    3*((phi - 1)/(phi + 1))*We^2*(1 - alpha^2)*(u'[y])^2*u''[y] - 
    5*((phi - 1)/(phi + 1))*We^4*(1 - alpha^2)^2* (u'[y])^4*
     u''[y] - (1/(phi + 1))*P*(1 + beta*t[y]) == 0,

  t''[y] + 
    Br*(1 - beta*t[y])*((u'[y])^2 - K1*(u'[y])^4 + K2*(u'[y])^4 - 
       K1*K2*(u'[y])^6) == 0,

  u[0] == 1, u[1] == c, t[0] == 0, t[1] == c
  }

sols = ParametricNDSolve[system, {u, t}, {y, 0, 1}, {c}] 

Plot[Evaluate[Table[u[c][y] /. sols, {c, -1, 1, 0.1}]], {y, 0, 1}, 
 PlotRange -> All]
POSTED BY: Sangdon Lee

Thank you so much, it really helps me.

POSTED BY: Muhammad Usman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract