Partial Differential Equation Toolbox Examples

Voir le sujet précédent Voir le sujet suivant Aller en bas

Partial Differential Equation Toolbox Examples

Message par dandani le Mar 9 Fév - 13:00

Inhomogeneous Heat Equation on a Square Domain

This example shows how to solve the heat equation with a source term using the parabolic function in the Partial Differential Equation Toolbox™.

The basic heat equation with a unit source term is

$$\frac{\partial u}{\partial t} - \Delta u = 1$$

This is solved on a square domain with a discontinuous initial condition and zero Dirichlet boundary conditions.

Problem Definition

g: A specification function that is used by initmesh. For more information, please see the documentation page for squareg and pdegeom.

c, a, f, d: The coefficients of the PDE.

g = @squareg;
c = 1;
a = 0;
f = 1;
d = 1;

Create a PDE Model with a single dependent variable

numberOfPDE = 1;
pdem = createpde(numberOfPDE);

Create a geometry and append it to the PDE Model


Apply Boundary Conditions

% Plot the geometry and display the edge labels for use in the boundary
% condition definition.
pdegplot(pdem, 'edgeLabels', 'on');
axis([-1.1 1.1 -1.1 1.1]);
title 'Geometry With Edge Labels Displayed'

% Solution is zero at all four outer edges of the square
applyBoundaryCondition(pdem,'Edge',(1:4), 'u', 0);


Messages : 5
Date d'inscription : 11/06/2015
Age : 24

Revenir en haut Aller en bas

Voir le sujet précédent Voir le sujet suivant Revenir en haut

- Sujets similaires

Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum