Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 70896D2B0 for ; Wed, 22 May 2013 11:53:14 +0000 (UTC) Received: (qmail 57079 invoked by uid 500); 22 May 2013 11:53:14 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 56486 invoked by uid 500); 22 May 2013 11:53:11 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 56445 invoked by uid 99); 22 May 2013 11:53:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 May 2013 11:53:10 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [130.149.7.33] (HELO mail.tu-berlin.de) (130.149.7.33) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 May 2013 11:53:04 +0000 X-tubIT-Incoming-IP: 130.149.172.228 Received: from brego.uebb.tu-berlin.de ([130.149.172.228]) by mail.tu-berlin.de (exim-4.72/mailfrontend-5) with esmtpa for id 1Uf7b0-0006KK-8o; Wed, 22 May 2013 13:52:43 +0200 Message-ID: <519CB18A.6010001@tu-berlin.de> Date: Wed, 22 May 2013 13:52:42 +0200 From: =?UTF-8?B?Q2hyaXN0b3BoIEjDtmdlcg==?= Organization: Technische =?UTF-8?B?VW5pdmVyc2l0w6R0IEJlcmxpbg==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: user@commons.apache.org Subject: [math] Total derivative of a MultivariateVectorFunction Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Dear all, I am currently working with the DerivativeStructure-based AD framework integrated into math 3.2. Calculating the n-th order partial derivatives works fine, but I am facing some trouble calculating the n-th order total derivative of a MultivariateVectorFunction. My Idea was to have a class Derivative (implementing MultivariateVectorFunction) that delegates to its base MultivariateVectorFunction and returns the first order total derivative of that function. Chaining many such classes should create the n-th order total derivative (direct creation would be an optimization). The class looks like this: public final class Derivative implements MultivariateDifferentiableFunction { private final MultivariateDifferentiableFunction base; @Override public double value(double[] point) { final int dim = 1 + point.length / 2; final DerivativeStructure[] dpoint = new DerivativeStructure[dim]; for (int i = 0; i < dim; i++) dpoint[i] = new DerivativeStructure(dim, 1, i, point[i]); final double[] dvalue = base.value(dpoint).getAllDerivatives(); double ret = dvalue[0]; // 𝛿base/𝛿t for (int i = 1; i < dvalue.length; i++) ret = dvalue[i] * point[i + dim]; // 𝛿base/𝛿point[i] * // dpoint[i]/dt return ret; } @Override public DerivativeStructure value(DerivativeStructure[] point) throws MathIllegalArgumentException { //?? return null; } } As you can see, the Derivative takes _more_ parameters than the base function. Those additional parameters are the total derivatives of the original parameters. The first parameter is the independent variable. This function is highly regular, and I can probably just calculate the partial derivatives directly: The partial derivative of a parameter from 1 to (dim-1) is the second order partial derivative of that parameter in base. The partial derivative of a parameter from dim upwards is the corresponding partial derivative of base. My problem is: What shall I do with the DerivativeStructure[] point I am handed from the outside? How to get them into the equation? -- Christoph Höger Technische Universität Berlin Fakultät IV - Elektrotechnik und Informatik Übersetzerbau und Programmiersprachen Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin Tel.: +49 (30) 314-24890 E-Mail: christoph.hoeger@tu-berlin.de --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org