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
figure(1)pdegplot(model,'FaceLabels','on')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
generateMesh(model)pdeplot3D(model)f = [100;100;100] % source of voltage from top plate
CA = specifyCoefficients(model,'m',0,... 'd',0,... 'c',1,... 'a',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
Best Answer