[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: stable, numerical, maclaurin series of analytic functions
From: |
Przemek Klosowski |
Subject: |
Re: stable, numerical, maclaurin series of analytic functions |
Date: |
Tue, 14 Sep 2010 14:29:30 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Lightning/1.0b2 Thunderbird/3.1.2 |
On 09/14/2010 01:33 PM, Fotios Kasolis wrote:
If i recall correctly that was asked time ago! Given an analytic function
f:R->R you can get an approximation of the coefficients of the maclaurin
polynomial by a function like
...
This will not work for singular functions. For instance, it ll return Nans if
your function is f(x) = 1/(1-x) and garbage if there is a singularity. An
example is
I think this algorithm must have limited convergence radius. Your
example works to around 1:
p = maclaurin (@(x) exp(sin (x)), 10);
x=0:0.01:2;plot (x, exp(sin(x)),x,pv = polyval (p, x))
a plain sin(x) seems to be valid to at least two or so:
p = maclaurin (@(x) (sin (x)), 10);
x=0:0.01:4;plot (x, (sin(x)),x,pv = polyval (p, x))