Documentation

hyperbolic

Solve hyperbolic PDE problem

Syntax

u1 = hyperbolic(u0,ut0,tlist,model,c,a,f,d)
u1 = hyperbolic(u0,ut0,tlist,model,c,a,f,d,rtol)
u1 = hyperbolic(u0,ut0,tlist,model,c,a,f,d,rtol,atol)

u1 = hyperbolic(u0,ut0,tlist,b,p,e,t,c,a,f,d)
u1 = hyperbolic(u0,ut0,tlist,b,p,e,t,c,a,f,d,rtol)
u1 = hyperbolic(u0,ut0,tlist,b,p,e,t,c,a,f,d,rtol,atol)

u1 = hyperbolic(u0,ut0,tlist,K,F,B,ud,M)
u1 = hyperbolic(u0,ut0,tlist,K,F,B,ud,M,rtol)
u1 = hyperbolic(u0,ut0,tlist,K,F,B,ud,M,rtol,atol)
u1 = hyperbolic(u0,ut0,tlist,K,F,B,ud,M,___,'DampingMatrix',D)

u1 = hyperbolic(___,'Stats','off')

Description

u1 = hyperbolic(u0,ut0,tlist,model,c,a,f,d) produces the solution to the FEM formulation of the scalar PDE problem

d2ut2(cu)+au=f,

for (x,y) ∊ Ω, or the system PDE problem

d2ut2(cu)+au=f,

with geometry, mesh, and boundary conditions specified in model, initial value u0, and initial derivative ut0. model is a PDEModel object. See Solve Problems Using PDEModel Objects.

For a scalar PDE problem, each row in the solution matrix u1 is the solution at the coordinates given by the corresponding column in the points p = model.Mesh.Nodes. Each column in u1 is the solution at the time given by the corresponding item in tlist. For a system of dimension N with np node points, the first np rows of u1 describe the first component of u, the following np rows of u1 describe the second component of u, and so on. Thus, the components of u are placed in the vector u as N blocks of node point rows.

The coefficients c, a, d, and f of the PDE problem can be given in a variety of ways. The coefficients can depend on t, the time. They can also depend on u, the solution, and on the components of the gradient of u, namely ux and uy. For a complete listing of all options, see Scalar PDE Coefficients and Coefficients for Systems of PDEs.

atol and rtol are absolute and relative tolerances that are passed to the ODE solver.

u1 = hyperbolic(u0,ut0,tlist,b,p,e,t,c,a,f,d) solves the problem using a mesh described by p, e, and t, with boundary conditions given by b.

b describes the boundary conditions of the PDE problem. For the recommended way of specifying boundary conditions, see Specify Boundary Conditions Objects. For all methods of specifying boundary conditions, see Forms of Boundary Condition Specification.

The geometry of the PDE problem is given by the mesh data p, e, and t. For details on the mesh data representation, see initmesh.

u1 = hyperbolic(u0,ut0,tlist,K,F,B,ud,M) produces the solution to the ODE problem

BMBd2uidt2+K·ui=Fu=Bui+ud

with initial values for u being u0 and ut0. The K, F, B, ud, and M matrices have the same meaning as in the assempde syntax using those matrices.

Add the DampingMatrix name-value pair at the end of any matrix-form syntax to solve the damped equation

BMBd2uidt2+BDBduidt+K·ui=Fu=Bui+ud.

For a worked example using this syntax, see Dynamics of a Damped Cantilever Beam.

Add the Stats name-value pair at the end of any syntax to control the display of internal ODE solver statistics. Valid values for Stats are 'off' and 'on' (default).

Examples

Solve the wave equation

2ut2=Δu

on a square geometry –1 ≤ x,y ≤ 1 (squareg), with Dirichlet boundary conditions u = 0 for x = ±1, and Neumann boundary conditions

un=0

for y = ±1 (squareb3). Choose

u(0) = atan(cos(πx))

and

dudt(0)=3sin(πx)exp(cos(πy)).

Compute the solution at times 0, 1/6, 1/3, ..., 29/6, 5. Plot the first and last solutions.

model = createpde;
geometryFromEdges(model,@squareg);
pdegplot(model,'EdgeLabels','on');
axis equal
ylim([-1.1,1.1])
applyBoundaryCondition(model,'Edge',[2,4],'u',0);

generateMesh(model,'Hmax',0.1);
p = model.Mesh.Nodes;
x = p(1,:)'; 
y = p(2,:)'; 
u0 = atan(cos(pi/2*x)); 
ut0 = 3*sin(pi*x).*exp(cos(pi*y)); 
tlist = linspace(0,5,31);
c = 1;
a = 0;
f = 0;
d = 1;
u1 = hyperbolic(u0,ut0,tlist,model,c,a,f,d);
figure
pdeplot(model,'xydata',u1(:,1))
figure
pdeplot(model,'xydata',u1(:,31))

The file pdedemo6 contains a complete example with animation.

    Note   In expressions for boundary conditions and PDE coefficients, the symbol t is used to denote time. The variable t is often used to store the triangle matrix of the mesh. You can use any variable to store the triangle matrix, but in the Partial Differential Equation Toolbox™ expressions, t always denotes time.

See Also

|

Introduced before R2006a

Was this topic helpful?