lcz

994 Reputation

11 Badges

6 years, 130 days
changsha, China

MaplePrimes Activity


These are questions asked by lcz

Unfortunately,  Optimization:-Maximize command in following example returns a not precise result (I use Maple 2020).

restart:
s1:= Optimization:-Maximize((x-2*y)/(5*x^2-2*x*y+2*y^2), {2*x^2 - y^2 + x*y=1})

Maple is running the following results:

I read help of  Maximize, It seems to be using only numerical methods .

 

The Minimize and Maximize commands use various methods implemented in a built-in library provided by the Numerical Algorithms Group (NAG). 

 

Can't Maple find a symbolic solution for extreme values under such constrained inequality or equality conditions?

Ps:

For the correct  symbolic  solution, we can try to  use Mathematica 12.

Maximize[{(x - 2*y)/(5*x^2 - 2*x*y + 2*y^2), 
  2*x^2 - y^2 + x*y == 1}, {x, y}]

  We can compare numerical sizes of Optimal solution between maple and mathematica. 

Digits:=20;
sqrt(2.)/4.

Another Problem:

If I accept numerical solutions of maple ,how do I estimate errors without knowing the exact solution ?

 

 

 

Hello,The system of equations is as follows:

I'd like to find all integer solutions in [1,20], when I use isolve ,the results are not good.  Since at least one variable is equal to 0 in evey solution.

{isolve}({a+b+c=a1+b1+c1, a^2+b^2+c^2=(a1)^2+(b1)^2+(c1)^2,a*b*c=2*a1*b1*c1})

 In maple I did not  want to use less efficient for-loop like C programing as following.

#include <math.h>
#include <stdio.h>
void main()
{
    long int a,b,c,d,e,f;
    for(a=1;a<20;a++)
    {
        for(b=1;b<20;b++)
        {
            for(c=1;c<20;c++)
            {
                for(d=1;d<20;d++)
                {
                    for(e=1;e<20;e++)
                    {
                        for(f=1;f<20;f++)
                        {
                            if(a+b+c==d+e+f&&a*a+b*b+c*c==d*d+e*e+f*f&&a*b*c==2*d*e*f)                                             printf("a=%d,b=%d,c=%d,d=%d,e=%d,f=%d\n",a,b,c,d,e,f);
                        }
                    }
                }
            }
        }
    }
}
a=3,b=5,c=16,d=1,e=8,f=15
a=3,b=5,c=16,d=1,e=15,f=8
a=3,b=5,c=16,d=8,e=1,f=15
a=3,b=5,c=16,d=8,e=15,f=1
a=3,b=5,c=16,d=15,e=1,f=8
a=3,b=5,c=16,d=15,e=8,f=1
a=3,b=16,c=5,d=1,e=8,f=15
a=3,b=16,c=5,d=1,e=15,f=8
a=3,b=16,c=5,d=8,e=1,f=15
a=3,b=16,c=5,d=8,e=15,f=1
a=3,b=16,c=5,d=15,e=1,f=8
a=3,b=16,c=5,d=15,e=8,f=1
a=5,b=3,c=16,d=1,e=8,f=15
a=5,b=3,c=16,d=1,e=15,f=8
a=5,b=3,c=16,d=8,e=1,f=15
a=5,b=3,c=16,d=8,e=15,f=1
a=5,b=3,c=16,d=15,e=1,f=8
a=5,b=3,c=16,d=15,e=8,f=1
a=5,b=16,c=3,d=1,e=8,f=15
a=5,b=16,c=3,d=1,e=15,f=8
a=5,b=16,c=3,d=8,e=1,f=15
a=5,b=16,c=3,d=8,e=15,f=1
a=5,b=16,c=3,d=15,e=1,f=8
a=5,b=16,c=3,d=15,e=8,f=1
a=16,b=3,c=5,d=1,e=8,f=15
a=16,b=3,c=5,d=1,e=15,f=8
a=16,b=3,c=5,d=8,e=1,f=15
a=16,b=3,c=5,d=8,e=15,f=1
a=16,b=3,c=5,d=15,e=1,f=8
a=16,b=3,c=5,d=15,e=8,f=1
a=16,b=5,c=3,d=1,e=8,f=15
a=16,b=5,c=3,d=1,e=15,f=8
a=16,b=5,c=3,d=8,e=1,f=15
a=16,b=5,c=3,d=8,e=15,f=1
a=16,b=5,c=3,d=15,e=1,f=8
a=16,b=5,c=3,d=15,e=8,f=1

Does Maple have more good ways to solve that?

 I want to find all real roots of   equation x^2 + floor(x) - 10=0

restart: 
solve(x^2+floor(x)-10,x) assuming x::real 

maple tells me:

  RootOf(_Z^2 + floor(_Z) - 10)

allvalues(%) 

RootOf(_Z^2 + floor(_Z) - 10, 2.828427125 + 0.*I)

even though  usRealDomain.

use RealDomain in  solve(x^2+floor(x)-10,x) end use

We get nothing!

So I trun to use fsolve.

plot(x^2+floor(x)-10,x=-5..5)

                                  

s:=fsolve(x^2+floor(x)-10,{x});
fsolve(x^2+floor(x)-10,x,avoid={s})

                     s := {x = 2.828427125}

                          -3.741657387

 

I try to use mathematica, it is good:

Solve[x^2 + Floor[x] - 10 == 0, x, Reals]

Could Maple  do that?

 

 

 

 

 

 

I'd like to solve the equation b^4+12*b^2+22*b^2-20*b+1=0

M:=b^4+12*b^2+22*b^2-20*b+1;
s:=solve(M,{b}):
s1:=allvalues(s[1])[]:# first solution

I find   first solution has  common subexpressions 5435 + 3*sqrt(515793), so I want to repalce by t. but unfortunately failed.

eq:=5435 + 3*sqrt(515793)=t:
applyrule(eq,s1);
# failed

why? in  following simple instance, it is OK!

eq:=5435 + 3*sqrt(515793)=t:
applyrule(eq,sqrt(5435 + 3*sqrt(515793)));

 

 

 

 

 

 I try to solve the general solutions of  sin(x^2)=1/2. And then I would  like to check the solution,but failed. How to do?

s:=solve(sin(x^2)=1/2,allsolutions);
about(_Z1);  #Originally _Z1, renamed _Z1~: is assumed to be: integer
about(_B1);  #Originally _B1, renamed _B1~: is assumed to be: OrProp(0,1)
test:=simplify(subs(x=s[1],sin(x^2)))

it sholud be 1/2. Thanks!

First 16 17 18 19 20 21 22 Page 18 of 25