How to set initial condition on a particular edge for pde?

Answers (1)

Alan Weiss
MATLAB mathematical toolbox documentation

2 Comments

I saw this documentation already. It has the initial condition at mesh nodes but not at edges.
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

Sign in to comment.

Asked:

on 8 Feb 2016

Commented:

on 9 Feb 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!