Approximating sin13 with Taylor Series using TI84 (n=150)

In summary: To save space, I didn't print the terms, but just accumulated the sum. However, your calculator's manual may be clearer and more user-friendly.In summary, the conversation discusses using the Taylor series to approximate sin13 using a TI84 calculator. The suggested approach is to use Horner's scheme to evaluate the polynomial and to use a for loop to count down. The result can be achieved with a TI-86 calculator by using a for loop and accumulating the sum.
  • #1
kakashi1027
8
0

Homework Statement


approximate sin13 by using the Taylor series using the TI84.
Add for n=150


Homework Equations


the infinite sums for sinx is ((-1)^n)(x^(2n+1)/(2n+1)!)



The Attempt at a Solution


I'm new to programming so i don't have any idea on where to start.
I was thinking about using the For(n,0) command, but I have no idea on how to bypass the overflow error since at n=150, it is 301!, which I'm pretty sure the calc won't do.
 
Physics news on Phys.org
  • #2
I assume that is 13 radians, since 13° should only take a few terms of the Taylor series for sin(13°).

The Taylor Polynomial you need to use is a 301 degree polynomial with 150 non-zero terms.

Use Horner's scheme (see http://en.wikipedia.org/wiki/Horner_scheme" ) to evaluate the polynomial starting at the highest degree term in a "nested" fashion. There will be no need to use an exponential (except for (-1)n) and no need to use the factorial function.

As an example of this, consider the Polynomial: [tex]P(x)=4+3x-7x^2+7x^3-5x^4+9x^5-2x^6[/tex]

Factor x5out of the two highest degree terms: [tex]P(x)=4+3x-7x^2+7x^3-5x^4+x^5(9-2x)[/tex]

Now factor x4 out of the last two "trems": [tex]P(x)=4+3x-7x^2+7x^3+x^4(-5+x(9-2x))[/tex]

Continuing: [tex]P(x)=4+3x-7x^2+x^3(7+x(-5+x(9-2x)))[/tex]

etc, until you get: [tex]P(x)=4+x(3+x(-7+x(7+x(-5+x(9-2x)))))[/tex]

Now, to see how this works: Try to calculate P(5) without a calculator. Not too easy with the standard form of P(x)

[tex]P(5)=4+3(5)-7(5)^2+7(5)^3-5(5)^4+9(5)^5-2(5)^6[/tex]

Now try this (from the inside out): [tex] P(5)=4+5(3+5(-7+5(7+5(-5+5(9-2\cdot5)))))[/tex]

9-2(5)=-1, then -5+5(-1)=-10, then 7+5(-10)=-43, then -7+5(-43)=-7-215=-222, (well that is a bit much), then 3+5(-222)=3-1110=-1107, then 4+5(-1107)=4-5535=-5531

Look at the 4 highest degree terms of the Taylor Polynomial you want to evaluate:

[tex]\sin(x)\approx \dots\,+\,\frac{(-1)^{147}\,x^{295}}{295!}\,+\,\frac{(-1)^{148}\,x^{297}}{297!}\,+\,\frac{(-1)^{149}\,x^{299}}{299!}\,+\,\frac{(-1)^{150}\,x^{301}}{301!}[/tex]

[tex]\sin(x)\approx \dots\,+\,\frac{(-1)^{147}\,x^2}{294\cdot295}\left(1\,+\,\frac{(-1)^{148}\,x^2}{296\cdot297}\left(1\,+\,\frac{(-1)^{149}\,x^2}{298\cdot299}\left(1\,+\,\frac{(-1)^{150}\,x^2}{300\cdot301}\right)\right)\right)[/tex]

Of course x=13.

Programming my not be all that easy if you haven't done any.
 
Last edited by a moderator:
  • #3
SammyS said:
..
Look at the 4 highest degree terms of the Taylor Polynomial you want to evaluate:

[tex]\sin(x)\approx \dots\,+\,\frac{(-1)^{147}\,x^{295}}{295!}\,+\,\frac{(-1)^{148}\,x^{297}}{297!}\,+\,\frac{(-1)^{149}\,x^{299}}{299!}\,+\,\frac{(-1)^{150}\,x^{301}}{301!}[/tex]

