FUNCTION REFERENCE

specifyCoefficients

Specify equation coefficients for a 2-D PDE model (scalar or N-equation system).

Specify equation coefficients for a 2-D PDE model (scalar or N-equation system).

Syntax

ca = specifyCoefficients(model, 'm', m, 'd', d, 'c', c, 'a', a, 'f', f); ca = specifyCoefficients(..., 'Face', faceIDs)

Sets the coefficients of the 2-D PDE m*d2u/dt2 + d*du/dt - div(c*grad(u)) + a*u = f on all faces or on the specified Face IDs. All five coefficient names 'm', 'd', 'c', 'a', and 'f' are required. Each value may be numeric or a function handle @(location,state) where location has fields x, y, subdomain and state has u, ux, uy, time. For scalar PDEs (N = 1), c may be a scalar, 2x1 [c11;c22], 3x1 [c11;c12;c22], or 4x1 [c11;c21;c12;c22]. For N-equation systems, c accepts 1, 2, 3, 4, N, 2N, 3N, 4N, N(2N+1), or 4N^2 rows in the MATLAB system layout (the 2-, 3-, and 4-element forms put the same 2x2 block on every equation and take precedence over the N-element form for N = 2, 3, 4 and over the 2N-element form for N = 2), or N^2 rows (isotropic N-by-N blocks, N >= 5); m, d, and a accept 1, N, N(N+1)/2, or N^2 rows (or an N-by-N matrix); f accepts a scalar or N-by-1 vector. Later calls override earlier assignments on the same faces. Returns the coefficient assignment record and updates model.EquationCoefficients.

Example

R1=[3;4;0;1;1;0;0;0;1;1]; dl=decsg(R1); m=createpde(); geometryFromEdges(m,dl); ca=specifyCoefficients(m,'m',0,'d',0,'c',1,'a',0,'f',1); ca.f

Example

R1=[3;4;0;1;1;0;0;0;1;1]; dl=decsg(R1); m=createpde(2); geometryFromEdges(m,dl); ca=specifyCoefficients(m,'m',0,'d',0,'c',[1;0;1;2;0;2],'a',[1;0;1],'f',[1;2]); numel(ca.c)

Differences from MATLAB: 2-D PDE models only; 3-D 'Cell' regions are not supported yet.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.