user123456

15 Reputation

One Badge

4 years, 83 days

MaplePrimes Activity


These are questions asked by user123456

I want a procedure that has arguments f(function) N (natural number)  and an array of values a0,...an is what is returned 
So far I have this 
restart
Chebyshev_approx:= (f::procedure , N :: numeric);
local F,n,a;
for n from 0 to N do 
if n=0
then a:=1/Pi*evalf(Int(1/sqrt(1-x^2)*f(x),x=-1..1)
else a:=2/Pi*evalf(Int(1/sqrt(1-x^2)*f(x)*ChebyshevT(n , x),x=-1..1)
fi;
F:=F+a*ChebyshevT( n , x)
od;
F
end;

 

Page 1 of 1