2 eqns in 2D with different BCs applied to each variable on the same edge? On E1, u1=0 and du2/dn=0, on E2 u2=1 and =du1/dn=0. The solution is all zeros. Example code is below
Mostrar comentarios más antiguos
% Create a PDE model with a system of two equations
model = createpde (2);
% Use a Rectanglar geometry
R1 = [3, 4, -1, 1, 1, -1, -.4, -.4, .4, .4]';
g = decsg (R1);
geometryFromEdges (model, g);
pdegplot (model, 'EdgeLabels', 'on')
% Apply Dirichlet type boundary condition to u1 and u2 on E1 and E3
applyBoundaryCondition (model, 'mixed', 'Edge', 1, 'u', 0, 'EquationIndex', 1);
applyBoundaryCondition (model, 'mixed', 'Edge', 3, 'u', 1, 'EquationIndex', 2);
% Apply Neumann type boundary condition to u1 and u2 on E3 and E1
applyBoundaryCondition (model, 'mixed', 'Edge', 3, 'g', 0, 'q', 0, 'EquationIndex', 1);
applyBoundaryCondition (model, 'mixed', 'Edge', 1, 'g', 0, 'q', 0, 'EquationIndex', 2);
% Generate the mesh
generateMesh (model);
% Setup the PDE
specifyCoefficients (model, 'm', 0, 'd', 0, 'c', 1, 'a', [-1;-1; 1; 1], 'f', [0; 0]);
% Solve the PDE
result = solvepde (model)
result =
StationaryResults with properties:
NodalSolution: [1001×2 double]
XGradients: [1001×2 double]
YGradients: [1001×2 double]
ZGradients: [0×2 double]
Mesh: [1×1 FEMesh]
The Nodal solution is all zeros. I realize that the PDE setup does not support Dirichlet and Neumann BCs for the same variable on the same edge. I'm applying different BCs to different variable on the same edge. Is there a bug, or am I doing something wrong?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre General PDEs en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!