vv

14077 Reputation

20 Badges

10 years, 70 days

MaplePrimes Activity


These are replies submitted by vv

@Kitonum Yes, Mathematica's answer is much better, but my comment was about your remarks which were both incorrect.

@Kitonum 

Not quite (for minimize/maximize):

minimize(x^2+a*x+1, x=-infinity..infinity) assuming a::real;

1-(1/4)*a^2

(1)
   

minimize(x^2+a*x+1, x=-1..1) assuming a>2;

2-a

(2)

minimize(x^2+a*x+1, x=-1..1) assuming a<2,a>-2;

1-(1/4)*a^2

(3)

minimize(x^2+a*x+1, x=-1..1) assuming a<-2;

2+a

(4)

 

 

Edit. The result of Optimization:-Minimize(f, x=0..6) is not a bug, x=2 is a local minimum.
For a global minimum use:

Optimization:-Minimize(f, x=0..6, method=branchandbound);
        [-2., [x = 6.]]

 

 

@MapleEnthusiast 

The number of epsilon's depends on which pi[k,j]  are eliminated:

  

restart;

System := R[i] = sum(pi[i, j]*(-epsilon*sum(pi[k, j]*((R[i] - R[k]) + (-delta[i] + delta[k])), k = 1 .. J) + R[j]), j = 1 .. J):

eq1 := simplify(expand(subs(J = 3, i = 1, System))):

eq2 := simplify(expand(subs(J = 3, i = 2, System))):

eq3 := simplify(expand(subs(J = 3, i = 3, System))):

J := {$ (1 .. 3)}:

Con := {seq(add(pi[i, j], i = J) = 1, j = J)}:

SCon:=solve(Con);

{pi[1, 1] = 1-pi[2, 1]-pi[3, 1], pi[1, 2] = 1-pi[2, 2]-pi[3, 2], pi[1, 3] = 1-pi[2, 3]-pi[3, 3], pi[2, 1] = pi[2, 1], pi[2, 2] = pi[2, 2], pi[2, 3] = pi[2, 3], pi[3, 1] = pi[3, 1], pi[3, 2] = pi[3, 2], pi[3, 3] = pi[3, 3]}

(1)

A := simplify(solve(simplify({eq1, eq2, eq3}, Con), {R[1], R[2]})):

diff(subs(R[3] = 0, delta[1] = 0, delta[3] = 0, numer(rhs(A[1]))), delta[2]);

numboccur(%, epsilon);
indets(%%);

-epsilon*pi[1, 1]*pi[2, 1]*pi[2, 2]+epsilon*pi[1, 2]*pi[2, 1]^2+epsilon*pi[1, 2]*pi[2, 3]^2-epsilon*pi[1, 3]*pi[2, 2]*pi[2, 3]+epsilon*pi[1, 1]*pi[2, 1]-epsilon*pi[1, 2]*pi[2, 1]-epsilon*pi[1, 2]*pi[2, 3]+epsilon*pi[1, 3]*pi[2, 3]

 

8

 

{epsilon, pi[1, 1], pi[1, 2], pi[1, 3], pi[2, 1], pi[2, 2], pi[2, 3]}

(2)

B := simplify(solve(simplify({eq1, eq2, eq3}, Con), {R[1], R[3]})):

DB:=diff(subs(R[2] = 0, delta[1] = 0, delta[2] = 0, numer(rhs(B[1]))), delta[3]);

numboccur(%, epsilon);
indets(%%);

-epsilon*pi[1, 1]^2*pi[2, 3]+epsilon*pi[1, 1]*pi[1, 3]*pi[2, 1]-epsilon*pi[1, 1]*pi[2, 1]*pi[2, 3]-epsilon*pi[1, 2]^2*pi[2, 3]+epsilon*pi[1, 2]*pi[1, 3]*pi[2, 2]-epsilon*pi[1, 2]*pi[2, 2]*pi[2, 3]+epsilon*pi[1, 3]*pi[2, 1]^2+epsilon*pi[1, 3]*pi[2, 2]^2+epsilon*pi[1, 1]*pi[2, 3]+epsilon*pi[1, 2]*pi[2, 3]-epsilon*pi[1, 3]*pi[2, 1]-epsilon*pi[1, 3]*pi[2, 2]

 

