From: Patrick Alken <patrick.alken@Colorado.EDU>
To: gsl-discuss@sourceware.org
Subject: Re: odeiv2 request
Date: Sun, 04 Mar 2012 07:26:00 -0000 [thread overview]
Message-ID: <4F531931.7060702@colorado.edu> (raw)
In-Reply-To: <CAHjYNoZVgOBE0G7-f2+C0tB=tizrJ5bLsy6vn-45FsNXW4AYGg@mail.gmail.com>
Well, I had a PDE which reduced to a set of ODEs via the method of
characteristics. I wanted to know the solution on a fixed grid, so for a
given grid point, I would integrate along the characteristic curve to
the boundary, and then use the boundary condition as the initial
condition to integrate backwards to the original grid point where I
wanted to find the solution. Changing the sign of driver->h worked very
nicely but it would be best to make a function to do this, and check
that its less than hmax, etc.
As a side note, does the _reset function reset the step size back to the
original hstart value given to the alloc routines? A quick glances
indicates that it doesn't. Does this mean that when you start a new
integration, it begins with the last step size from the previous
integration?
Also I was using driver_apply for both integrations. I kept a tight
tolerance on hmax to make sure it didn't go too far past the boundary or
too far past the original point.
Patrick
On 03/04/2012 12:02 AM, Tuomo Keskitalo wrote:
> Hello,
>
> that's an interesting use case. May I ask why you needed to integrate
> backwards? Did you use driver_apply for integration?
>
> I haven't really considered anyone "hotswapping" the direction of
> integration using driver functions.. I think that the stepper at least
> must be reset if integration direction is changed, to be safe with
> multistep methods. This needs some thinking and testing. I can try to
> see to this in a week or few.
>
> Tuomo
>
> On Fri, Mar 2, 2012 at 6:13 PM, Patrick Alken
> <patrick.alken@colorado.edu> wrote:
>> I had a problem recently where I needed to integrate forward along a curve
>> (positive step size h) and then integrate backward again (negative h). But
>> there is currently no way to change the sign of the step size h using the
>> driver routines, so I had to modify driver->h directly.
>>
>> I propose adding a routine gsl_odeiv2_driver_set_h() to allow the user to
>> reset the step size to what they want. Tuomo: do you see any negative issues
>> with this? I can make the addition if you want.
>>
>> Thanks,
>> Patrick
>
>
next prev parent reply other threads:[~2012-03-04 7:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-02 16:14 Patrick Alken
2012-03-04 7:02 ` Tuomo Keskitalo
2012-03-04 7:26 ` Patrick Alken [this message]
2012-03-11 8:33 ` Tuomo Keskitalo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F531931.7060702@colorado.edu \
--to=patrick.alken@colorado.edu \
--cc=gsl-discuss@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).