This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Put Equations in Divergence Form

Coefficient Matching for Divergence Form

As explained in Equations You Can Solve Using PDE Toolbox, Partial Differential Equation Toolbox™ solvers address equations of the form

(cu)+au=f

or variants that have derivatives with respect to time, or that have eigenvalues, or are systems of equations. These equations are in divergence form, where the differential operator begins ·. The coefficients a, c, and f are functions of position (x, y, z) and possibly of the solution u.

However, you can have equations in a form with all the derivatives explicitly expanded, such as

(1+x2)2ux23xy2uxy+(1+y2)22uy2=0

In order to transform this expanded equation into toolbox format, you can try to match the coefficients of the equation in divergence form to the expanded form. In divergence form, if

c=(c1c3c2c4)

then

·(cu)=c1uxx+(c2+c3)uxy+c4uyy+(c1x+c2y)ux+(c3x+c4y)uy

Matching coefficients in the uxx and uyy terms in (cu) to the equation, you get

c1=(1+x2)c4=(1+y2)/2

Then looking at the coefficients of ux and uy, which should be zero, you get

(c1x+c2y)=2x+c2ysoc2=2xy.(c3x+c4y)=c3xysoc3=xy

This completes the conversion of the equation to the divergence form

(cu)=0

Boundary Conditions Can Affect the c Coefficient

The c coefficient appears in the generalized Neumann condition

n·(cu)+qu=g

So when you derive a divergence form of the c coefficient, keep in mind that this coefficient appears elsewhere.

For example, consider the 2-D Poisson equation uxx – uyy = f. Obviously, you can take c = 1. But there are other c matrices that lead to the same equation: any that have c(2) + c(3) = 0.

·(cu)=·((c1c3c2c4)(uxuy))=x(c1ux+c3uy)+y(c2ux+c4uy)=c1uxx+c4uyy+(c2+c3)uxy

So there is freedom in choosing a c matrix. If you have a Neumann boundary condition such as

n·(cu)=2

the boundary condition depends on which version of c you use. In this case, make sure that you take a version of c that is compatible with both the equation and the boundary condition.

Some Equations Cannot Be Converted

Sometimes it is not possible to find a conversion to a divergence form such as

(cu)+au=f

For example, consider the equation

2ux2+cos(x+y)42uxy+122uy2=0

By simple coefficient matching, you see that the coefficients c1 and c4 are –1 and –1/2 respectively. However, there are no c2 and c3 that satisfy the remaining equations,

c2+c3=cos(x+y)4c1x+c2y=c2y=0c3x+c4y=c3x=0

Related Topics