Chebyshev Approximations of an Analytic Function
|
09-12-2022, 09:39 AM
Post: #1
|
|||
|
|||
Chebyshev Approximations of an Analytic Function
// program demo_chebyshev HP Prime
// September 12, 2022 // This program demonstrates the procedures for calling // several Chebyshev subroutines. These subroutines can be // used to approximate the integral, derivative, and // function value of a user-defined analytic function. // This program demonstrates the use of the Chebyshev // subroutines for evaluating information about // f(x) = x^2 * (x^2 - 2.0) * sin(x) // NOTE: current array allocations require maximum degree <= 20 The software allows the user to define a problem using the following inputs coded at the beginning of the main program. // maximum degree of the chebyshev approximation ndeg := 15; // lower limit of the evaluation interval xlower := 1.0; // upper limit of the evaluation interval xupper := 2.0; // number of terms in the chebyshev approximation nterms := 10; // x argument for evaluation x := 1.5; The following is the source code for the user-defined function for this example. This is where the user should define his or her function of interest. user_func(x) // user-defined function subroutine /////////////////////////////////// BEGIN LOCAL fx; fx := (x * x) * (x * x - 2.0) * sin(x); return fx; END; |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)