Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

20 years, 343 days
Mihailovs, Inc.
Owner, President, and CEO
Tyngsboro, Massachusetts, United States

Social Networks and Content at Maplesoft.com

Maple Application Center

I received my Ph.D. from the University of Pennsylvania in 1998 and I have been teaching since then at SUNY Oneonta for 1 year, at Shepherd University for 5 years, at Tennessee Tech for 2 years, at Lane College for 1 year, and this year I taught at the University of Massachusetts Lowell. My research interests include Representation Theory and Combinatorics.

MaplePrimes Activity


These are replies submitted by Alec Mihailovs

The original example can be done as follows. Start with Nr. Convert cos(a) there to 1-2*sin^2(a/2). Expand. Discard negative terms. Replace cos with 1. The result is 4*Dr.

Alec

For simple polynomial and trigonometric inequalities (in real domain), it seems to be not that hard to program. It seems strange that Maple, after 28 years of development, still doesn't cover that - it is a high school problem.

My choice in the poll at the l.h.s. was Math Algorithms, and I thought to myself entering it - covering at least high school algebra, geometry, and trigonometry would be nice.

By the way, this particular algebraic inequality can be done as

Optimization:-Maximize(2*(a+b+c)-(a*b+b*c+a*c),
    a=-1..1,b=-1..1,c=-1..1);

                    [3., [a = 1., b = 1., c = 0.]]

as well as

maximize(2*(a+b+c)-(a*b+b*c+a*c),a=-1..1,b=-1..1,c=-1..1);

                                  3

A similar thing can be done in the original example as well,

Optimization:-Maximize(eqn,x=0..Pi,y=0..Pi,z=0..Pi,
    initialpoint=[x=0.1,y=0.1,z=0.2]);

   [4.00000000000000088, [x = 0., y = 0., z = 2.66786575027781580]]

That doesn't prove the inequalities though, because, as we know, both maximize and Optimization:-Maximize give only a local maximum, and global maximum might be different.

Global Optimization Toolbox would be better for such problems, but it has to be purchased separately. Last time I used it  (I think it was a version for Maple 10), it gave correct results for problems with about 50 variables or less, close to correct with 50-100 variables, and wasn't very good for problems with more than 100 variables. It may be improved since then, though.

Alec

For simple polynomial and trigonometric inequalities (in real domain), it seems to be not that hard to program. It seems strange that Maple, after 28 years of development, still doesn't cover that - it is a high school problem.

My choice in the poll at the l.h.s. was Math Algorithms, and I thought to myself entering it - covering at least high school algebra, geometry, and trigonometry would be nice.

By the way, this particular algebraic inequality can be done as

Optimization:-Maximize(2*(a+b+c)-(a*b+b*c+a*c),
    a=-1..1,b=-1..1,c=-1..1);

                    [3., [a = 1., b = 1., c = 0.]]

as well as

maximize(2*(a+b+c)-(a*b+b*c+a*c),a=-1..1,b=-1..1,c=-1..1);

                                  3

A similar thing can be done in the original example as well,

Optimization:-Maximize(eqn,x=0..Pi,y=0..Pi,z=0..Pi,
    initialpoint=[x=0.1,y=0.1,z=0.2]);

   [4.00000000000000088, [x = 0., y = 0., z = 2.66786575027781580]]

That doesn't prove the inequalities though, because, as we know, both maximize and Optimization:-Maximize give only a local maximum, and global maximum might be different.

Global Optimization Toolbox would be better for such problems, but it has to be purchased separately. Last time I used it  (I think it was a version for Maple 10), it gave correct results for problems with about 50 variables or less, close to correct with 50-100 variables, and wasn't very good for problems with more than 100 variables. It may be improved since then, though.

Alec

That's what tablelook does,

tablelook(A*sin(t)+B*cos(t),p);
                    2    2 1/2
                  (A  + B )    sin(t + arctan(B, A))

and

tablelook(sin(t)+cos(t),p);
                           1/2          Pi
                          2    sin(t + ----)
                                        4

