Main Content

electromagneticBC

(To be removed) Apply boundary conditions to electromagnetic model

Since R2021a

    electromagneticBC will be removed. Use edgeBC and faceBC instead. (since R2023a) For more information on updating your code, see Version History.

    Description

    electromagneticBC(emagmodel,RegionType,RegionID,"Voltage",V) adds a voltage boundary condition to emagmodel. The boundary condition applies to regions of type RegionType with ID numbers in RegionID. The solver uses a voltage boundary condition for an electrostatic analysis.

    example

    electromagneticBC(emagmodel,RegionType,RegionID,"MagneticPotential",A) adds a magnetic potential boundary condition to emagmodel. The solver uses a magnetic potential boundary condition for a magnetostatic analysis.

    electromagneticBC(emagmodel,RegionType,RegionID,"SurfaceCurrentDensity",K) adds a surface current density boundary condition to emagmodel. The solver uses a surface current density boundary condition for a DC conduction analysis.

    electromagneticBC(emagmodel,RegionType,RegionID,"ElectricField",E) adds an electric field boundary condition to emagmodel. The solver uses an electric field boundary condition for a harmonic analysis with the electric field type.

    electromagneticBC(emagmodel,RegionType,RegionID,"MagneticField",H) adds a magnetic field boundary condition to emagmodel. The solver uses a magnetic field boundary condition for a harmonic analysis with the magnetic field type.

    electromagneticBC(emagmodel,RegionType,RegionID,"FarField","absorbing","Thickness",h) adds an absorbing boundary condition to emagmodel and specifies the thickness of the absorbing region. The solver uses an absorbing boundary condition for a harmonic analysis.

    electromagneticBC(emagmodel,RegionType,RegionID,"FarField","absorbing","Thickness",h,"Exponent",e,"Scaling",s) specifies the rate of attenuation of the waves entering the absorbing region. You can specify e, s, or both.

    electromagneticBC(___,InternalBC=intBCFlag) applies boundary conditions on internal edges. Use this syntax with any of the input argument combinations in the previous syntaxes.

    electromagneticBC(___,"Vectorized","on") uses vectorized function evaluation when you pass a function handle as an argument. If your function handle computes in a vectorized fashion, then using this argument saves time. For details on this evaluation, see More About and Vectorization.

    emagBC = electromagneticBC(___) returns the electromagnetic boundary condition object.

    Examples

    collapse all

    Create an electromagnetic model for electrostatic analysis.

    emagmodel = createpde("electromagnetic","electrostatic");

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

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

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

    Apply the voltage boundary condition on the side faces of the geometry.

    bc1 = electromagneticBC(emagmodel,"Voltage",0,"Face",3:6)
    bc1 = 
      ElectromagneticBCAssignment with properties:
    
          RegionID: [3 4 5 6]
        RegionType: 'Face'
        Vectorized: 'off'
        InternalBC: []
           Voltage: 0
    
    

    Apply the voltage boundary condition on the face bordering the hole.

    bc2 = electromagneticBC(emagmodel,"Voltage",1000,"Face",7)
    bc2 = 
      ElectromagneticBCAssignment with properties:
    
          RegionID: 7
        RegionType: 'Face'
        Vectorized: 'off'
        InternalBC: []
           Voltage: 1000
    
    

    Input Arguments

    collapse all

    Electromagnetic model, specified as an ElectromagneticModel object. The model contains a geometry, a mesh, electromagnetic properties of the material, the electromagnetic sources, and the boundary conditions.

    Geometric region type, specified as "Edge" for a 2-D model or "Face" for a 3-D model.

    Example: electromagneticBC(emagmodel,"Edge",1,"Voltage",100)

    Data Types: char | string

    Region ID, specified as a vector of positive integers. Find the edge or face IDs by using pdegplot with the EdgeLabels or FaceLabels name-value argument set to "on".

    Data Types: double

    Voltage, specified as a real number or a function handle. Use a function handle to specify a voltage that depends on the coordinates. For details, see More About.

    The solver uses a voltage boundary condition for an electrostatic analysis.

    Data Types: double | function_handle

    Magnetic potential, specified as a real number, a column vector of three elements for a 3-D model, or a function handle. Use a function handle to specify a magnetic potential that depends on the coordinates. For details, see More About.

    The solver uses a magnetic potential boundary condition for a magnetostatic analysis.

    Data Types: double | function_handle

    Electric field, specified as a column vector of two elements for a 2-D model, a vector of three elements for a 3-D model, or a function handle. Use a function handle to specify an electric field that depends on the coordinates. For details, see More About.

    The solver uses an electric field boundary condition for a harmonic analysis with the electric field type.

    Data Types: double | function_handle

    Surface current density in the direction normal to the boundary, specified as a real number or a function handle. The solver uses a surface current density boundary condition for a DC conduction analysis. Use a function handle to specify a surface current density that depends on the coordinates. For details, see More About.

    Data Types: double

    Magnetic field, specified as a column vector of two elements for a 2-D model, a column vector of three elements for a 3-D model, or a function handle. Use a function handle to specify a magnetic field that depends on the coordinates. For details, see More About.

    The solver uses a magnetic field boundary condition for a harmonic analysis with the magnetic field type.

    Data Types: double | function_handle

    Width of the far field absorbing region, specified as a nonnegative number. The solver uses an absorbing boundary condition for a harmonic analysis.

    Data Types: double

    Exponent defining the attenuation rate of the waves entering the absorbing region, specified as a nonnegative number. The solver uses an absorbing boundary condition for a harmonic analysis.

    Data Types: double

    Scaling parameter defining the attenuation rate of the waves entering the absorbing region, specified as a nonnegative number. The solver uses an absorbing boundary condition for a harmonic analysis.

    Data Types: double

    Apply boundary conditions on internal edges in 2-D geometries for all models, specified as true or false.

    • External boundary edges. These edges separate the geometry from the rest of the 2-D space.

    • Internal boundary edges. These edges separate faces of the geometry.

    Data Types: logical

    Output Arguments

    collapse all

    Handle to the electromagnetic boundary condition, returned as an ElectromagneticBCAssignment object. For more information, see ElectromagneticBCAssignment Properties.

    More About

    collapse all

    Version History

    Introduced in R2021a

    expand all