findInitialConditions
Locate active initial conditions
Description
returns the active initial condition assignment ic
= findInitialConditions(ics
,RegionType
,RegionID
)ic
for the
initial conditions in the specified region.
Examples
Find the Active Initial Conditions
This example shows find the active initial conditions for a region.
Create a PDE model that has a few subdomains.
model = createpde(); geometryFromEdges(model,@lshapeg); pdegplot(model,"FaceLabels","on") ylim([-1.1,1.1]) axis equal
Set initial conditions on each pair of regions.
setInitialConditions(model,12,"Face",[1,2]); setInitialConditions(model,13,"Face",[1,3]); setInitialConditions(model,23,"Face",[2,3]);
Check the initial conditions specification for region 1.
ics = model.InitialConditions;
ic = findInitialConditions(ics,"Face",1)
ic = GeometricInitialConditions with properties: RegionType: 'face' RegionID: [1 3] InitialValue: 13 InitialDerivative: []
Input Arguments
ics
— Model initial conditions
InitialConditions
property of a PDE model
Model initial conditions, specified as the
InitialConditions
property of a PDE model. Initial
conditions can be complex numbers.
Example: model.InitialConditions
RegionType
— Geometric region type
"Edge"
for a 2-D model | "Face"
for a 2-D model or 3-D model | "Cell"
for a 3-D model
Geometric region type, specified as "Edge"
for a 2-D
model, "Face"
for a 2-D model or 3-D model, or
"Cell"
for a 3-D model.
Example: ca =
findInitialConditions(ics,"Face",[1,3])
Data Types: char
| string
RegionID
— Region ID
vector of positive integers
Region ID, specified as a vector of positive integers. View the subdomain
labels for a 2-D model using
pdegplot(model,"FaceLabels","on")
. Currently, there
are no subdomains for 3-D models, so the only acceptable value for a 3-D
model is 1
.
Example: ca =
findInitialConditions(ics,"Face",[1,3])
Data Types: double
Output Arguments
ic
— Initial condition assignment
GeometricInitialConditions
object | NodalInitialConditions
object
Initial condition assignment, returned as a GeometricInitialConditions Properties or NodalInitialConditions Properties object.
Version History
Introduced in R2016a
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)