Note that you are using a wrong form of arctan as it was mentioned by acer, with examples showing that. Your formula is wrong with arctan(B/A). To be correct, it should have arctan(B,A) instead.

Alec

That's what tablelook does,

tablelook(A*sin(t)+B*cos(t),p);
                    2    2 1/2
                  (A  + B )    sin(t + arctan(B, A))

and

tablelook(sin(t)+cos(t),p);
                           1/2          Pi
                          2    sin(t + ----)
                                        4

Note that you are using a wrong form of arctan as it was mentioned by acer, with examples showing that. Your formula is wrong with arctan(B/A). To be correct, it should have arctan(B,A) instead.

Alec

Thank you!

I edited it few times so that, probably, created a few notifications in the mail. Sorry about that,

Alec

Thank you!

I edited it few times so that, probably, created a few notifications in the mail. Sorry about that,

Alec

it's true with arctan(B,A).

Alec

it's true with arctan(B,A).

Alec

I can't say for everybody, but I usually choose whether to use an expression or a function depending on the task. If there is a need of evaluating it at some point(s), then the function is more convenient (less typing). Otherwise (that means in most cases) an expression is more convenient (also less typing). That sometimes leads to either using eval or unapply.

If q in this example was a result of some calculation, like integration, or differentiation, for example, then a normal way of further evaluation of it at a=1/3 or at any other point would be either through eval or unapply (instead of retyping it as a function.) In both cases Maple gives a wrong result.

Alec

Mathematica 6.03 does this correctly, both for evaluating and in the function form,

In[1]:= q = (6 ((1/3) a - 1/9))/(36 a - 116 + 
     12 Sqrt[12 a^3 - 3 a^2 - 54 a + 93])^(1/3)

Out[1]= (6 (-(1/9) + a/3))/(-116 + 36 a + 
  12 Sqrt[93 - 54 a - 3 a^2 + 12 a^3])^(1/3)

In[2]:= q /. a -> 1/3

During evaluation of In[2]:= Power::infy: Infinite expression \
1/0^(1/3) encountered. >>

During evaluation of In[2]:= \[Infinity]::indet: Indeterminate \
expression 0 ComplexInfinity encountered. >>

Out[2]= Indeterminate

In[3]:= q = (6 ((1/3) # - 1/9))/(36 # - 116 + 
      12 Sqrt[12*#^3 - 3 #^2 - 54 # + 93])^(1/3) & 

Out[3]= (
 6 (#1/3 - 1/9))/(36 #1 - 116 + 
   12 Sqrt[12 #1^3 - 3 #1^2 - 54 #1 + 93])^(1/3) &

In[4]:= q[1/3]

During evaluation of In[4]:= Power::infy: Infinite expression 1/0 \
encountered. >>

During evaluation of In[4]:= \[Infinity]::indet: Indeterminate \
expression 0 ComplexInfinity encountered. >>

Out[4]= Indeterminate

In my example, in the function form the result is the same as above, and entered as an expression, it outputs 1, so it gives 1 after any substitution.

Alec

SAGE gives an error returned from Maxima,

sage: a=var('a')
sage: q = (6*((1/3)*a-1/9))/(36*a-116+12*sqrt(12*a^3-3*a^2-54*a+93))^(1/3)
sage: q(1/3)
---------------------------------------------------------------------------
             Traceback (most recent call last)
... [long output skipped]
Error executing code in Maxima
CODE:
	(0/1) / (((-104/1) + ((12) * (sqrt(676/9)))) ^ (1/3));
Maxima ERROR:
	
Division by 0

Alec

I remember discussing with Joe Riel in maple-assist a possibility of running a server using Sockets package, which would allow displaying in a maplet outputs of the commands entered in the command line Maple. I think, we even got a working example there. I don't have time to find the link at the moment (I have to go), but I might find it later.

Edit: Found the link.

Alec 

You don't need a script - just do it in a command line maple as acer suggested. Also, put a : at the end instead of the ; to avoid printing the result.

Alec

You don't need a script - just do it in a command line maple as acer suggested. Also, put a : at the end instead of the ; to avoid printing the result.

Alec

First 102 103 104 105 106 107 108 Last Page 104 of 180