The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

[WP 34s] Taylor Series expansion
Message #1 Posted by Valentin Albillo on 17 Jan 2013, 6:44 a.m.

Hi all, Happy New Year 2013 and all that !

Just out of sheer curiosity (though I guess the answer is "no"): Does the comprehensive WP 34s's instruction set include some function or utility to return the coefficients of the Taylor Series expansion of a given function at a given point, either symbolically or numerically ?

It seems that most (all ?) RPL models can deliver and wondered if the WP 34s currently does as well or whether it's been considered for eventual inclusion in the (near ?) future.

Best regards from V.

      
Re: [WP 34s] Taylor Series expansion
Message #2 Posted by Walter B on 17 Jan 2013, 7:04 a.m.,
in response to message #1 by Valentin Albillo

Buenas dias Valentin y Bueno Anno Novo etc.

Please note the WP 34S is not RPL but pure traditional RPN. There is and will be no symbolic computation on it, I'm afraid (actually, I don't know whether I shall be afraid, but anyway ...). Also I don't see any numeric Taylor series expansion on it though it may be programmable.

With respect to the future on another platform ;-) this topic was not discussed yet.

d:-)

            
Re: [WP 34s] Taylor Series expansion
Message #3 Posted by Valentin Albillo on 17 Jan 2013, 9:39 a.m.,
in response to message #2 by Walter B

Guten Tag, Walter, und Ein glückliches neues Jahr!

Quote:
Please note the WP 34S is not RPL but pure traditional RPN.

Yes, fortunately indeed, it surely is the WP 34S's greatest feature.

Quote:
There is and will be no symbolic computation on it, I'm afraid (actually, I don't know whether I shall be afraid, but anyway ...).

I concur, no great loss. Symbolic computations are pretty much out of scope for this particular project.

Quote:
Also I don't see any numeric Taylor series expansion on it though it may be programmable.

Yes, it certainly is. I was asking because I know that RPL models can, and such series expansions do have a number of interesting uses, possibly surpassing those of other "exotic" features which actually made it into the instruction set.

But no great loss either, interested users can surely implement such expansions efficiently enough using the powerful capabilities currently available. For testing purposes you might want to consider finding the coefficients (up to the x7 term, say) of this one:

  • Taylor Series expansion of y = sin(x + cos(x)) at x = Pi/2

and see what you get. Thanks a lot for your kind and prompt reply and

Best regards from V.

                  
Re: [WP 34s] Taylor Series expansion
Message #4 Posted by Thomas Klemm on 20 Jan 2013, 3:17 p.m.,
in response to message #3 by Valentin Albillo

Quote:
Taylor Series expansion of y = sin(x + cos(x)) at x = Pi/2 (up to the x7 term, say)

While it's easy to get the result with a calculator that is able to perform symbolic differentiation I'm trying to show that this isn't needed. The arrays contain the first coefficients of the Taylor Series at x = Pi/2.

x = [Pi/2, 1, 0, 0, 0, 0, 0, 0]
cos x = [0, -1, 0, 1/6, 0, -1/120, 0, 1/5040]
Thus:
u = x + cos x = [Pi/2, 0, 0, 1/6, 0, -1/120, 0, 1/5040]

sin u = [1, 0, -1/2, 0, 1/24, 0, -1/720, 0]

v = u - Pi/2 = [0, 0, 0, 1/6, 0, -1/120, 0, 1/5040] v2 = [0, 0, 0, 0, 0, 0, 1/36, 0, -1/360]

We only have to take the 2nd coefficient (-1/2) of sin u into consideration, since v4 is O(x12) already.

So we end up with: sin(x + cos x) = 1 - v2/2 + ... = 1 - (x - Pi/2)6/72 + (x - Pi/2)8/720 + ...

All we need are operations that interpret an array correctly as a Taylor Series. This shouldn't be too difficult to implement. Though I have no idea whether this would be possible within the WP-34s project, it's far from symbolic differentiation. Maybe as an idea for a follow-up project then?

Kind regards
Thomas

Edited: 21 Jan 2013, 2:36 a.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall