Boundary Condition for 3-D Poisson's Equation using PDE Toolbox
조회 수: 3(최근 30일)
표시 이전 댓글
댓글: Hayden Bland 2020년 8월 6일
I am attempting to model the electric field of a cylinder with 3 spheres inside. To do this I am attempting to solve Poisson's Equation in 3-D with the PDE Toolbox, and am running into errors with the boundary conditions. I am getting the associated error. Any guidance is much appreciated.
"Error using pde.internal.pde3DBCImpl/setValueBCOnFace (line 100)
The "u" parameter has length 1 so the "EquationIndex" vector must also have length 1 instead of length 3.
This error occurred in the definition of a pde.BoundaryCondition entity on edge 14."
model = createpde(3) % creates 3 equations
importGeometry(model,'ModelSystem.STL') % imports solidworks part
applyBoundaryCondition(model,'dirichlet','Face',14,'u',0) % bottom face with E field of 0
applyBoundaryCondition(model,'dirichlet','Face',13,'u',100) % top face with E field of 100
applyBoundaryCondition(model,'dirichlet','Face',1:12,'u',0) % rest of faces also with E field of 0
f = [100;100;100] % source of voltage from top plate
CA = specifyCoefficients(model,'m',0,...
'f', f) % specifies coefficients as described in MATLAB documentation
results = solvepde(model); % this is when the error occurs
pdeplot3D(model,'ColorMapData',results.NodalSolution) % rendering of model
댓글 수: 0
Ravi Kumar 2020년 8월 6일
You need BC for all three equations. You might want to try u as [0;0;0] or other appropriate vector of 3 rows, where each row corresponds to the three PDEs.
댓글 수: 1
Find more on Electromagnetics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!