sursumCorda

1244 Reputation

15 Badges

2 years, 264 days

MaplePrimes Activity


These are questions asked by sursumCorda

As we can see, RealDomain:-solve gives an incorrect solution to the following system: 

restart;

sys := `~`[diff](sqrt(2*a^2-8*a+10)+sqrt(b^2-6*b+10)+sqrt(2*a^2-2*a*b+b^2), [a, b]):

RealDomain:-solve(`~`[`=`](sys, 0), {a, b})

{a = 5/3, b = 5/2}, {a = a, b = 2*a/(a-1)}

(1)

plot(eval(sys, {max(2*5^(1/2), (2*a^2-8*a+10)^(1/2)+2^(1/2)*((a^2-4*a+5)/(a-1)^2)^(1/2)+2^(1/2)*(a^2*(a^2-4*a+5)/(a-1)^2)^(1/2)), min(2*5^(1/2), (2*a^2-8*a+10)^(1/2)+2^(1/2)*((a^2-4*a+5)/(a-1)^2)^(1/2)+2^(1/2)*(a^2*(a^2-4*a+5)/(a-1)^2)^(1/2))}[-1]), a = -infinity .. infinity)

 

extrema(sqrt(2*a^2-8*a+10)+sqrt(b^2-6*b+10)+sqrt(2*a^2-2*a*b+b^2), {}, {a, b})

{max(2*5^(1/2), (2*a^2-8*a+10)^(1/2)+2^(1/2)*((a^2-4*a+5)/(a-1)^2)^(1/2)+2^(1/2)*(a^2*(a^2-4*a+5)/(a-1)^2)^(1/2)), min(2*5^(1/2), (2*a^2-8*a+10)^(1/2)+2^(1/2)*((a^2-4*a+5)/(a-1)^2)^(1/2)+2^(1/2)*(a^2*(a^2-4*a+5)/(a-1)^2)^(1/2))}

(2)

Download solve_returns_an_unsatisfiable_real_solution.mw

This appears to be a bug; is it possible to fix it? 
Text: 

sys := diff~(sqrt(2*a^2 - 8*a + 10) + sqrt(b^2 - 6*b + 10) + sqrt(2*a^2 - 2*a*b + b^2), [a, b]):
RealDomain:-solve(sys =~ 0, {a, b});

As the following worksheet shows, Student:-NumericalAnalysis:-MatrixDecomposition cannot factorize the input matrix  and throws an error, but if we simply reorder or exchange the elements of , no error will be raised. (The reason for setting  is that LinearAlgebra:-LUDecomposition can be used for other methods.) 
 

restart

with(Student:-NumericalAnalysis, MatrixDecomposition)

m := Matrix([[3*(sqrt(3)+1)/8,-1/2,1/2,-(sqrt(3)+1)/8,-1/2,1/2,-(sqrt(3)+1)/8,-1/2,1/2,-(sqrt(3)+1)/8],

             [-1/2,sqrt(3)-1,-(sqrt(3)-1),-1/2,0,0,1/2,0,0,1/2],

             [1/2,-(sqrt(3)-1),sqrt(3)-1,1/2,0,0,-1/2,0,0,-1/2],

             [-(sqrt(3)+1)/8,-1/2,1/2,3*(sqrt(3)+1)/8,1/2,-1/2,-(sqrt(3)+1)/8,1/2,-1/2,-(sqrt(3)+1)/8],

             [-1/2,0,0,1/2,sqrt(3)-1,-(sqrt(3)-1),-1/2,0,0,1/2],

             [1/2,0,0,-1/2,-(sqrt(3)-1),sqrt(3)-1,1/2,0,0,-1/2],

             [-(sqrt(3)+1)/8,1/2,-1/2,-(sqrt(3)+1)/8,-1/2,1/2,3*(sqrt(3)+1)/8,1/2,-1/2,-(sqrt(3)+1)/8],

             [-1/2,0,0,1/2,0,0,1/2,sqrt(3)-1,-(sqrt(3)-1),-1/2],

             [1/2,0,0,-1/2,0,0,-1/2,-(sqrt(3)-1),sqrt(3)-1,1/2],

             [-(sqrt(3)+1)/8,1/2,-1/2,-(sqrt(3)+1)/8,1/2,-1/2,-(sqrt(3)+1)/8,-1/2,1/2,3*(sqrt(3)+1)/8]],

            'shape'='symmetric'):

MatrixDecomposition(m, 'method' = 'LDLt'): # this does not work 

Error, (in Student:-NumericalAnalysis:-MatrixDecomposition) a pivot element 0 is encountered, and the entries below it are not all 0; the factorization cannot continue

 

MatrixDecomposition(m([1, 4, 7, 10, 2, 5, 8, 3, 6, 9] $ 2), 'method' = 'LDLt'): # yet this works 

MatrixDecomposition(m([2, 3, 5, 6, 8, 9, 1, 4, 7, 10] $ 2), 'method' = 'LDLt'): # this also works 

randomize(5):

k := 0:
to 1e3 do
        try
                MatrixDecomposition(m(combinat:-randperm(10) $ 2), 'method' = 'LDLt')
        catch :
                k++
        end
od:
k/1e3;

.469

(1)


 

Download LDL_factorization_robustness.mw

The last instance above suggests that it only works on about half of the inputs (that are equivalent to each other). Although I tried changing the value of Digits, the failure rate remained high. Is Student:-NumericalAnalysis:-MatrixDecomposition not robust enough? 

I would like to generate a brief description of the object Iterator:-Product but I get the following error:  

Describe(Iterator:-Product);

object Product :: Class<<36893490916968945900>>:

    ModuleApply( )

    ModuleCopy( self::_Product, proto::_Product, 
Error, (in Describe) `proto` does not evaluate to a module

How do I get rid of this message? 

If I understand right, in the following calling an exception should be raised since the return value of the matching coercion procedure is of course not of type “set”: 

restart;
foo := (x::coerce(set, (y::rtable) -> convert(y, list))) -> x:
foo(<0>);
 = 
                              [0]

Did I miss something?

The goal is to eliminate x, y and z from [a^2=(4*y*z)/((x+y)*(x+z)),b^2=(4*z*x)/((y+z)*(y+x)),c^2=(4*x*y)/((z+x)*(z+y))]. However, eliminate only outputs a null expression (I added a  to emphasize it): 

restart;
expr := 4*[y*z/((x + y)*(x + z)), z*x/((y + z)*(y + x)), x*y/((z + x)*(z + y))]:
{eliminate}([a, b, c]**~2 =~ expr, [x, y, z]);
 = 
                               {}

Why is the result empty? 
In my view, the result should be (a*b*c)**2 = ((a**2 + b**2 + c**2) - 2**2)**2 (or its equivalent). One may verify this by: 

seq(seq(seq(
    is(eval((a^2 + b^2 + c^2 - 4)^2 = (a*b*c)^2, 
      elementwise([a, b, c] = [k1, k2, k3]*sqrt(expr)))), 
    `in`(k3, [-1, +1])), `in`(k2, [-1, +1])), `in`(k1, [-1, +1]));
 = 
         true, true, true, true, true, true, true, true

1 2 3 4 5 6 7 Last Page 1 of 23