12

 

{epsilon, pi[1, 1], pi[1, 2], pi[1, 3], pi[2, 1], pi[2, 2], pi[2, 3]}

(3)

expand(eval(DB, SCon));
numboccur(%, epsilon);
indets(%%);

epsilon*pi[2, 1]*pi[3, 1]*pi[3, 3]+epsilon*pi[2, 2]*pi[3, 2]*pi[3, 3]-epsilon*pi[2, 3]*pi[3, 1]^2-epsilon*pi[2, 3]*pi[3, 2]^2-epsilon*pi[2, 1]*pi[3, 1]-epsilon*pi[2, 2]*pi[3, 2]+epsilon*pi[2, 3]*pi[3, 1]+epsilon*pi[2, 3]*pi[3, 2]

 

8

 

{epsilon, pi[2, 1], pi[2, 2], pi[2, 3], pi[3, 1], pi[3, 2], pi[3, 3]}

(4)

 

Download puzzle4-vv.mw

@MapleEnthusiast I mean a mathematical reason, not heuristics. Note also that you have simplified wrt size.

(1+e)^3 = 1 + 3e + 3e^2 + e^3: e appears once in LHS and 3 times in RHS. Is this "puzzling"? 

@MapleEnthusiast So, the solutions for A and B are different (and you also took only the numerators!). There is no reason to obtain similar results. If you construct a simpler system (for yourself!) you will be able to check by hand and understand & see the problem.

@MapleEnthusiast Why should they be the same? Note that the R[1,1] could be different in A and B.
If you want to understand exactly what happens, take a smaller system with 2 or 3 parameters and don't use (so many) indices.

@Carl Love Actually, for an expr having a type other than rtable,table, list, Grid:-Map returns 
op(0,expr)(result);
It could be indeed an oversight. Or maybe they want to avoid a (possibly huge) set in the answer.

@acer Yes, I know, but it is anyway unstable; mathematically Rank : R^(n^2) --> N is discontinuous.

So, you are asking for more than the mentioned NP-hard problem!

@MapleEnthusiast The matrix has many symbolic parameters, so the pseudo inverse will be huge. But what do you want to do with it? For a system Ax=b, the pseudo inverse A' is generally used to compute the least squares solution A'b (as Carl said). Your system is homogeneous (b=0), so, A'b=0.

@MapleEnthusiast The More-Penrose inverse exists for any matrix (even non square or 0). But I don't see how could it be useful here.
As in my example, the matrix of your system is singular if the relations are considered. So, it does not make sense to solve it before replacing the dependent parameters. 

@MapleEnthusiast 

 

Take a simple similar situation.

You have the system

sys := {a*x + b*y + c*(a-b) = 0, x+y+c+d = 0};

{a*x+b*y+c*(a-b) = 0, x+y+c+d = 0}

(1)

and the parameters satisfy the relations

rels:=[a-b=0, c+d=0];

[a-b = 0, c+d = 0]

(2)

solve(sys,{x,y});

{x = -(a*c-2*b*c-b*d)/(a-b), y = -(a*d+b*c)/(a-b)}

(3)

simplify(%, rels);

Error, (in simplify/siderels:-Recurse) numeric exception: division by zero

 

sys1:=simplify(sys, rels); # now the system is homogeneous (exactly like yours)

{a*(x+y) = 0, x+y = 0}

(4)

solve(sys1, {x,y});

{x = -y, y = y}

(5)

Using a pseudo inverse cannot help here.

 

@nm Now I can't find this info either. Probably I read about it elsewhere.

@nm PDEtools:-Solve says clearly that the multiplicity is ignored.

@MapleEnthusiast In E is computed the regular inverse (and the result is simplified). The matrix C-A is invertible, so the pseudo inverse equals the regular inverse and using method=pseudo just complicates the computations.

First 39 40 41 42 43 44 45 Last Page 41 of 177