Path: news.mathworks.com!not-for-mail
From: Alan Weiss <aweiss@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to take 200th order derivative, and then evaluate it numerically?
Date: Wed, 18 Mar 2009 12:57:02 -0400
Organization: The MathWorks, Inc.
Lines: 53
Message-ID: <gpr94v$hjo$1@fred.mathworks.com>
References: <f6ebcf2b-4782-4984-aebc-7cdb5b28ccee@p2g2000prf.googlegroups.com>
NNTP-Posting-Host: weissa.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1237395423 18040 172.31.57.119 (18 Mar 2009 16:57:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 18 Mar 2009 16:57:03 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
In-Reply-To: <f6ebcf2b-4782-4984-aebc-7cdb5b28ccee@p2g2000prf.googlegroups.com>
Xref: news.mathworks.com comp.soft-sys.matlab:525915


I don't know if this would complete in a reasonable amount of time on a 
complicated example, but I tried in the Symbolic Math Toolbox:
syms x
y = exp(2*x);
z = diff(y,200)
In less than a second I got the answer:
z =
1606938044258990275541962092341162602522202993782792835301376*exp(2*x)

The Symbolic Math Toolbox is not free, but if you have access to it, why 
not give it a try on a more complicated example?

Alan Weiss
MATLAB mathematical toolbox documentation

excellentfeng@gmail.com wrote:
> Hi all,
> 
> We need to take the 200th order derivative of a complicated formula,
> and then evaluate it numerically.
> 
> What's the best way to handle this?
> 
> More specifically, we figured that it's impossible to do this via
> finite difference, i.e. do everything completely in the numerical
> domain, because the noise will be huge and error will dominate.
> 
> So a plan was to first obtain the 200th order derivative thru symbolic
> calculation in Maple, Matlab, Mathematica, and then copy the huge
> result and somehow make it into a form that is numerically evaluable
> either in Matlab or C++. Then evaluate that huge expression
> numerically. Still, that sounds daunting, the symbolic result of 200th
> order derivative will be huge and we are not sure if Maple or
> Mathematica can handle it.
> 
> Another possibility is to do some sort of Automatic Differentiation.
> But we are new to AD. Is it possible that with the help from an AD
> package, we just need to give inputs of the parameter values, and the
> package will crank out the numerical result of the 200th order
> derivative with almost no error?
> 
> We see that lots of free packages are in C/C++ or Fortune, which are
> not convenient for fast prototyping(we are at evaluating stage, if
> this idea doesn't work, we don't want to spend too much time on it).
> So are there free AD packages that can go with Matlab or Mathematica
> or Maple that can take 200th order differentiation and are convenient
> for prototyping? Which one is the best AD package that we could try
> on? If it doesn't work, then we would discard this crazy idea of
> taking 200th order derivative completely.
> 
> Please shed some lights on us!
> 
> Thanks a lot!