Search All of the Math Forum:

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

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

Topic: Compiling Runge-kutta
Replies: 4   Last Post: Mar 28, 2012 1:35 AM

 Messages: [ Previous | Next ]
 Oliver Ruebenkoenig Posts: 237 Registered: 6/28/08
Re: Compiling Runge-kutta
Posted: Mar 23, 2012 2:32 AM

Joao,

it's hard to say what the issue is without seeing the code. I suspect you
complete and easy to copy and past.

Oliver

On Tue, 20 Mar 2012, Joao wrote:

> Hi there, I've been going through this thread (Vector Runge-Kutta ODE solver with compilation?) and I would like to know if anyone could give me an opinion on the problem I have.
>
> Basically I am using the same runge-kutta 4 taken from Jason Cantarella's page than Dmitry was, but I am using the NestList version.
>
> I really need to speed up this algorithm. When I did one of the examples you provided on this thread, the compiled version solved it at a duration of 7% of the non compiled version which was pretty cool.
>
> My problem was that when I tried to use it on the work I'm doing the compiled and non compiled versions took the same time. My guess is that the compiled version wasn't able to compute and it returned to the non-compiled version.
>
> At this moment I don't know if I'm doing something wrong or if the nature of the RHS of the functions I'm using prevents the compiled algorithm to work in a proper way.
>
> I can send the code if necessary.
>
> Nevertheless, I may advance that my RHS is a system of 6 ODE (hamiltonian), these ODE call other functions (controls). These last functions (controls) are coded in a module box. Inside that box are some implicit functions in R1 (hence a newton algorithm is called) and there is also a switch - if a given condition is above a threshold the control box assumes one form, bellow that threshold another form is assumed. After all these calculations inside the control box it returns simply a vector of order 3.
>
> I would appreciate any help. At the moment I do not know if this is feasible with Compile or not. Maybe I have to put all this different boxes inside a compile?
>
>
> Joao Pereira
>
>

Date Subject Author
3/21/12 Murray Eisenberg
3/23/12 Oliver Ruebenkoenig
3/26/12 Joao Pereira
3/28/12 Dr. Peter Klamser