There is a error in the next line:

[tex]\sin(x)\approx \dots\,+\,\frac{(-1)^{147}\,x^2}{294\cdot295}\left(1\,+\,\frac{(-1)^{148}\,x^2}{296\cdot297}\left(1\,+\,\frac{(-1)^{149}\,x^2}{298\cdot299}\left(1\,+\,\frac{(-1)^{150}\,x^2}{300\cdot301}\right)\right)\right)[/tex]
Starting with: [tex]\sin(x)\approx \dots\,+\,\frac{(-1)^{147}\,x^{295}}{295!}\,+\,\frac{(-1)^{148}\,x^{297}}{297!}\,+\,\frac{(-1)^{149}\,x^{299}}{299!}\,+\,\frac{(-1)^{150}\,x^{301}}{301!}[/tex]

[tex]\sin(x)\approx \dots\,+\,\frac{(-1)^{147}\,x^{295}}{295!}\,+\,\frac{(-1)^{148}\,x^{297}}{297!}\,+\,\frac{(-1)^{149}\,x^{299}}{299!}\left(1\,+\,\frac{(-1)\,x^2}{(300)(301)}\right)[/tex]

[tex]\sin(x)\approx \dots\,+\,\frac{(-1)^{147}\,x^{295}}{295!}\left(1\,+\,\frac{(-1)\,x^2}{296\cdot297}\left(1\,+\,\frac{(-1)\,x^2}{298\cdot299}\left(1\,+\,\frac{(-1)\,x^2}{300\cdot301}\right)\right)\right)[/tex]

Getting the degree 1 term is a little tricky.

[tex]\sin(x)\approx x\,\left(1+\,\frac{(-1)\,x^{2}}{2\cdot3}\left(\dots\,\left(1\,+\,\frac{(-1)\,x^2}{296\cdot297}\left(1\,+\,\frac{(-1)\,x^2}{298\cdot299}\left(1\,+\,\frac{(-1)\,x^2}{300\cdot301}\right)\right)\right)\dots\right)\right)[/tex]

But I have been having trouble getting calculator program to give good results.

Note added in edit:

I got it to work!

The result agrees with the calculator's value of sin(13) to the 8th decimal place.
 
Last edited:
  • #4
hi, thanks for the responce!
what was your code that you used on the calculator? did you use the for loop?
 
  • #5
Yes, I used a "For loop".

I have a TI-86, which is an older model than a TI-84. The manual's description of the "For loop" made me skeptical of its ability to count down, so used For(I,0,N-1) , then computed N-I → J, and used J as my index.
 

FAQ: Approximating sin13 with Taylor Series using TI84 (n=150)

What is a Taylor Series Program?

A Taylor Series Program is a mathematical algorithm used to approximate a function as an infinite polynomial. It is named after mathematician Brook Taylor and is commonly used in calculus and numerical analysis.

How does a Taylor Series Program work?

A Taylor Series Program works by using a known function or set of data points to create a polynomial approximation. The program calculates the derivatives of the function at a specific point, and then uses those values to create a polynomial that closely resembles the original function.

What are the benefits of using a Taylor Series Program?

A Taylor Series Program can be used to approximate complex functions with a high degree of accuracy. It can also be used to calculate derivatives and integrals of a function, which can be useful for solving equations and analyzing data.

Are there any limitations to using a Taylor Series Program?

One limitation of using a Taylor Series Program is that it can only approximate a function within a certain interval. If the function has discontinuities or is undefined outside of this interval, the approximation may not be accurate. Additionally, the accuracy of the approximation depends on the number of terms used in the polynomial, so it may not be completely precise.

How can a Taylor Series Program be applied in real-world situations?

A Taylor Series Program has many practical applications, such as in physics, engineering, and economics. It can be used to model and predict the behavior of systems, such as in financial forecasting or predicting the motion of objects. It can also be used to design and optimize systems, such as in control systems or circuit design.

Similar threads

Replies
5
Views
2K
Replies
11
Views
2K
Replies
6
Views
4K
Replies
2
Views
2K
Replies
3
Views
1K
Replies
2
Views
1K
Replies
1
Views
1K
Replies
4
Views
1K
Back
Top