John May

Dr. John May

3026 Reputation

18 Badges

17 years, 320 days
Maplesoft
Pasadena, California, United States

Social Networks and Content at Maplesoft.com

Maple Application Center
I have been a part of the Mathematical Software Group at Maplesoft since 2007. I have a Ph.D in Mathematics from North Carolina State University as well as Masters and Bachelors degrees from the University of Oregon. I have been working on research in computational mathematics since 1997. I currently work on symbolic solvers and visualization as well as other subsystems of Maple.

MaplePrimes Activity


These are answers submitted by John May

If you are not looking for a (approximate) numerical result, you should put your input as an exact fraction: d:=9/10; Even though d:=0.9 looks exact, it gets treated as an approximate numerical value. Maple will do different things for exact and numeric inputs and that is probably causing your problem here.
You want to use evalc (the complex evaluator):
> evalc(a*exp(I*x)+a*exp(-I*x));                      
                                  2 a cos(x)

> simplify(evalc(-I*(1-exp(-2*I*x))/(1+exp(-2*I*x))));

                                   sin(2 x)
                                 ------------
                                 1 + cos(2 x)

> expand(%);

                                    sin(x)
                                    ------
                                    cos(x)
If you have a list with a lot of zeros and want to get rid of them you can do something like this:
foo:=[0,0,12,0,11,42,13,0,7]:
min(op(foo)), max(op(foo));
#      0, 42
foo:=remove(`=`,foo,0); # removes x in foo with x=0 
#      [12,11,42,13,7]
min(op(foo)), max(op(foo));
#      7, 42
If you are doing this numerically, you might want to get rid of small values instead of just the zeros. In that case you could do something like:
remove(z->abs(z)<10^(-Digits+1), foo); 
From your code, it looks like points4 is a sequence of pairs [x,y]. If you want to filter just based on the x value, you could do:
remove(z->abs(z[1])<10^(-Digits+1), [points4]);
Hope that helps.
First 9 10 11 Page 11 of 11