findElectromagneticSource
Find electromagnetic source assigned to geometric region
Description
returns the change or current densityemSource
= findElectromagneticSource(emagmodel.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]) axisequal
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);
检查电磁年代ource specification for each face.
findElectromagneticSource(emagmodel.Sources,"Face",1)
ans = ElectromagneticSourceAssignment with properties: RegionType: 'Face' RegionID: 1 ChargeDensity: [] CurrentDensity: 10
findElectromagneticSource(emagmodel.Sources,"Face",2)
ans = ElectromagneticSourceAssignment with properties: RegionType: 'Face' RegionID: 2 ChargeDensity: [] CurrentDensity: 20
findElectromagneticSource(emagmodel.Sources,"Face",3)
ans = ElectromagneticSourceAssignment with properties: RegionType: 'Face' RegionID: 3 ChargeDensity: [] CurrentDensity: 30
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);
检查电磁年代ource specification for each cell.
findElectromagneticSource(emagmodel.Sources,"Cell",1)
ans = ElectromagneticSourceAssignment with properties: RegionType: 'Cell' RegionID: 1 ChargeDensity: 10 CurrentDensity: []
findElectromagneticSource(emagmodel.Sources,"Cell",2)
ans = 0x1 ElectromagneticSourceAssignment array with properties: RegionType RegionID ChargeDensity CurrentDensity
Input Arguments
emagmodel.Sources
—Source in electromagnetic model
Sources
property
Source in an electromagnetic model, specified as theSources
模型的属性。
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 usingpdegplot
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 anElectromagneticSourceAssignment
object. For more information, seeElectromagneticSourceAssignment Properties.
版本历史
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)