필터 지우기
필터 지우기

Supporting documentation regarding PDE boundary files

조회 수: 2 (최근 30일)
Susannah
Susannah 2013년 8월 15일
I am trying to solve a PDE on a square domain, and came across the boundary files squareb1,squareb2, etc. These are potentially useful to me, however I am not clear what boundary conditions each file gives. I want a file with Neumann conditions around each edge.
Thanks!

채택된 답변

Bill Greene
Bill Greene 2013년 8월 16일
Hi,
Your question is certainly a reasonable one. The boundary matrix format in those files is unquestionably difficult to decode.
I suggest an alternate approach instead of trying to decipher those example files. This example boundary file below will define a zero Neumann boundary condition on all edges of a model-- a square or something much more complicated.
function [ q, g, h, r ] = boundaryFileZeroNeumann( p, e, u, time )
% Define a zero Neumann condition on all edges
N = 1 % number of pde in the system
ne = size(e,2); % number of boundary edges
q = zeros(N^2, ne); % Neumann coefficient q is zero on all edges
g = zeros(N, ne); % Neumann coefficient g is zero on all edges
h = zeros(N^2, 2*ne); % Dirichlet h coefficient is zero at both ends of all edges
r = zeros(N,2*ne); % Dirichlet r coefficient is zero at both ends of all edges
end
The line N = 1 says that you have a single PDE (i.e. a scalar PDE) in your system. If you have more than one, you need to change this line. You can pass this function to assempde or the other high-level PDE Toolbox functions by defining
b = @boundaryFileZeroNeumann;
This function is a very simple boundary file example. You can easily generalize this to an arbitrary combination of Dirichlet and Neumann conditions. Take a look at this documentation page if you are interested in doing that.
Bill
  댓글 수: 1
Susannah
Susannah 2013년 8월 16일
This does exactly what I want. Thank you very much!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Boundary Conditions에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by