Christian Wolinski

MaplePrimes Activity


These are replies submitted by Christian Wolinski

@vv If you do not know what is expected then you can safely assume this cup is not what you would drink. There are other threads where you would contribute instead.

@Carl Love Codes are meant to be legible, understandable, presentable, explainable. If this is intended by the designers, then how is the following interpreted? Please read the code and compare it to the the results. Interpret the code before it executes. I woke myself from my Maple V slumber into this Maple 2017 horror show:

 

restart;
g:=proc() local j; j:=op(procname); j:=g[j+1]; applyop(x->eval(x,2),0,'j(args)'); end;

f:=[g[0]];
f(0), f(0)(0), f(0)(0)(0);
f:=[[g[0]]];
f(0), f(0)(0), f(0)(0)(0);
f:=[['g[0]']];
f(0), f(0)(0), f(0)(0)(0);
f:=[[''g[0]'']];
f(0), f(0)(0), f(0)(0)(0);
f:=[g[0](0)];
f(0), f(0)(0), f(0)(0)(0);
f:=[[g[0](0)]];
f(0), f(0)(0), f(0)(0)(0);
f:=[['g[0](0)']];
f(0), f(0)(0), f(0)(0)(0);
f:=[[''g[0](0)'']];
f(0), f(0)(0), f(0)(0)(0);

 

@Carl Love Is it safe to say symbolic computation is dead with Maple?

What is RonanRoutines?

@Ronan How about this:

 

A := (lhs-rhs)(eq3);
L := ([op]@indets)(%, radext);
R := convert(L, RootOf):
(evala@Norm)(subs(L =~ R, A), {}, indets(R, algnumext));
# or in a case when needed:
subs(R =~ L, (evala@Norm)(subs(L =~ R, A), {}, indets(R, algnumext)));


Thumb if you like.

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)

First 12 13 14 15 16 17 18 Page 14 of 19