Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 84814 invoked from network); 12 Apr 2011 19:29:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Apr 2011 19:29:38 -0000 Received: (qmail 77375 invoked by uid 500); 12 Apr 2011 19:29:38 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 77144 invoked by uid 500); 12 Apr 2011 19:29:38 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 77136 invoked by uid 99); 12 Apr 2011 19:29:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2011 19:29:38 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of phil.steitz@gmail.com designates 209.85.212.179 as permitted sender) Received: from [209.85.212.179] (HELO mail-px0-f179.google.com) (209.85.212.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2011 19:29:30 +0000 Received: by pxi2 with SMTP id 2so3577959pxi.38 for ; Tue, 12 Apr 2011 12:29:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=DyatHs+V1WWYJA0byEXXNF5hYpHkM4OtLV7sxpRHooc=; b=b7FAX9A0AwPefNl2XmvUMO6qlfLeMmJSEJbbrMYaG8WNBw4/mCr7x4/L8Lm+Q5jdg2 pD8J70J6Y7TUvh976aHS8VpbSu0fCrhDT0vGpztGZJcMerSGkW80Tro5cU3l28rLifJZ /NbHR5gst7qXNkd/bFENWFYvlAtiy/nfJI05Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=Y6lkQpKhPwzT+jJz7KuXh4C949xlC8yoaSTAE534JNvM6lBTSZPodzAV9cNASmwQPH p2EKUR7jQXdEYSUhts0/MIhJkAnIYbiT5vprMo7nQBGYmPG6PIIOZSLytaiDOH2XKvUq H86zPCJ2/UBoffdQG9LQk7S76O3O6SuscX5Xk= Received: by 10.142.177.14 with SMTP id z14mr6720358wfe.234.1302636550442; Tue, 12 Apr 2011 12:29:10 -0700 (PDT) Received: from a.local (66-17-91-138-azulbell101llc.sap.phx.sparkplugbb.net [66.17.91.138]) by mx.google.com with ESMTPS id o1sm10061085wfl.9.2011.04.12.12.29.08 (version=SSLv3 cipher=OTHER); Tue, 12 Apr 2011 12:29:09 -0700 (PDT) Message-ID: <4DA4A7FE.5030702@gmail.com> Date: Tue, 12 Apr 2011 12:29:02 -0700 From: Phil Steitz User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Commons Developers List Subject: Re: [math] resetting relative and absolute tolerances in ODE adaptive step size integrators References: <379411337.1755041302622016003.JavaMail.root@spooler6-g27.priv.proxad.net> <4DA47985.3070903@gmail.com> <4DA498C5.5010401@free.fr> In-Reply-To: <4DA498C5.5010401@free.fr> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 4/12/11 11:24 AM, Luc Maisonobe wrote: > Le 12/04/2011 18:10, Phil Steitz a écrit : >> On 4/12/11 8:26 AM, luc.maisonobe@free.fr wrote: >>> Hi Phil, >>> >>> ----- "Phil Steitz" a écrit : >>> >>>> On 4/12/11 1:51 AM, luc.maisonobe@free.fr wrote: >>>>> Hi all, >>>>> >>>>> I have hit a limitation of the current implementation of ODE >>>> integrators with adaptive step size. For now, the tolerances that are >>>> used to adjust the step size are specified only at construction time >>>> and cannot be changed afterwards. However, these tolerances are highly >>>> problem-dependent and in fact the dimension of the problem (which is >>>> related to the dimension of the vectorial version of the tolerances) >>>> is specified only at integration time, not at construction time. >>>>> So I consider adding at the top-level hierarchy (abstract class >>>> AdaptiveStepsizeIntegrator) a few setters to allow users to change >>>> these tolerances after the integrator has been built. It seems the >>>> integrators by themselves were not documented as immutable (I first >>>> thought they were), so this change is probably harmless. >>>>> I am going to open a Jira issue for this. >>>>> >>>>> Any thoughts ? >>>> One natural thing to consider is to provide the tolerances at >>>> integration time - i.e., to either add the vectors explicitly as >>>> arguments to the integrate method or to create an ODEProblem or >>>> better-named class that encapsulates the DE, tolerances, initial >>>> values and time parameters. >>> No, it would break the interface that is shared with fixed step size integrators. >>> Preserving the compatibility with both types of integrators is very important. This >>> is the same reason why step size is not set at integration time for fixed step integrator. >> Got it. What about putting the specialization in the Problem class >> rather than in the integrators? So the fixed step integrator gets a >> specialized integration problem rather than exposing problem >> parameters itself? Would something like that be possible? > I'm not sure I understand well but it seems impossible to me. Both the > integrators and the problems should be generic. There are several > integrators implementations, and we provide them (I don't think any > users did put their own integrators, despite it is theoretically > possible). There are many problems implementations, as they are > user-specific. For each user problem, the user may choose several > different integrators mainly to compare the results, or choose between a > fast one and an accurate one, or for validation purposes with existing > reference solutions (the last case is the one I am more concerned with). > > Basically, a classical code architecture is to have on one side some > kind of factory with cases devoted to specific integrators or integrator > categories but without any hint about the problem, and on the other side > the problem definition that does know much about the integrator that has > been set up by the factory. Resetting the tolerance for the global > adaptive stepsize integrators category should lie somewhere between > these two pieces of code, quite close to the problem definition. Yes, that is what I was thinking. May not be practical or possible, but my intuition was that introducing an ODEProblem abstraction might allow for this, with specializations allowed to include different parameters for different types of integrators. > My exact use case is that the user has already built the integrator, and > when he feeds the problem, he has to reset the accuracy to take into > account some specific properties of the problem. Which is why it seemed natural to me to make that information part of the problem. > However, since the > integrator has already been built, he has no access to the tolerances > arrays anymore. An even worse problem occurs when the user wants to > append some additional equations to his problem, so instead of having > only a dimension 7 state vector, he suddenly needs a dimension 56 > vector, to hold both his original state vector but also a 7x7 jacobian > matrix. The size of the original tolerances do not match and the > integrator has to be completely rebuilt, which force the user to know > how it was built and how it was configured to repeat all these steps. > Adding setters for the tolerance would greatly simplify this. If the ODEProblem abstraction could work, then this would be a modification to the problem, requiring no mutation of the Integrator itself. Phil > Luc > >> Phil >>> Luc >>> >>>> Phil >>>>> Luc >>>>> >>>>> >>>> --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>>>> For additional commands, e-mail: dev-help@commons.apache.org >>>>> >>>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>>> For additional commands, e-mail: dev-help@commons.apache.org >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>> For additional commands, e-mail: dev-help@commons.apache.org >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >> For additional commands, e-mail: dev-help@commons.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org