(Free42, DM42, HP42S): Polynomial Solver
|
03-14-2022, 01:16 PM
Post: #1
|
|||
|
|||
(Free42, DM42, HP42S): Polynomial Solver
The solver PSOL (pmatsolver.raw) uses a two column matrix PMAT to evaluate and solve for polynomials in the form:
p(x) = a1 * x^b1 + a2 * x^b2 + a3 * x^b3 + ... And PMAT has the matrix in the form of: [ [ a1, b1 ], [ a2, b2 ], [ a3, b3 ] ... ] The PMAT Matrix The solver uses the matrix PMAT. It must first be created in order for the solver to work. Creating PMAT: 1. Enter the number of terms, press [ENTER], type 2, press [(shift)] [ 9 ] (MATRIX), select (NEW). 2. Select (EDIT) from the MATRIX menu. 3. Enter the coefficients and powers. For terms in form of a1, the power is 0. For terms in form of x^b1, the coefficient is 1. 4. Press [EXIT], then [STO], [(shift)] [ENTER] (ALPHA), type PMAT. Editing PMAT: 1. Enter the number of terms, press [ENTER], type 2, press [(shift)] [ 9 ] (MATRIX), select (DIM), select PMAT. 2. From the MATRIX menu, select (EDITN), select PMAT. Be sure to select EDITN (edit named matrix). Running the Solver To run the polynomial solver: 1. Press [(shift)] [ 7 ] (SOLVER), select PSOL. 2. To evaluate p(x), enter a value for X and solve for P. 3. To solve for x, enter a value for P, enter a guess for X, and then press X again to solve. Note: The solver cannot evaluate 0^0. Hopefully you can see why in the program listing. The best part of PSOL is that you don't have to use just integer powers, put powers in order, or fill in zero terms (0 * x^n). Examples Example 1: p(x) = 2 + 3x^1.5 - x^3 Set PMAT to be this: [ [ 2, 0 ], [ 3, 1.5 ] [ -1, 3 ] ] If X = 2.2, solving for P yields 1.141382003 If P = -1, solving for X with guess 0 yields 2.431407988 Example 2: p(x) = -5 + 3*x + 4*x^2 Set PMAT to be this: [ [ -5, 0 ], [ 3, 1 ], [ 4, 2 ]] If X =1.8, solving for P yields 13.36 If P = 10, solving for X with guess 0 yields 1.59746673 DM42/HP42S (Free42) Solver Program PSOL Code: 00 { 65-Byte Prgm } |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(Free42, DM42, HP42S): Polynomial Solver - Eddie W. Shore - 03-14-2022 01:16 PM
RE: (Free42, DM42, HP42S): Polynomial Solver - Thomas Klemm - 03-14-2022, 03:06 PM
RE: (Free42, DM42, HP42S): Polynomial Solver - Namir - 03-21-2022, 11:37 AM
RE: (Free42, DM42, HP42S): Polynomial Solver - Thomas Klemm - 03-21-2022, 02:29 PM
RE: (Free42, DM42, HP42S): Polynomial Solver - Namir - 03-21-2022, 08:28 PM
|
User(s) browsing this thread: 1 Guest(s)