Main Content

ElectrostaticResults

Electrostatic solution and derived quantities

Since R2021a

    Description

    An ElectrostaticResults object contains the electric potential, electric field, and electric flux density values in a form convenient for plotting and postprocessing.

    The electric potential, electric field, and electric flux density are calculated at the nodes of the triangular or tetrahedral mesh generated by generateMesh. Electric potential values at the nodes appear in the ElectricPotential property. Electric field values at the nodes appear in the ElectricField property. Electric flux density at the nodes appear in the ElectricFluxDensity property.

    To interpolate the electric potential, electric field, and electric flux density to a custom grid, such as the one specified by meshgrid, use the interpolateElectricPotential, interpolateElectricField, and interpolateElectricFlux functions.

    Creation

    Solve an electrostatic problem using the solve function. This function returns a solution as an ElectrostaticResults object.

    Properties

    expand all

    This property is read-only.

    Electric potential values at nodes, returned as a vector.

    Data Types: double

    This property is read-only.

    Electric field values at nodes, returned as an FEStruct object. The properties of this object contain the components of the electric field at nodes.

    This property is read-only.

    Electric flux density values at nodes, returned as an FEStruct object. The properties of this object contain the components of electric flux density at nodes.

    This property is read-only.

    Maxwell stress tensor at nodes, returned as a 2-by-2-by-N real array for a 2-D geometry or a 3-by-3-by-N real array for a 3-D geometry. Here, N is the number of nodes.

    By default, this property is empty and not displayed. The toolbox displays this property of the ElectrostaticResults object only after you call the generateMaxwellStressTensor function.

    Data Types: double

    This property is read-only.

    Finite element mesh, returned as an FEMesh object.

    Object Functions

    generateMaxwellStressTensorCompute Maxwell stress tensor at nodal locations
    interpolateElectricPotentialInterpolate electric potential in electrostatic or DC conduction result at arbitrary spatial locations
    interpolateElectricFieldInterpolate electric field in electrostatic or DC conduction result at arbitrary spatial locations
    interpolateElectricFluxInterpolate electric flux density in electrostatic result at arbitrary spatial locations
    interpolateMaxwellStressTensorInterpolate Maxwell stress tensor at arbitrary spatial locations

    Examples

    collapse all

    Solve an electromagnetic problem and find the electric potential and field distribution for a 2-D geometry representing a plate with a hole.

    Create an femodel object for electrostatic analysis and include a geometry representing a plate with a hole.

    model = femodel(AnalysisType="electrostatic",...
                    Geometry="PlateHolePlanar.stl");

    Plot the geometry with edge labels.

    pdegplot(model.Geometry,EdgeLabels="on")

    Figure contains an axes object. The axes object contains an object of type line.

    Specify the vacuum permittivity value in the SI system of units.

    model.VacuumPermittivity = 8.8541878128E-12;

    Specify the relative permittivity of the material.

    model.MaterialProperties = ...
        materialProperties(RelativePermittivity=1);

    Apply the voltage boundary conditions on the edges framing the rectangle and the circle.

    model.EdgeBC(1:4) = edgeBC(Voltage=0);
    model.EdgeBC(5) = edgeBC(Voltage=1000);

    Specify the charge density for the entire geometry.

    model.FaceLoad = faceLoad(ChargeDensity=5E-9);

    Generate the mesh.

    model = generateMesh(model);

    Solve the model.

    R = solve(model)
    R = 
      ElectrostaticResults with properties:
    
          ElectricPotential: [1231x1 double]
              ElectricField: [1x1 FEStruct]
        ElectricFluxDensity: [1x1 FEStruct]
                       Mesh: [1x1 FEMesh]
    
    

    Plot the electric potential and field.

    pdeplot(R.Mesh,XYData=R.ElectricPotential, ...
                   FlowData=[R.ElectricField.Ex ...
                             R.ElectricField.Ey])
    axis equal

    Figure contains an axes object. The axes object contains 2 objects of type patch, quiver.

    Solve an electromagnetic problem and find the electric potential and field distribution for a 3-D geometry representing a plate with a hole.

    Create an femodel object for electrostatic analysis and include a geometry representing a plate with a hole.

    model = femodel(AnalysisType="electrostatic", ...
                    Geometry="PlateHoleSolid.stl");

    Plot the geometry.

    pdegplot(model.Geometry,FaceLabels="on",FaceAlpha=0.3)

    Figure contains an axes object. The axes object contains 6 objects of type quiver, text, patch, line.

    Specify the vacuum permittivity in the SI system of units.

    model.VacuumPermittivity = 8.8541878128E-12;

    Specify the relative permittivity of the material.

    model.MaterialProperties = ...
        materialProperties(RelativePermittivity=1);

    Specify the charge density for the entire geometry.

    model.CellLoad = cellLoad(ChargeDensity=5E-9);

    Apply the voltage boundary conditions on the side faces and the face bordering the hole.

    model.FaceBC(3:6) = faceBC(Voltage=0);
    model.FaceBC(7) = faceBC(Voltage=1000);

    Generate the mesh.

    model = generateMesh(model);

    Solve the model.

    R = solve(model)
    R = 
      ElectrostaticResults with properties:
    
          ElectricPotential: [4747x1 double]
              ElectricField: [1x1 FEStruct]
        ElectricFluxDensity: [1x1 FEStruct]
                       Mesh: [1x1 FEMesh]
    
    

    Plot the electric potential.

    figure
    pdeplot3D(R.Mesh,ColorMapData=R.ElectricPotential)

    Figure contains an axes object. The hidden axes object contains 5 objects of type patch, quiver, text.

    Plot the electric field.

    pdeplot3D(R.Mesh,FlowData=[R.ElectricField.Ex ...
                               R.ElectricField.Ey ...
                               R.ElectricField.Ez])

    Figure contains an axes object. The hidden axes object contains 5 objects of type quiver, text.

    Version History

    Introduced in R2021a