public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Tuomo Keskitalo <Tuomo.Keskitalo@iki.fi>
To: "Kevin H. Hobbs" <hobbsk@ohiou.edu>
Cc: gsl-discuss@sourceware.org, help-gsl@gnu.org
Subject: Re: ODE IV Control and Variable Scale
Date: Sat, 20 Mar 2010 19:18:00 -0000	[thread overview]
Message-ID: <4BA51F85.4070305@iki.fi> (raw)
In-Reply-To: <4BA2707F.50105@ohiou.edu>

Hi,

about ODE solver error tolerances: you _never_ want to set eps_rel to 
zero. It would mean that you allow no error for the ODE solver, which is 
something no numerical method can give you.

As an example: gsl_odeiv_control_y_new (1e-12, 1e-8) means that if the 
absolute value of a variable drops below 1e-12, you don't really care of 
it's value any more (it is essentially zero for you). eps_rel = 1e-8 
means that you want at least 7 decimals of each variable to be accurate 
on each ODE solver step. If you need to control the level of error with 
more detail, then you can use a_y, a_dydt and scale_abs.

A practical way to choose tolerances is to make a test and compare 
results calculated with "strict" and "loose" eps_abs and eps_rel (order 
of magnitude difference between strict and loose). If you get nearly 
same values as result, you are probably safe to use your loose 
tolerances. Of course, this depends on your problem, so be sure to test 
it with your final computation case again.

If you are not interested in optimizing the performance, I'd suggest you 
simply try to use control_y_new and see how it works for you.

Regards,
Tuomo

On 03/18/2010 08:27 PM, Kevin H. Hobbs wrote:

> I'm trying make sure that I am using the gsl_odeiv_control functions
> correctly.
> 
> I'm modelling neurons and my variables have different scales. Voltage is
> usually between -100 and 50 mV. The membrane current gating variables
> stay between 0 and 1. Internal calcium concentration is usually between
> 0 and a few hundred micro molar.
> 
> Each time I read the descriptions of the gsl_odeiv_control functions I
> become more convinced that the parameters eps_rel, a_y, and a_dydt are
> there to excuse some error in variables and derivatives that are far
> from zero. Is that correct?
> 
> Since I have no reason to care more about values close to zero (unless I
> do some complicated remapping of the variable values) should I set
> eps_rel, a_y, and a_dydt to 0?
> 
> Since my variables have different ranges should I use
> gsl_odeiv_control_scaled_new with an appropriate eps_abs and scale_abs
> set with something like 1 for internal calcium concentration, 0.3 for
> membrane voltage, and 0.001 for all of the gating variables?
> 


-- 
Tuomo.Keskitalo@iki.fi
http://iki.fi/tuomo.keskitalo

  reply	other threads:[~2010-03-20 19:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-18 18:28 Kevin H. Hobbs
2010-03-20 19:18 ` Tuomo Keskitalo [this message]
2010-03-22 14:49   ` Kevin H. Hobbs
2010-03-22 17:26     ` 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=4BA51F85.4070305@iki.fi \
    --to=tuomo.keskitalo@iki.fi \
    --cc=gsl-discuss@sourceware.org \
    --cc=help-gsl@gnu.org \
    --cc=hobbsk@ohiou.edu \
    /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).