Plotting the Electric Field of a 3D Parallel Plate
14 views (last 30 days)
The code below creates a parallel plate capacitor with a 1000V potential on the top plate, 0V potential on the bottom, and no flow through the wall. Using the PDE solver I've managed to get the nodal solution of the model which represents the electric potential. I wish to know how to properly take and plot the gradient of the field as to produce the electric field at each node. Below is what I have thus far:
model = createpde(3);
importGeometry(model,'Parallel Plate Capacitor.SLDPRT.STL')
pdegplot(model,'FaceLabels','on','FaceAlpha',0.2) % creates simple 3D model
'q',[0;0;0],'g',[0;0;0]); % try with no BC
applyBoundaryCondition(model,'dirichlet','Face',3,'u',[1000;1000;1000]) % BC for top plate
applyBoundaryCondition(model,'dirichlet','Face',2,'u',[0;0;0]) % BC for bottom plate
f = [0;0;0]; % source charge (constant)
CA = specifyCoefficients(model,'m',0,...
results = solvepde(model);
v = results.NodalSolution;
pdeplot3D(model,'ColorMapData',v(:,3), 'FaceAlpha', 0.5)
vectorField = gradient(v);
Taking the gradient of the nodalSolutions gives me (hopefully) electric field values in the x,y, and z components of each node. I want to know how I can plot these values onto 3D plot to show the direction and flow of the electric field.