필터 지우기
필터 지우기

Problem solving most simple elliptic PDE, 2015a

조회 수: 1 (최근 30일)
Bananach
Bananach 2016년 4월 13일
댓글: Bananach 2016년 4월 13일

Trying to solve $\Delta u=1$ on the unit square, I currently do

 pdem = createpde(1);
 c=1;
 a=0;
 f=1;
 geometryFromEdges(pdem,@squareg);
 generateMesh(pdem,'Hmax',0.2);
 assempde(pdem,c,a,f);

Unfortunately, the last command does not work, since it requires additionally the specification of variables P, E,T, which according to the help output specify a mesh.

Why do I need to specify the mesh again in order to solve the PDE? HOW do I specify the mesh? 'generateMesh' only gives one output.

채택된 답변

Alan Weiss
Alan Weiss 2016년 4월 13일
I do not see any error when using your set of commands, though I think the last command should be
u = assempde(pdem,c,a,f);
so you get the solution in a variable.
If you really get an error with that set of commands, please post the error that MATLAB returns.
Perhaps this example will help you understand how to solve an equation using generateMesh.
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 1
Bananach
Bananach 2016년 4월 13일
You are right, I am sorry. It seems that I had the variables messed up and fixed them when I created the MWE. In my defense, the output of 'help assempde' encouraged my thinking that what I wanted was not implemented since it does not list the possibility of only three inputs

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Geometry and Mesh에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by