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

6 次查看(过去 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