a or d for Systems

Coefficients a or d

This section describes how to write the coefficients a or d in the equation

dut(cu)+au=f,

or in similar equations. a and d are N-by-N matrices, where N is the number of equations, see Systems of PDEs.

Express the coefficients as numbers, text expressions, or functions, as in f for Systems.

The number of rows in the matrix is either 1, N, N(N+1)/2, or N2, as described in the next few sections. If you choose to express the coefficients in functional form, the number of columns is Nt, which is the number of triangles in the mesh. The function should evaluate a or d at the triangle centroids, as in Scalar PDE Coefficients in Function Form. Give solvers the function name as a string 'filename', or as a function handle @filename, where filename.m is a file on your MATLAB® path. For details on how to write the function, see Calculate Coefficients in Function Form.

Often, a or d have structure, either as symmetric or diagonal. In these cases, you can represent a or d using fewer than N2 rows.

Scalar a or d

The software interprets a scalar a or d as a diagonal matrix.

(a000a000a)

N-Element Column Vector a or d

The software interprets an N-element column vector a or d as a diagonal matrix.

(d(1)000d(2)000d(N))

For example, if N = 3, a or d could be

a = char('sin(x) + cos(y)','cosh(x.*y)','x.*y./(1+x.^2+y.^2)') % or d
a =

sin(x) + cos(y)    
cosh(x.*y)         
x.*y./(1+x.^2+y.^2)

N(N+1)/2-Element Column Vector a or d

The software interprets an N(N+1)/2-element column vector a or d as a symmetric matrix. In the following diagram, • means the entry is symmetric.

(a(1)a(2)a(4)a(N(N1)/2)·a(3)a(5)a(N(N1)/2+1)··a(6)a(N(N1)/2+2)···a(N(N+1)/2))

Coefficient a(i,j) is in row (j(j–1)/2+i) of the vector a.

N2-Element Column Vector a or d

The software interprets an N2-element column vector a or d as a matrix.

(d(1)d(N+1)d(N2N+1)d(2)d(N+2)d(N2N+2)d(N)d(2N)d(N2))

Coefficient a(i,j) is in row (N(j–1)+i) of the vector a.

Related Examples

Was this topic helpful?