micahdavid

25 Reputation

4 Badges

12 years, 284 days

MaplePrimes Activity


These are questions asked by micahdavid

I would like to import the code from Pg 90 on in the following document into Maple. Any suggestions for doing so with minimal editing required after pasting? http://mspace.lib.umanitoba.ca/xmlui/bitstream/handle/1993/14907/Huang_Liji.pdf?sequence=1&isAllowed=y

thanks,

Here is my code

restart;
with(LinearAlgebra):
P := unapply(Matrix(4, 4, {(1, 1) = p[w], (1, 2) = p[x], (1, 3) = p[y], (1, 4) = p[z], (2, 1) = -p[x], (2, 2) = p[w], (2, 3) = -p[z], (2, 4) = p[y], (3, 1) = -p[y], (3, 2) = p[z], (3, 3) = p[w], (3, 4) = -p[x], (4, 1) = -p[z], (4, 2) = -p[y], (4, 3) = p[x], (4, 4) = p[w]}),(p[w],p[x],p[y],p[z]));
evalm(P(x,y,z,w));

(y1, y2, y3, y4) -> rtable(1 .. 4, 1 .. 4, {(1, 1) = y1,

(1, 2) = y2, (1, 3) = y3, (1, 4) = y4, (2, 1) = -y2,

(2, 2) = y1, (2, 3) = -y4, (2, 4) = y3, (3, 1) = -y3,

(3, 2) = y4, (3, 3) = y1, (3, 4) = -y2, (4, 1) = -y4,

(4, 2) = -y3, (4, 3) = y2, (4, 4) = y1}, datatype = anything,

subtype = Matrix, storage = rectangular, order = Fortran_order)

 


S:=Matrix(3,5):
for j from 1 to 3 do;
for k from 1 to 5 do;
S[j,k]:=P(seq(RandomTools[Generate](integer(range = 0 .. 4)),i=1..4));;
end do:
end do:
S;
W:=Matrix(3,5):
for j from 1 to 3 do;
for k from 1 to 5 do;
W[j,k]:=Transpose(S[j,k]);;
end do:
end do:
W;

M:=Matrix(3,3,shape=symmetric):
for j from 1 to 3 do;
for k from 1 to j do;
M[j,k]:=P(x[j,k],y[j,k],z[j,k],w[j,k]);
end do:
end do:
M;
N:=Matrix(3,3,shape=antisymmetric):
for j from 1 to 3 do;
for k from j+1 to 3 do;
N[j,k]:=P(u[j,k],v[j,k],q[j,k],r[j,k]);
end do:
end do:
N;
H:=M+N;
(Transpose(W)[2].H.Transpose(Transpose(S)[2]));

I would like the output to be a 4x4 matrix.

I have a proc as follows:

F:=proc(f,n)
L:=[f];
for j from 1 to n do;
J:=int(1/subs(t=x[j],L[j]),x[j]=2..x[j+1]);
L:=[op(L),J];
end do;
end proc;

I chose to use index variables. However when I try to apply a member of the output list as a function of the outermost limit, I do not get any output when I try to evaluate the function. I suspect maple is having trouble with the variables withing the integral. How can I make this work?

I'd like to have a function that I can evaluate:

g:=F(log(t),3)[3];
f:=unapply(g,x[3]);

f(2.1);

Thanks!

Hey I have a list of matrices and I want to define a proc that will search through the first matrices entries looking for zeroes, and if it finds one to move on to the next matrix in the list and look for zeroes and so on. if for some reason all matrices in the list have zeroes i would like the proc to answer with 0. otherwise I would like it to answer with the ndex of the first matrix wth all non-zero entries. I've played with things and occasionally made things work. But in general I do not have a solution. This is what I'e tried:

Things like this:

recu:=proc(y,n,q)
options trace;
local f,j,t,k;
t[y]:=y:
k:=y:
for f from 1 to n while y<=q do;
for j from 1 to n do;
if evalb(C[k](f,j)=0) then;
t[y+1]:=t[y]+1;
recu(t[y+1],n,q);
else next;
end if;
end do;
end do;
end proc;

like this:

recu:=proc(y,n,q)
local f,j,t,k;
global S;
options trace;
S:=0;
if y=q then return "no";
end if;
for f from 1 to n do;
for j from 1 to n do;
if evalb(C[y](f,j)=0) then;
recu(y+1,n,q);
S:=S+1;
end if;
end do;
end do;
end proc;

And I think I understand well why these are not workinging however I wondered what I can do that will be syntactically (sp?) correct.

Thanks

"Error, (in CheapestPaths) too many levels of recursion"

I received this message after trying to execute Zeilberg's GetMicrosoftJob program found here: http://www.math.rutgers.edu/~zeilberg/tokhniot/GetMicrosoftJob but don't know the cause. Any ideas?


1 2 Page 1 of 2