Avoid this error "NDSolve::deqn: Equation or list of equations expected "?

Hi, after rigorous trying and help from some in the forum here, I turned out with the given command for a complex PDE:

 op = Function[r*D[#, r] + Tan[\[Phi]] D[#, \[Phi]]];
I*Nest[op, \[CapitalPsi][r, \[Phi]], 3] == 
 2 \[CapitalPsi][r, \[Phi]]*r^2/Cos[\[Phi]]^5
	
 sol = CapitalPsi[r, Phi] /. 
 NDSolve[{op,
 CapitalPsi[0, Phi] == 1,
 Derivative[1, 0][CapitalPsi][0, Phi] == 0, 
 Derivative[2, 0][CapitalPsi][0, Phi] == 10, 
 Derivative[3, 0][CapitalPsi][0, Phi] == 0, 
 
CapitalPsi[r, 0] == 1, 
 Derivative[0, 1][CapitalPsi][r, 0] == 0},

 CapitalPsi, {r, 0, 3}, {Phi, 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}, {Phi, 0, 3}, AxesLabel -> Automatic]

NDSolve::deqn: Equation or list of equations expected instead of r
!\*SubscriptBox[\(\[PartialD], r]#1)+Tan[[Phi]]
!\*SubscriptBox[\(\[PartialD], \[Phi]]#1)& in the first
argument {r !\*SubscriptBox[\(\[PartialD], r]#1)+Tan[[Phi]]
!\*SubscriptBox[\(\[PartialD],
\[Phi]]#1)&,CapitalPsi[0,Phi]==1,(CapitalPsi^(1,0))[0,Phi]==0,(CapitalPsi^(2,0))[0,Phi]==10,(CapitalPsi^(3,0))[0,Phi]==0,CapitalPsi[r,0]==1,(CapitalPsi^(0,1))[r,0]==0}.

ReplaceAll::reps: {NDSolve[{r !\*SubscriptBox[\(\[PartialD],
r]Slot[<<1>>])+Tan[[Phi]]
!\*SubscriptBox[\(\[PartialD],
\[Phi]]Slot[<<1>>])&,CapitalPsi[0,Phi]==1,(CapitalPsi^(1,0))[0,Phi]==0,(CapitalPsi^(2,0))[0,Phi]==10,(CapitalPsi^(3,0))[0,Phi]==0,CapitalPsi[r,0]==1,(CapitalPsi^(0,1))[r,0]==0},<<6>>,Method->{MethodOfLines,SpatialDiscretization->{TensorProductGrid,MinPoints->32,[Ellipsis]
->32,DifferenceOrder->2},Method->{Adams,MaxDifferenceOrder->1}}]} is neither a list of replacement rules nor a valid dispatch table, and so
cannot be used for replacing.

It appears it is complaining about the tan function. What is the problem with this command?

Thanks

The symbol op is not an equation. The equation is the next line:

op = Function[r*D[#, r] + Tan[\[Phi]] D[#, \[Phi]]];
equation = 
  I*Nest[op, \[CapitalPsi][r, \[Phi]], 3] == 
   2 \[CapitalPsi][r, \[Phi]]*r^2/Cos[\[Phi]]^5;
NDSolve[{equation,...

Thanks. I tried this as well, but it seems Mathematica is complaining about the same problem all the time:

0.00021449999999999998` cannot be used as a variable.

what does that mean?

i’m guessing you are cut and pasting this diff’e’q from somewhere and do not yet have the basic mathematica skills to “run it”.

i’m unsure what the Nest does not knowing the variables. i’m not solving the diff’e’q by hand “for fun”.

But i do see (variables) op and sol are assigned by =, and once that occurs (we assume a value is obtained) we know values cannot be assigned values. Use ? or ?? to show the current value of a variable.

Hello,

op = Function[r*D[#, r] + Tan[Phi] D[#, Phi]];
eq = I*Nest[op, CapitalPsi[r, Phi], 3] == 2*CapitalPsi[r, Phi]*r^2/Cos[Phi]^5;
sol = NDSolve[{eq, CapitalPsi[0, Phi] == 1, 
Derivative[1, 0][CapitalPsi][0, Phi] == 0, 
Derivative[2, 0][CapitalPsi][0, Phi] == 10, 
Derivative[3, 0][CapitalPsi][0, Phi] == 0, CapitalPsi[r, 0] == 1, 
Derivative[0, 1][CapitalPsi][r, 0] == 0}, 
CapitalPsi, {r, 0, 10}, {Phi, 0, 10}]

If I Execute this above code MMA give me:

NDSolve::femcmsd: The spatial derivative order of the PDE may not exceed two.

See information about this error Here!

op = Function[r*D[#, r] + Tan[Phi] D[#, Phi]];
eq = I*Nest[op, CapitalPsi[r, Phi], 3] == 2*CapitalPsi[r, Phi]*r^2/Cos[Phi]^5;
sol = NDSolve[{eq, CapitalPsi[0, Phi] == 1, 
Derivative[1, 0][CapitalPsi][0, Phi] == 0, 
Derivative[2, 0][CapitalPsi][0, Phi] == 10, 
Derivative[3, 0][CapitalPsi][0, Phi] == 0, CapitalPsi[r, 0] == 1, 
Derivative[0, 1][CapitalPsi][r, 0] == 0}, 
CapitalPsi, {r, 0, 10}, {Phi, 0, 10},Method -> {"PDEDiscretization" -> {"MethodOfLines", 
 "SpatialDiscretization" -> "FiniteElement"}}] 

If I Execute this above code MMA give me:

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.

See information about this error Here!

In summary, you must implement your own code to solve the PDE equation.

Thanks for the update. I take Mathematica can’t solve this PDE then.

Thanks!