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 Properties object. For details, see FEMesh Properties.

    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 electromagnetic model for electrostatic analysis.

    emagmodel = createpde(electromagnetic="electrostatic");

    Import and plot the geometry representing a plate with a hole.

    importGeometry(emagmodel,"PlateHolePlanar.stl");
    pdegplot(emagmodel,EdgeLabels="on")

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

    emagmodel.VacuumPermittivity = 8.8541878128E-12;

    Specify the relative permittivity of the material.

    electromagneticProperties(emagmodel,RelativePermittivity=1);

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

    electromagneticBC(emagmodel,Voltage=0,Edge=1:4);
    electromagneticBC(emagmodel,Voltage=1000,Edge=5);

    Specify the charge density for the entire geometry.

    electromagneticSource(emagmodel,ChargeDensity=5E-9);

    Generate the mesh.

    generateMesh(emagmodel);

    Solve the model.

    R = solve(emagmodel)
    R = 
      ElectrostaticResults with properties:
    
          ElectricPotential: [1218x1 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

    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 electromagnetic model for electrostatic analysis.

    emagmodel = createpde(electromagnetic="electrostatic");

    Import and plot the geometry representing a plate with a hole.

    gm = importGeometry(emagmodel,"PlateHoleSolid.stl");
    pdegplot(gm,FaceLabels="on",FaceAlpha=0.3)

    Specify the vacuum permittivity in the SI system of units.

    emagmodel.VacuumPermittivity = 8.8541878128E-12;

    Specify the relative permittivity of the material.

    electromagneticProperties(emagmodel,RelativePermittivity=1);

    Specify the charge density for the entire geometry.

    electromagneticSource(emagmodel,ChargeDensity=5E-9);

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

    electromagneticBC(emagmodel,Voltage=0,Face=3:6);
    electromagneticBC(emagmodel,Voltage=1000,Face=7);

    Generate the mesh.

    generateMesh(emagmodel);

    Solve the model.

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

    Plot the electric potential.

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

    Plot the electric field.

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

    Version History

    Introduced in R2021a