Christian Wolinski

MaplePrimes Activity


These are replies submitted by Christian Wolinski

Can you specify which science, subject produced this matrix?

@Ahmed111 

You can use this code.

 
 

restart;
cH := proc (x) options operator, arrow; conjugate(x) = abs(x)^2/x end proc;
rH := proc (x) options operator, arrow; x = 2*Re(x)-conjugate(x) end proc;
fe := proc(f) frontend(f, [args[2..-1]],[{Non}({op(procname)}), {}]) end;

A := Matrix([[phi, conjugate(psi), chi, conjugate(rho)], [psi, -conjugate(phi), rho, -conjugate(chi)], [lambda1*phi, conjugate(lambda1)*conjugate(psi), lambda2*chi, conjugate(lambda2)*conjugate(rho)], [lambda1*psi, -conjugate(lambda1)*conjugate(phi), lambda2*rho, -conjugate(lambda2)*conjugate(chi)]]);
dA := LinearAlgebra:-Determinant(A);

map(cH, [phi, chi, rho, psi]);
T[1] := map(numer@(lhs-rhs), %), plex((op@map)(lhs, %), (op@map)(op@lhs, %));

map(expand@cH, [lambda1-lambda2, conjugate(lambda1)-(lambda2)]);
T[2] := map(expand@numer@(lhs-rhs), %), plex(op(indets(% ,specfunc(conjugate))), op(indets(% ,specfunc(abs))));

expand([rH(conjugate(phi)*conjugate(rho)*chi*psi)]);
T[3]:=map(expand@numer@(lhs-rhs), %), plex(op(indets(% ,specfunc(conjugate))), op(indets(% ,specfunc(Re))));

fe[specfunc(anything, {conjugate, abs})](expand@simplify, dA, T[1]);
collect(%, abs, distributed, factor);
fe[specfunc(anything, {conjugate, abs})](expand@simplify, %, T[2]);
fe[specfunc(anything, {conjugate, abs, Re})](expand@simplify, %, T[3]);
dA2:=fe[function](collect, %, indets(%, anyfunc(dependent({lambda1, lambda2}))), distributed, factor);

collect(dA2, Re);
coeff(%, Re(conjugate(phi)*conjugate(rho)*chi*psi), 1)+8*Im(lambda1)*Im(lambda2):
(% = expand(convert(%, conjugate)))*Re(conjugate(phi)*conjugate(rho)*chi*psi);
dA3 := collect(dA2-lhs(%), indets(%, anyfunc(dependent({lambda1, lambda2}))));

dA;dA2;dA3;


Thumb if you like.

Following is an example which I consider a failure in symbolic computation. Am I overreacting? It simply demonstrates the fact that unless the parameter is inert (not active like g()) it cannot be safely used in an identity because it may be distributed. 

 

restart;
g := proc(n) global i; local j;
   if not type([i], [integer]) then i := 0; fi;
   j := i;
   i := i + 1;
   x[j];
end;

f(g());
A := f = a + b + c;
assign(A);
W[1] := 'f'(g());
W[2] := '%' = %;
W[3] := (''f'' = 'f')(g());  


.

@acer The composition rule demonstrated by Op & Op2 was a clad rule of Maple programming. It holds true in 5.4, it does not hold true in Maple 2017. I did not notice, or maybe I forgot. I am interested to know when this change was implemented. Where is this announced, where is the narrative for this change?

So which versions fail this and how is this explained. I feel like this is an old issue.

Edit: the results wont be equal, but they should be similar.

 

Op := proc(R,F)
 a := R, R;
 F(a());
end:

Op2 := proc(R,F)
 a := R, R;
 a := a();
 F(a);
end;

([Op] = [Op2])(rand(1 .. 9), [f, f]);


 

@Carl Love I am most interested in satisfying test1 using builtin types. Since satisfies was introduced this idea is confused, satisfies is just a torture test. I thought atomic might be the type I was looking for, but it is not.

@Carl Love I would consider that a run around my question, since that type is just an arbitrary procedure call. It does not identify a Maple type.

@maple2015 Thumb if you like. It helps :D

@Carl Love Replace the 600 with something of order of 1500. What is the ceiling? Can we count real roots of a polynomial this size?

@Carl Love What is the best way to count real roots of a polynomial this size. (Unfortunately this polynomial factors)

@Carl Love I thought size would obstruct. What are the limits in this?

@acer is `eval/piecewise` necessary? I used unassign on `eval/piecewise` and eval with piecewise worked as I would expect.

I see this code satisfies what I expected from earlier versions of Maple:

 

S := {x[5] = x[2]/x\[1], x[6] = x[3]/x[2], x[7] = x[1]/x[4], x[8] = (2*x[2]+x[4])/(2*x[1]+x[3]+x[4])};
V := {x[1], x[2], x[3], x[4], x[8]};
T := (numer @ (lhs - rhs)) ~ (S):
Groebner :- Solve(T);
W := map(proc(L, v) seq([remove(evalb, s), L[3]], s = [solve](L[1], v)) end, %, V);

 

Here is an example of something I expect to happen in previous example.:

 

eliminate({x[2] = x[5] * x[1]}, {x[1], x[2]});

 

@vv 

true, [x = 2, y = 2]

I was anticipating this result.

4 5 6 7 8 9 10 Page 6 of 11