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

Home » Public Forums » archive » vectorized RK4
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
vectorized RK4 [message #51281] Thu, 09 November 2006 09:17 Go to next message
news.qwest.net is currently offline  news.qwest.net
Messages: 137
Registered: September 2005
Senior Member
I'm looking at a problem where we have to calculate
a Runge Kutta solution for a number of particles.

From some reading I did, I thought I could vectorize
the RK4 call over the number of particles.

From the help example, we have the following call,
> RK4(Y, allders, X, H, 'differential',/double)

For a single particle
x = 0.0
y = [4.0,6.0]
allders is a 2 element array
H = 0.5
"differential" is a defined function returns a 2 element array.


So, how does one go about vectorizing this for 1000 particles?
Is that possible?
I cannot just pass in vectors for x and y
(and of course have the appropriate differential function)


Cheers,
bob
Re: vectorized RK4 [message #51538 is a reply to message #51281] Tue, 21 November 2006 09:49 Go to previous message
news.qwest.net is currently offline  news.qwest.net
Messages: 137
Registered: September 2005
Senior Member
"Kenneth Bowman" <k-bowman@tamu.edu> wrote in message
news:k-bowman-EF0484.10504321112006@news-new.tamu.edu...
> In article <45536299$0$498$815e3792@news.qwest.net>,
> Bob,
>
> You may have already solved this, but if not, RK4 is simple enough to code
> yourself. You lose a little flexibility, but you can vectorize across
> particles.
>
> Ken Bowman

Thanks, yeah the problem has been addressed (did it in fortran for
a speed up of approximately infinity, lol). This application was calling
the routine thousands of times, and it was very slow.

Actually I was confused about some posts I found in google groups
saying that one could vectorize across particles, and I had mistakenly
assumed it referred to the rk4 procedure that comes with IDL. So
I had wasted some time fiddling with it, trying to make it accept arrays
and stuff before realizing that the posts must have been referring to a
different
routine. (in fact I think it was an old message of yours that I had seen.)

Thanks for the response!

Cheers,
bob
Re: vectorized RK4 [message #51540 is a reply to message #51281] Tue, 21 November 2006 08:50 Go to previous message
Kenneth Bowman is currently offline  Kenneth Bowman
Messages: 86
Registered: November 2006
Member
In article <45536299$0$498$815e3792@news.qwest.net>,
"R.G. Stockwell" <no@email.please> wrote:

> I'm looking at a problem where we have to calculate
> a Runge Kutta solution for a number of particles.
>
> From some reading I did, I thought I could vectorize
> the RK4 call over the number of particles.
>
> From the help example, we have the following call,
>> RK4(Y, allders, X, H, 'differential',/double)
>
> For a single particle
> x = 0.0
> y = [4.0,6.0]
> allders is a 2 element array
> H = 0.5
> "differential" is a defined function returns a 2 element array.
>
>
> So, how does one go about vectorizing this for 1000 particles?
> Is that possible?
> I cannot just pass in vectors for x and y
> (and of course have the appropriate differential function)
>
>
> Cheers,
> bob

Bob,

You may have already solved this, but if not, RK4 is simple enough to code
yourself. You lose a little flexibility, but you can vectorize across particles.

Ken Bowman
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: open and save a set of image
Next Topic: Re: colour conversion 8 -> 24 bit

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

Current Time: Fri Oct 10 00:16:06 PDT 2025

Total time taken to generate the page: 0.07994 seconds