Post Reply 
gaussian quadrature
08-24-2015, 03:18 PM (This post was last modified: 08-24-2015 03:18 PM by Didier Lachieze.)
Post: #2
RE: gaussian quadrature
(08-23-2015 07:01 PM)Antonio Wrote:  Program 1 , due to the unique character of this calculator , sometimes it works, sometimes not , so i try to make the program 2
Can you explain what happens when it doesn’t work? On my side it seems to works fine.

(08-23-2015 07:01 PM)Antonio Wrote:  Program 2 , do not put the correct result in a0 .
I’ve done some tests with your program 2 and if I’m correct it seems that there is an issue when the CAS function legendre() is called from a CAS program:
  • When called from CAS it returns a polynom of x, for ex. legendre(3) returns 5/2*x^3-3/2*x
  • However when called from a CAS program it returns a polynom of X instead of x: 5/2*X^3-3/2*X

    For example if you add the following line in your code: f:=legendre(nr); just before a0:=subst(diff(legendre(nr)),x=M2(i)); then after running your program, if you type CAS.f you will get 5/2*X^3-3/2*X.
    Same for diff(legendre(nr)) which returns: 15/2*X^2-3/2
    As X is a global predefined variable, then a0 is always evaluated to the same value and just depends on the value of X (-3/2 if X=0, its default value).
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
gaussian quadrature - Antonio - 08-23-2015, 07:01 PM
RE: gaussian quadrature - Didier Lachieze - 08-24-2015 03:18 PM
RE: gaussian quadrature - Antonio - 08-25-2015, 09:23 AM
RE: gaussian quadrature - Didier Lachieze - 08-25-2015, 11:42 AM
RE: gaussian quadrature - Antonio - 08-25-2015, 12:26 PM

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