# electromagneticBC

**Domain-specific electromagnetic workflow is not recommended. New features might not be
compatible with this workflow. For help migrating your existing code to the unified finite
element workflow, see Migration from Domain-Specific to Unified Workflow.**

## Syntax

## Description

`electromagneticBC(`

adds a voltage boundary condition to `emagmodel`

,`RegionType`

,`RegionID`

,"Voltage",`V`

)`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.

`electromagneticBC(`

adds a magnetic potential boundary condition to `emagmodel`

,`RegionType`

,`RegionID`

,"MagneticPotential",`A`

)`emagmodel`

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

`electromagneticBC(`

adds a surface current density boundary condition to `emagmodel`

,`RegionType`

,`RegionID`

,"SurfaceCurrentDensity",`K`

)`emagmodel`

. The
solver uses a surface current density boundary condition for a DC conduction
analysis.

`electromagneticBC(`

adds an electric field boundary condition to `emagmodel`

,`RegionType`

,`RegionID`

,"ElectricField",`E`

)`emagmodel`

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

`electromagneticBC(`

adds a magnetic field boundary condition to `emagmodel`

,`RegionType`

,`RegionID`

,"MagneticField",`H`

)`emagmodel`

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

`electromagneticBC(`

adds an absorbing boundary condition to `emagmodel`

,`RegionType`

,`RegionID`

,"FarField","absorbing","Thickness",`h`

)`emagmodel`

and specifies the
thickness of the absorbing region. The solver uses an absorbing boundary condition for a
harmonic analysis.

`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.

Use this syntax with any of the input argument combinations in the previous syntaxes.

## Examples

## Input Arguments

## Output Arguments

## More About

## Version History

**Introduced in R2021a**