I am trying to solve a relatively simple system of linear PDE in two variables (z,t). The equations are basically the Navier-stokes equations linearized around a constant background velocity profile with a source term for the temperature equation.
I have after a lot of effort gotten NDSolve to actually solve the equation, but when I try to use "MethodOfLines", I get a bunch of errors. Here is my code:
With[{U = Cos[Pi z / 1.2] - 2 Cos[Pi z / 1.2],
Q = Piecewise[{{Sin[Pi z/.4], z < .4}}, 0]},
pde1 = {
(* vorticity and theta equation *)
D[\[Omega][z, t], t] + I k U \[Omega][z, t] -
w[z, t] D[U, z, z] == I k \[Theta][z, t] ,
D[\[Theta][z, t], t] + I k U \[Theta][z, t] == -w [z, t] + Q ,
(* vorticity inversion *)
Derivative[2, 0][w][z, t] - k^2 w[z, t] == I k \[Omega][z, t],
Derivative[1, 0][w][2, t] + k w[2, t] == 0, w[0, t] == 0,
(* intial condition *)
\[Omega][z, 0] == 0, \[Theta][z, 0] ==
0, w[z, 0] == 0 };
sol = NDSolve[
pde1 /. {k -> 1}, { \[Omega], \[Theta], w}, {t, 0, 200}, {z, 0, 2},
Method -> {"PDEDiscretization" ->
{"MethodOfLines",
"TemporalVariable" -> t}}] // First]
And these are the error messages I get:
NDSolve::pdord: Some of the functions have zero differential order, so the equations will be solved as a system of differential-algebraic equations. >>
NDSolve::bcart: Warning: an insufficient number of boundary conditions have been specified for the direction of independent variable z. Artificial boundary effects may be present in the solution. >>
NDSolve::icfail: Unable to find initial conditions that satisfy the residual function within specified tolerances. Try giving initial conditions for both values and derivatives of the functions. >>
First::nofirst: has zero length and no first element. >>
I find this confusing for several reasons.
- I should not need to specify an initial condition for
w, since it has no time derivative and is diagnosed from the vorticity variableomegausing the Laplacian solve. However, if I leave that term out, I get complaints about not specifying enough initial conditions. - I have specified two boundary conditions for
wfor a second order bvp, but it still complains. There are no other z-derivatives in my PDE. What gives?
Why am I getting these errors with "MethodOfLines" but not with Method->Automatic?
Since NDSolve seems to be getting very confused, is it possible to separate the "vorticity inversion" part of my PDE into its own NDSolve?
I really appreciate your help since I am Mathematica newb, and I am finding NDSolve to be a real pain to debug.

Derivative[1, 0] w[2, t] + k w[2, t] == 0should beDerivative[1, 0] [w][2, t] + k w[2, t] == 0. Please check your equations for other typos. – bbgodfrey Apr 23 '16 at 21:52DirichletCondition[w[z, t] == 0, True]instead ofw[0,t] ==0, w[2,t] == 0NDSolve does return something. Now how can I get my robin condition to work? – nbren12 Apr 23 '16 at 22:19DirichletConditionproduces a solution, it does not look like a stable solution. In fact, it is unclear to me whetherNDSolveis capable of solvingpde1without preprocessing, as described in the example, Combined Elliptic-Parabolic PDE in 1D, in DAE Examples, which you might use as a basis for solving this problem. By the way, the first warning message given in the quesiton is to be expected, and the second probably arises whenNDSolveattempts to eliminatew. – bbgodfrey Apr 24 '16 at 02:22NDSolvecan do a lot, but not everything. For instance, it cannot do integro-differential equations, to which your system is akin. (One way to eliminatewis to integrate the third equation withDSolve, although that does not get you closer to a final answer.) By the way, you should edit your question to correct the typo we discussed earlier. – bbgodfrey Apr 24 '16 at 14:04