findElectromagneticSource
Description
returns the change or current density emSource
= findElectromagneticSource(sources
,RegionType
,RegionID
)emSource
assigned to the specified
region of the specified model.
Examples
Find Current Density for Faces of 2-D Geometry
Create an electromagnetic model for magnetostatic analysis.
emagmodel = createpde("electromagnetic","magnetostatic");
Include the L-shaped membrane geometry in the model and plot it with the face labels.
geometryFromEdges(emagmodel,@lshapeg); pdegplot(emagmodel,"FaceLabels","on") ylim([-1.1 1.1]) axis equal
Specify a different current density for each face.
electromagneticSource(emagmodel,"Face",1,"CurrentDensity",10); electromagneticSource(emagmodel,"Face",2,"CurrentDensity",20); electromagneticSource(emagmodel,"Face",3,"CurrentDensity",30);
Check the electromagnetic source specification for each face.
findElectromagneticSource(emagmodel.Sources,"Face",1)
ans = ElectromagneticSourceAssignment with properties: RegionType: 'Face' RegionID: 1 ChargeDensity: [] CurrentDensity: 10 Magnetization: []
findElectromagneticSource(emagmodel.Sources,"Face",2)
ans = ElectromagneticSourceAssignment with properties: RegionType: 'Face' RegionID: 2 ChargeDensity: [] CurrentDensity: 20 Magnetization: []
findElectromagneticSource(emagmodel.Sources,"Face",3)
ans = ElectromagneticSourceAssignment with properties: RegionType: 'Face' RegionID: 3 ChargeDensity: [] CurrentDensity: 30 Magnetization: []
Find Charge Density for Cells of 3-D Geometry
Create and plot a geometry consisting of two nested spheres.
gm = multisphere([5 15]); pdegplot(gm,"CellLabels","on","FaceAlpha",0.3)
Create an electromagnetic model for electrostatic analysis.
emagmodel = createpde("electromagnetic","electrostatic");
Include the geometry in the model.
emagmodel.Geometry = gm;
Specify the charge density for the inner sphere.
electromagneticSource(emagmodel,"Cell",1,"ChargeDensity",10);
Check the electromagnetic source specification for each cell.
findElectromagneticSource(emagmodel.Sources,"Cell",1)
ans = ElectromagneticSourceAssignment with properties: RegionType: 'Cell' RegionID: 1 ChargeDensity: 10 CurrentDensity: [] Magnetization: []
findElectromagneticSource(emagmodel.Sources,"Cell",2)
ans = 0x1 ElectromagneticSourceAssignment array with properties: RegionType RegionID ChargeDensity CurrentDensity Magnetization
Input Arguments
sources
— Source in electromagnetic model
Sources
property
Source in an electromagnetic model, specified as the Sources
property of the model.
Example: findElectromagneticSource(emagmodel.Sources,"Face",1)
RegionType
— Geometric region type
"Face"
for a 2-D model | "Cell"
for a 3-D model
Geometric region type, specified as "Face"
for a 2-D model or
"Cell"
for a 3-D model.
Data Types: char
| string
RegionID
— Region ID
vector of positive integers
Region ID, specified as a vector of positive integers. Find the face or cell IDs by
using pdegplot
with the
"FaceLabels"
or "CellLabels"
name-value argument
set to "on"
.
Data Types: double
Output Arguments
emSource
— Electromagnetic source assignment
ElectromagneticSourceAssignment
object
Electromagnetic source assignment, returned as an
ElectromagneticSourceAssignment
object. For more information, see
ElectromagneticSourceAssignment Properties.
Version History
Introduced in R2021a
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)