comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Is there a simple way to plot field lines?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Is there a simple way to plot field lines? [message #35369] Fri, 30 May 2003 12:02 Go to previous message
jeyadev is currently offline  jeyadev
Messages: 78
Registered: February 1995
Member
In article <d96c8f7c.0305281529.6bd3bc9d@posting.google.com>,
Mirko Vukovic <mvukovic@taz.telusa.com> wrote:
> so@cp.dias.ie (Steve) wrote in message news:<178496d6.0305280522.5db923d4@posting.google.com>...
>> "Mark Hadfield" <m.hadfield@niwa.co.nz> wrote in message news:<bb12df$qan$1@newsreader.mailgate.org>...
>>> "Steve" <so@cp.dias.ie> wrote in message
>>> news:178496d6.0305271647.468088fa@posting.google.com...
>>>> I would like to plot field lines but there coesn't seem to be an
>>>> intrinsic function which can do it. This seems hard to believe, am I
>>>> mistaken?
>>>
>>> What do you mean by "plot field lines". If you have (x,y) coordinates
>>> defining your lines, then PLOT them. Or do you want to plot isolines for a
>>> scalar field? Or lines in 3D space? Or cows walking along lines in fields?
>>
>> Ouch. Well I guess I should have been more explicit to. I mean field
>> lines which are everywhere tangent to a vector field (2d is fine
>> thanks), also known as streamlines for velocity fields. I don't want
>> arrows anywhere. Or cows.

Cows add little of value here, but arrows do!
>
> This seems to me a problem to which there is no magic bullet. What

Very true .... !!

> you seem to be looking for really, is to obtain a function of your
> coordinates, such that contours of that function are the streamlines
> from your data.
>
> Another (more defined) approach would be to set-up a PDE for your
> streamlines, with the right hand side being derived from your data
> (interpolated at the points where the PDE is being solved for)
>
> dx/ds = cos(alpha)
> dy/ds = sin(alpha)
>
> where alpha is the angle of the streamline with respect to x and s is
> the arclength.
>
> Then you would solve the PDE for some starting point, and follow it to
> obtain a streamline. The PDE may be re-cast as on ODE
>
> dx/dy = tan(alpha)
>
> However, this may fail if you have looping streamlines.

This is the way I plot electric field lines, but as you said, it
depends on the geometry and the field. The above method not only
has problems with looping lines (not a problem with electrostatic
fields) but also when the field is "vertical", as tan(alpha)
blows up and so the code should take care to test this and
account for it. This is big problem if the boundary condition is
such that the field is "vertical" at the starting boundary value
of the ODE.

> Summarizing, this is more of a problem of data analysis and number
> crunching than just plotting. But it sure sounds fun!

That is the nub of it. The way I do it is the just get a lot of
(x,y) pairs and then use PV Wave to plot the lines. One particular
issue here is that of constant flux between the lines. Traditional
field line plotting is such the the flux between any pair of lines
is the same, so that the lines come close together where the fields
are high and are far apart where the fields are weak. This aspect
is the trickiest part of the problem. It comes down to finding
points at the boundary from which you want to integrate that are
so placed that the flux between any pair of them is the same.
Determining the starting points of the field lines is a numerical
problem that has to be solved before integrating the ODEs.

I do not know of any generic package that does this.


--

Surendar Jeyadev jeyadev@wrc.xerox.bounceback.com

Remove 'bounceback' for email address
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SOLVED. Re: Function referencing/automatic defintion question.
Next Topic: Re: SOLVED. Re: Function referencing/automatic defintion question.

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:52:43 PDT 2025

Total time taken to generate the page: 0.00428 seconds