I have a 4th order nonlinear PDE with the following BCs and IC:

(* Boundary conditions *)   


(* Initial condition *)
h[x, y, 0] == 1 + (-0.05 Cos[2 π x/L] - 0.05 Sin[2 π x/L]) Cos[2 π y/L]

I realized that the first derivative and third derivative of my initial condition, h[x,y,t=0] wrt to x evaluated at x=0 and x=L are not 0 and hence pose an inconsistency (I get the ibcinc error).

I can't change my boundary conditions as the example problem here does because my boundary conditions represent static contact angles and they are either a zero or a number. And I don't want to change the ICs because this is the initial condition I have been using all throughout and I'd like consistency in comparison of my results.

What should I do about this? The entire code follows:

$HistoryLength = 0;
Clear[Eq0, EvapThickFilm, h, Bo, ε, K1, δ, Bi, m, r]
Eq0[h_, {Bo_, ε_, K1_, δ_, Bi_, m_, r_}] := D[h, t] + Div[-h^3 Bo Grad[h] + 
    h^3 Grad[Laplacian[h]] + (δ h^3)/(Bi h + K1)^3 Grad[h] + 
    m (h/(K1 + Bi h))^2 Grad[h]] + ε/(Bi h + K1) + 
    (r) D[D[(h^2/(K1 + Bi h)), x] h^3, x] == 0;
SetCoordinates[Cartesian[x, y, z]];
EvapThickFilm[Bo_, ε_, K1_, δ_, Bi_, m_, r_] := Eq0[h[x, y, t], {Bo, ε, K1, δ, Bi, m, r}];
TraditionalForm[EvapThickFilm[Bo, ε, K1, δ, Bi, m, r]];



(* Boundary conditions *)   


(* Initial conditions *)
(*h[x,y,0] == 1.1+Cos[km x] Sin[2 km y] *)
h[x,y,0]==1+(-0.05 Cos[2 π x/L]-0.05 Sin[2 π x/L]) Cos[2 π y/L]
{x, 0, L},
{y,0, L},
{t, 0, TMax},
(*StepMonitor:> Print["time= ",t] *)

What I have tried so far:

  1. I tried using Piecewise but my Piecewise function needed more than 2 arguments so I failed.
  2. I tried changing the solution method to

    Method -> {"MethodOfLines", "SpatialDiscretization" -> {"TensorProductGrid", "MinPoints" -> 100}} This didn't yield anything either.

  3. I also tried setting "DifferentiateBoundaryConditions"->False, I still get the same error.

Is there a fix to this "inconsistent ic/bc" issue?

Update 5/31/2012

I changed the boundary conditions to reflect the initial condition (I changed the BCs to the first and third derivatives of the initial condition so as to make them consistent) but still, I get the same error.

  • 1
    $\begingroup$ your input is not valid M- code. Also, it were good if you could post the NDSolve command you are using. Concerning ICs and BCs, they need to be consistent otherwise the PDE can not be solved reliably. $\endgroup$
    – user21
    May 28, 2012 at 15:23
  • 2
    $\begingroup$ Could you repost the input using plain text only? If h^(1,0,0)[...] is a derivative, use Derivative[1,0,0][h][...]. $\endgroup$
    – Szabolcs
    May 28, 2012 at 15:36
  • 2
    $\begingroup$ @ruebenko There seems to be a copying bug in the front end: evaluate Derivative[1, 0, 0][h][x, y, z], select the output, Copy As Input Text, paste back into the notebook, and you'll get something invalid. The culprits are those \* at the end of each Superscipt line. $\endgroup$
    – Szabolcs
    May 28, 2012 at 15:45
  • 1
    $\begingroup$ @DNA I've formatted your code, but I think you have a typo in your IC in the "plain text" code block. You have h[x,y,0]==h[x,y,0]==... (twice), whereas it is correct in the first paragraph. I suggest looking into it and correcting it $\endgroup$
    – rm -rf
    May 28, 2012 at 21:12
  • 4
    $\begingroup$ @DNA When posting large pieces of code it is a good practice to copy it from the pasted code here to a blank notebook and run it. You will find the errors much easier than we can $\endgroup$ May 28, 2012 at 21:39

1 Answer 1


Your approach as of the 31st May update should get rid of the error. I did it by defining:

g[x_,y_]=1+(-0.05 Cos[2 π x/L]-0.05 Sin[2 π x/L]) Cos[2 π y/L]

and setting the boundary conditions like this:

Derivative[1,0,0][h][0,y,t] == Derivative[1,0][g][0,y]


  • $\begingroup$ Well, that may get rid of the error. But however, as a side note, it deflates the physics of the problem but obviously, this isn't the forum for that. Thanks. $\endgroup$
    – dearN
    Jun 1, 2012 at 14:07

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.