How to set initial condition on a particular edge for pde?
2 views (last 30 days)
Show older comments
I need to set initial condition on a particular edge for my pde.
0 Comments
Answers (1)
Alan Weiss
on 8 Feb 2016
2 Comments
Alan Weiss
on 9 Feb 2016
If you have a parabolic or hyperbolic type equation, then you need to set initial conditions everywhere, meaning at all nodes. To set the initial conditions differently at the nodes of a particular edge, say edge 3, first find out the nodes that are on edge 3:
edge3 = e(5,:) == 3;
Then find the first and second nodes on these edges (this might not be the most efficient way to do this, it is just the first way that occurred to me):
pindices1 = e(1,edge3);
pindices2 = e(2,edge3);
pindices = union(pindices1,pindices2)
You now have all the nodes that comprise the edge. Set your initial conditions using this information.
Alan Weiss
MATLAB mathematical toolbox documentation
See Also
Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!