3
$\begingroup$

I am trying to solve a first-order nonlinear PDE of the form $$ \partial_t z(t,x) = f(t, x, z(t,x), \partial_x z(t,x)) $$ with the boundary condition $$ z(0,x) = \phi(x) $$ for some finite domain $x \in (-b,b)$ and $t \in (0, t_f)$.

This is certainly a well-defined PDE given that $f$ and $\phi$ are smooth functions as we can cumulatively construct $z(t+\Delta t,x)$ from the profile $z(t,x)$ with small enough $\Delta t$. (Please find the link for more rigorous setting http://www.emis.de/journals/UIAM/PDF/40-15-30.pdf )

However, if I use NDSolve to find a solution, I get the following warning

NDSolveValue::bcart: "Warning: an insufficient number of boundary conditions have been specified for the direction of independent variable x. Artificial boundary effects may be present in the solution. \!\(\*ButtonBox[\">>\",Appearance->{Automatic, None},BaseStyle->\"Link\",ButtonData:>\"paclet:ref/message/NDSolveValue/bcart\",ButtonNote->\"NDSolveValue::bcart\"]\)"

It seems that Mathematica imposes an artificial additional boundary condition to solve the equation which makes me unpleasant. Is there any other algorithm that safely solves this type of equation only using the given boundary condition?

To have an example, please see the following(which is originally given in the above link),

f[t_, x_] = 1 + x^3 - 1/2 Sin[1 + 3 x^2 t];
sol = NDSolveValue[{D[z[t, x], t] == 1/2 Sin[1 + D[z[t, x], x]] + f[t, x], z[0, x] == 0}, 
         z, {t, 0, 1}, {x, 0, 2}]

This equation have an exact solution $t(1+x^3)$ and the above mathematica code seems to yield the desired value. However I also can find more complicated examples showing the additional boundary condition results in the wrong solution.

$\endgroup$

1 Answer 1

4
$\begingroup$

A boundary condition in x is needed, because there is a derivative in x. Specifying z[t, 0] == 0, for instance, allows the computation to proceed without error.

f[t_, x_] = 1 + x^3 - 1/2 Sin[1 + 3 x^2 t];
sol = NDSolveValue[{D[z[t, x], t] == 1/2 Sin[1 + D[z[t, x], x]] + f[t, x], 
    z[0, x] == 0, z[t, 0] == 0}, z, {t, 0, 1}, {x, 0, 2}];
Plot3D[sol[t, x], {t, 0, 1}, {x, 0, 2}, PlotRange -> All, AxesLabel -> {t, x, z}]

enter image description here

This additional boundary condition is required, both mathematically and numerically. If one is not provided, NDSolve in effect makes one up.

$\endgroup$

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.