- For edges with a normal in the y-direction (E2, E3): You've correctly set the electric field to [0,0] to indicate no flux across these boundaries, assuming a Neumann boundary condition of zero normal electric field.
- For the edge with a normal in the x-direction (E5): Setting the electric field to [0,0] implies no flux across this boundary as well, which matches your condition of having the x-component of the electric field be zero.
Specify normal component of electric field in EM PDE model
6 views (last 30 days)
Show older comments
I am trying to model a 2D dielectric through the PDE toolbox, https://in.mathworks.com/help/pde/ug/pde.electromagneticmodel.html
I need to specify Neumann boundary condition , that is electric field normal to specified surface is 0. I am using the following geometry
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1360758/image.png)
here E1, E2 and E4 are at fixed voltages, and I have specified constant Voltage as Boundary condition as shown below:
electromagneticBC(emagMA,"Edge",1,"Voltage",10)
electromagneticBC(emagMA,"Edge",4,"Voltage",10)
electromagneticBC(emagMA,"Edge",6,"Voltage",-10)
Next E2, E3 and E5 are open to air, hence I have prescribed Neumann Boundary condition that the electric field normal to the surface is 0, this is a standard prescription.
That means in this case, for E2 and E3, it is the y-component of electric field that is specified to be 0 while the x component is left unspecified. For E5, x-component of electric field is put to be 0 while y-component is left unspecified.
I have been looking at Electromagnetic boundary condition page (https://in.mathworks.com/help/pde/ug/pde.electromagneticbcassignment-properties.html) and related pages since hours but I am not able to find how to specify only a single component of field at an edge, my guess was Matlab will discard the parallel component itself and keep only normal component, but this is not happening, no matter what i specify as normal field component value at Edge E5, I get same result.
Then there are issues of specifying electric field at r=0 in cylindrical coordinates, that matlab tackles with axisymmetric flag, but that I can ask only once this simple issue of Neumann BC is resolved in 2d cartesian coordinates.
In short, I am not able to find a way to specify only normal electric field component for an edge and by Matlab's behaviour, it is not clear how it is dealing with essentially overspecified boundary conditions (It seems it is discarding the provided Neumann BC)
The code is as follows:
emagMA = createpde("electromagnetic","electrostatic")%-axisymmetric");
g = decsg([3 6 0 0 2 2 2 2 -1.5 1.5 1.5 1 -1 -1.5]');
geometryFromEdges(emagMA,g);
figure
pdegplot(emagMA,"EdgeLabels","on")
axis equal
figure
epsilon = 1;
mu = 1;
sigma = 0;
electromagneticProperties(emagMA,"RelativePermittivity",epsilon);
electromagneticBC(emagMA,"Edge",1,"Voltage",10);
electromagneticBC(emagMA,"Edge",4,"Voltage",10);
electromagneticBC(emagMA,"Edge",6,"Voltage",-10);
electromagneticBC(emagMA,"Edge",3,"ElectricField",[0,0]);
electromagneticBC(emagMA,"Edge",2,"ElectricField",[0,0]);
electromagneticBC(emagMA,"Edge",5,"ElectricField",[110,110]); %% change this to [100,0] or [0,100] or anything, matlab gives same plot
emagMA.VacuumPermittivity = 8.8541878128E-12;
emagMA.VacuumPermeability = 1.2566370614E-6;
generateMesh(emagMA,"Hmax",.05);
R = solve(emagMA)
pdeplot(R.Mesh,XYData=R.ElectricPotential, ...
FlowData=[R.ElectricField.Ex ...
R.ElectricField.Ey])
colormap('jet')
0 Comments
Answers (1)
Yash
on 14 Mar 2024
Hi Shlok,
From your description, it seems you are trying to apply a Neumann boundary condition to specify that the normal component of the electric field is zero on certain edges of your geometry.
In MATLAB's PDE Toolbox, specifying that only a specific component (x or y) of the electric field should be zero, while leaving the other component unspecified, is not directly supported in the way you might expect using the "electromagneticBC" function. The tool expects a vector value for the 'ElectricField' property, which applies to the entire boundary condition, not to individual components separately.
One workaround is to set the electric field to [0,0] on those edges. This approach, as you've noticed, doesn't allow you to specify conditions on individual components directly through the "electromagneticBC" function.
Given your specific requirements, here's a suggestion on how you might approach the problem:
In MATLAB, setting the entire electric field to zero on a boundary effectively enforces that there's no flux (or normal component of the electric field) crossing that boundary, but it doesn't allow you to specify conditions for individual components directly in the way you're hoping. The toolbox's abstraction level is such that it assumes boundary conditions apply uniformly across the specified boundary edges or faces.
For more complex boundary conditions that involve specific components in specific directions, you might need to look into implementing a custom solution or workaround, such as manipulating the problem formulation or post-processing results to enforce or check your desired conditions.
Hope this helps!
0 Comments
See Also
Categories
Find more on Geometry and Mesh 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!