What is the syntax for building a command-line pde given the model parameters exported from pdetool?

조회 수: 5 (최근 30일)
I have a working 2-d pdetool model, that I would like to convert to a command line model in order to iterate and export solutions. From pdetool I have exported the following variables:
%%%Draw
% gd : geometry data
% sf : set formula
% ns : labels
%%%Boundary
% g : geometry
% b : boundary
%%%PDE
% c : PDE coefficients
% a :
% f :
% d :
mesh
p : points e : edges t : triangle
I have recreated the geometry with :
pdem = createpde(1);
geometryFromEdges(pdem,g);
But I have been unable to get much further.
applyBoundaryCondition(pdem,'dirichlet','Edge',1:20,'b',b);
Error using pde.BoundaryCondition (line 93)
The value of 'BCType' is invalid. The first argument to pde.BoundaryCondition must be
'dirichlet','neumann', or 'mixed'.
specifyCoefficients(pdem,'m',0,'d',d,'c',c,'a',a,'f',f);
Error using pde.CoefficientAssignment/CoefPrecheck (line 412)
A coefficient value cannot be a character vector or character vector-expression.
And generateMesh does not seem to have any arguments that look like the pdetool outputs.
What is the syntax for building a command-line pde given the model parameters exported from pdetool?
Thank you.

채택된 답변

Burke Rosen
Burke Rosen 2017년 2월 10일
I believe I have figured it out.
v = assempde(b,p,e,t,c,a,f);
This returns the solution for each point in the mesh. This can then be plotted:
scatter(p(1,:),p(2,:),ones(size(sol)),sol,'filled')
% or
[xq,yq] = meshgrid(-11:.1:-3, 0:.1:5);% insert appropriate values
vq = griddata(p(1,:),p(2,:),v,xq,yq);
mesh(xq,yq,vq)
view(0,90)
It would be very nice, however, if pdetool could export a complete PDEMmodel object.

추가 답변 (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