Message Boards Message Boards

0
|
4199 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

[?] Use NDSolve for a third-order differential PDE?

Posted 6 years ago

Hi, I have prepared the given NDSolve script for a third-order differential PDE:

  K1 = i;
  V = Tan[x];
  P = r^2/(Cos[y])^5

  eq = K1*r^3*D[u[r, y], {r, 3}] + r^2*D[u[r, y], {r, 2}] + r*K1*D[V^2*u[r, y], {r, 1}] + V*r*K1*D[u[r, y], {r, 1}] + V*r*K1*D[V*u[r,y], {r,1}]+ V^2*r*K1*D[u[r, y], {r, 1}] + 
V^3*K1*D[u[r, y], {r, 1}] == 2*u[r,y]*P

 sol = u[r, y] /. 
 NDSolve[{eq,
 u[0, y] == 1,
 Derivative[1, 0][u][0, y] == 0, 
 Derivative[2, 0][u][0, y] == 10, 

 u[r, 0] == Cos[x], 
 Derivative[0, 1][u][r, 0] == 0}, 
 u, {r, 0, 3}, {y, 0, 3},
 MaxSteps -> Infinity, PrecisionGoal -> 1,
 AccuracyGoal -> 1, 
 Method -> {"MethodOfLines", 
 "SpatialDiscretization" -> {"TensorProductGrid", 
 "MinPoints" -> 32, "MaxPoints" -> 32, "DifferenceOrder" -> 2},
 Method -> {"Adams", "MaxDifferenceOrder" -> 1}}] // Quiet

 Plot3D[sol, {r, 0, 3}, {y, 0, 3}, AxesLabel -> Automatic]

However, I get the error:

NDSolve::dsvar: 0.00021449999999999998` cannot be used as a variable.

ReplaceAll::reps: {NDSolve[{0.0002145 i Tan[x] (u^(1,0))[0.0002145,0.0002145]+0.0006435 i Tan[<<1>>]^2 (u^(1,0))[0.0002145,0.0002145]+i Tan[<<1>>]^3 (u^(1,0))[0.0002145,0.0002145]+4.60102*10^-8 (u^(2,0))[0.0002145,0.0002145]+9.8692*10^-12 i (u^(3,0))[0.0002145,0.0002145]==9.20205*10^-8 u[0.0002145,0.0002145],<<4>>,(u^(0,1))[0.0002145,0]==0},u,<<4>>,AccuracyGoal->1,Method->{<<1>>}]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.

What is the error really?

Thanks!

POSTED BY: Ser Man
4 Replies

There is still something wrong with the PDE: NDSolve::ivone: Boundary values may only be specified for one independent variable. Initial values may only be specified at one value of the other independent variable.

POSTED BY: Gianluca Gorni
Posted 6 years ago

I presume that it means I have to discard two of the three conditions related to u[r,0]=1

still I get an error of the same kind:

  K1 = i;
  V = Tan[x];
  P = r^2/(Cos[y])^5

  eq = K1*r^3*D[u[r, y], {r, 3}] + r^2*D[u[r, y], {r, 2}] + r*K1*D[V^2*u[r, y], {r, 1}] + V*r*K1*D[u[r, y], {r, 1}] + V*r*K1*D[V*u[r,y], {r,1}]+ V^2*r*K1*D[u[r, y], {r, 1}] + 
V^3*K1*D[u[r, y], {r, 1}] == 2*u[r,y]*P

 sol = u[r, y] /. 
 NDSolve[{eq,
 u[0, y] == 1,
 Derivative[1, 0][u][0, y] == 0, 
 Derivative[2, 0][u][0, y] == 10, 
 Derivative[3, 0][u][0, y] == 0, 

 u[r, 0] == 1, 
 Derivative[0, 1][u][r, 0] == 0,
 u, {r, 0, 3}, {y, 0, 3},
 MaxSteps -> Infinity, PrecisionGoal -> 1,
 AccuracyGoal -> 1, 
 Method -> {"MethodOfLines", 
 "SpatialDiscretization" -> {"TensorProductGrid", 
 "MinPoints" -> 32, "MaxPoints" -> 32, "DifferenceOrder" -> 2},
 Method -> {"Adams", "MaxDifferenceOrder" -> 1}}] // 

 Plot3D[sol, {r, 0, 3}, {y, 0, 3}, AxesLabel -> Automatic]

0.00021449999999999998` cannot be used as a variable.

POSTED BY: Ser Man

On my system I removed the Quiet and found that NDSolve left the equation unevaluated, with the warning NDSolve::bdord: Boundary condition (u^(0,1))[r,0] should have derivatives of order lower than the differential order of the partial differential equation. As a consequence, Plot3D will insert numerical values of r,y into an unevaluated NDSolve, producing the error you witnessed. By the way, you may have a look at NDSolveValue, which will save you some steps in defining sol.

POSTED BY: Gianluca Gorni
Posted 6 years ago

Thank you Gianluca.

I am trying this variant:

  K1 = i;
  V = Tan[x];
  P = r^2/(Cos[y])^5

  eq = K1*r^3*D[u[r, y], {r, 3}] + r^2*D[u[r, y], {r, 2}] + r*K1*D[V^2*u[r, y], {r, 1}] + V*r*K1*D[u[r, y], {r, 1}] + V*r*K1*D[V*u[r,y], {r,1}]+ V^2*r*K1*D[u[r, y], {r, 1}] + 
V^3*K1*D[u[r, y], {r, 1}] == 2*u[r,y]*P

 sol = u[r, y] /. 
 NDSolve[{eq,
 u[0, y] == 1,
 Derivative[1, 0][u][0, y] == 0, 
 Derivative[2, 0][u][0, y] == 10, 
 Derivative[3, 0][u][0, y] == 0, 

 u[r, 0] == 1, 
 Derivative[0, 1][u][r, 0] == 0,
 Derivative[0, 2][u][r, 0] == 10,    
 Derivative[0, 3][u][0, y] == 0}, 
 u, {r, 0, 3}, {y, 0, 3},
 MaxSteps -> Infinity, PrecisionGoal -> 1,
 AccuracyGoal -> 1, 
 Method -> {"MethodOfLines", 
 "SpatialDiscretization" -> {"TensorProductGrid", 
 "MinPoints" -> 32, "MaxPoints" -> 32, "DifferenceOrder" -> 2},
 Method -> {"Adams", "MaxDifferenceOrder" -> 1}}] // 

 Plot3D[sol, {r, 0, 3}, {y, 0, 3}, AxesLabel -> Automatic]

However, I get that

NDSolve::dsvar: 0.00021449999999999998` cannot be used as a variable.

POSTED BY: Ser Man
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