15C Nth Degree Polynomial Program

12032019, 01:42 AM
(This post was last modified: 12032020 02:10 AM by 15lennyphelan.)
Post: #1




15C Nth Degree Polynomial Program
Hello all, this program calculates a y value for any degree polynomial (between 1 and 56 theoretically, or more with a memory expansion) given an x value and matrix A containing the coefficients of the expression. This is useful for using the SOLVE and ∫yx functions, and for using Linear regression to plot secant lines. The program uses Horner's Method, which is outlined on pg. 79 of the latest 15c manual. Unfortunately, this program completely obliterates the stack so don't put anything important in there!
If you're keying this program in manually; be mindful of the USER mode instructions. A handy trick for keying the program in at some location other than 000 is to add however many R/S instructions is necessary to make the line number a multiple of 10, making it much easier to compare line numbers and ensure accurate entry. Once finished (leave them in until after a test run) you may optionally execute GTO A in run mode followed by a BST in program mode to easily position the cursor on the extraneous instructions for removal. Usage
Code:
if you're using this 15c emulator and a DM15, you can simply copy this code asis into a .15c file and upload it. Hope you enjoy!! 

12032019, 06:08 AM
Post: #2




RE: 15C Nth Degree Polynomial Program
15lennyphelan
Can you provide some example from this program? Thank You Gamo 

12032019, 09:51 PM
(This post was last modified: 12032020 02:05 AM by 15lennyphelan.)
Post: #3




RE: 15C Nth Degree Polynomial Program
(12032019 06:08 AM)Gamo Wrote: 15lennyphelan No problem. Suppose I have the function f(x)=16x^54x^4+8x^24x9 and I want to find ∫f(x)dx from 1 to 7 The coefficients of this polynomial in order of descending significance are 16, 4, 0, 8, 4, and 9 (notice there are six of them) I'm going to put the calc in user mode, execute f MATRIX 1, and dimension matrix A to 1x6 with 1, ENTER, 6, f DIM A, then load the coefficients into the matrix by typing 16 STO A, 4 CHS STO A, ... so on. As you're storing the constant term, the calc should display [A 1,6] as you're holding the button. Then I simply type 1, ENTER, 7, f ∫yx A. Sit back and relax for a minute. Mathematica tells me the answer is 301045.2, and with exact precision, so does my 15c! 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)