필터 지우기
필터 지우기

how to solve diffusion equation using pde toolbox

조회 수: 20 (최근 30일)
SUDALAI  MANIKANDAN
SUDALAI MANIKANDAN 2018년 2월 13일
댓글: SUDALAI MANIKANDAN 2018년 2월 16일
I have ficks diffusion equation need to solved in pde toolbox and the result of which used in another differential equation to find the resultant parameter can any help on this! Thanks for the attention

답변 (1개)

Ravi Kumar
Ravi Kumar 2018년 2월 14일
You can solve diffusion equation in PDE Toolbox. Check this example:
% Create a model.
model = createpde(1);
% Create geometry and assign it to the model
R1 = [3;4;-1;1;1;-1;-1;-1;1;1];
C1 = [1;0;0;0.4];
C1 = [C1;zeros(length(R1) - length(C1),1)];
gd = [R1,C1];
sf = 'R1+C1';
ns = char('R1','C1')';
g = decsg(gd,sf,ns);
geometryFromEdges(model,g);
figure
pdegplot(model,'EdgeLabels','on','FaceLabels','on')
% Specify coefficients, diffusion coefficient as c and source as f
% Assign zero source and a diffusion coefficient, c = 1
specifyCoefficients(model,'Face',1,'m',0,'d',1,'c',1,'a',0,'f',0);
% Assign non-zero source and a different diffusion coefficient c = 2 on inner
% circle
specifyCoefficients(model,'Face',2,'m',0,'d',1,'c',2,'a',0,'f',1);
% Set initial condition
setInitialConditions(model,0);
setInitialConditions(model,1,'Face',2);
% Generate mesh and solve.
generateMesh(model)
tlist = linspace(0,0.1,20);
result = solvepde(model,tlist)
% Plot results of last time-step.
figure
pdeplot(model,'XYData',result.NodalSolution(:,end))
  댓글 수: 3
Ravi Kumar
Ravi Kumar 2018년 2월 14일
Can you post a picture of 3-D geometry you have? How many sub-domains does it have?
SUDALAI  MANIKANDAN
SUDALAI MANIKANDAN 2018년 2월 16일
It is a rectangular geometry with the following specifications i would like to know how to specify the boundary conditions
Nodes: [3×19797 double] Elements: [10×13170 double] MaxElementSize: 0.8718 MinElementSize: 0.4359 MeshGradation: 1.5000 GeometricOrder: 'quadratic'

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

카테고리

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