The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

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:

! 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.

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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.