Home > Archive > Fortran > December 2006 > Computing zero set of function of two variables
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Computing zero set of function of two variables
|
|
|
| Hi,
I am interested to know ways of achieving the following -
Lets say you have a function of two variables (z=z(x,y) )available to
you defined on a "grid" of points (x_i,y_i ), say, uniformly spaced on
the domain
The data may be available to you in the form
x1, y1, z1
x2, y2, z2
......
in an array if it is convenient.
Using the "grid" (note that these are not finite elements, merely
square grid of points), how do you compute the curve(s) that represent
the set of points where z=0 on the domain?
In other words I am looking for routines to compute zero set of
function of two or more variables. Ultimately I want to be able to
"plot" these curves.
Your help will be greatly appreciated.
- Veda.
| |
| Terence 2006-12-11, 7:12 pm |
| This is a three-dimensional system, which at best will have sets of a
two-dimensional surfaces fitting the points within some acceptable
(usually least sum-of-square distnces of points along perpendicuar to
the nearest point on the curve).
You can ask for the best fit of a single surface, but often a set of
non-intersecting surfaces may be a better representation.
There are sevral methods, depending on the treatment desired..
Commercial packages have all of them.
If you need to do it yourself, for plotting, I suggest you look up
"hidden line removal Algorithm" , I think, in proceedings of the ACS in
the early 1980's.. The whole Fortran code was given, which I carefully
typed into my computer and forgot where I put it, some 20 years and
hundreds of backup disks later.
| |
| glen herrmannsfeldt 2006-12-11, 7:12 pm |
| veda wrote:
> Lets say you have a function of two variables (z=z(x,y) )available to
> you defined on a "grid" of points (x_i,y_i ), say, uniformly spaced on
> the domain
(snip)
> Using the "grid" (note that these are not finite elements, merely
> square grid of points), how do you compute the curve(s) that represent
> the set of points where z=0 on the domain?
There are routines to do contour plots. That sounds like what you want.
I believe there is a routine in
http://ftp.riken.go.jp/pub/iris/ugs/ugs.tar.gz
to do it.
-- glen
| |
| Beliavsky 2006-12-11, 7:12 pm |
|
glen herrmannsfeldt wrote:
> veda wrote:
>
>
> (snip)
>
>
> There are routines to do contour plots. That sounds like what you want.
>
> I believe there is a routine in
> http://ftp.riken.go.jp/pub/iris/ugs/ugs.tar.gz
I would call Gnuplot (a good, free, and portable graphing program) from
Fortran using the "system" command (an extension present in most
Fortran compilers) to create contour plots, or on Unix, using
gnuplotfortran http://sourceforge.net/projects/gnuplotfortran .
|
|
|
|
|