Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Contour of a field in a non-rectangular (arbitrary) 2D domain
Replies: 1   Last Post: Feb 23, 2013 7:56 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
ganesh

Posts: 37
Registered: 2/15/06
Contour of a field in a non-rectangular (arbitrary) 2D domain
Posted: Feb 23, 2013 6:23 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have a set of data that looks likes the following:

!Sr.no. x-coord. y-coord potential at (x,y)
1 0.0000 1.0000 0.3508
2 0.7071 0.7071 2.0806
. .... .... ....
. .... .... ....
1000 0.0000 -1.0000 0.5688

I need to generate a 2D contour for the above data where the value of the potential will be plotted at the corresponding (x,y) location on the 2D contour map. Now, this probably is straightforward if the domain is rectangular and the x-y grid for the contour command in Matlab is generated using monotonically increasing x and y values. My problem is that the domain of interest may not always be a rectangle and can have any arbitrary shape. So, the x-y grid can not be generated using the monotonically increasing x and y values. Also since the shape is arbitrary, there is no guarantee that I can always have a parametric representation of the domain.

Thus, the questions are:

1. Is there a way to generate a contour map of a field that is defined over an arbitrary shape in 2D.

2. If yes, then I will also need an efficient algorithm that interpolates the field over an arbitrary shape in order to generate a smooth contour. I am aware of a function (gridfit) by John D'Errico which is capable of doing this.

http://www.mathworks.com/matlabcentral/fileexchange/8998-surface-fitting-using-gridfit

But I could use this only when x and y values are monotonically increasing.

Has anyone encountered a problem like this before?
Thanks in advance for the help.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.