dharr

Dr. David Harrington

8482 Reputation

22 Badges

21 years, 34 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are answers submitted by dharr

The help for CayleyTableGroup specifies: The single required argument is the Cayley table (or multiplication table): an n by n
 Matrix or Array, m, describing the group with n elements, where the [i, j] entry contains the positive integer k such that the product of the ith and j h group elements is the kth group element.

So this needs to be a matrix of integers.


 

restart;interface(rtablesize=12);

10

with(GroupTheory):

ct := <<e | p | q | r | s | t | u | v | w | x | y | z>, <p | q | e | y | u | w | z | r | x | t | v | s>, <q | e | p | v | z | x | s | y | t | w | r | u>, <r | z | t | s | e | y | v | x | p | u | q | w>, <s | w | y | e | r | q | x | u | z | v | t | p>, <t | r | z | x | w | u | e | q | y | p | s | v>, <u | x | v | p | y | e | t | z | s | r | w | q>, <v | u | x | z | q | r | y | w | e | s | p | t>, <w | y | s | t | x | z | p | e | v | q | u | r>, <x | v | u | w | t | s | q | p | r | e | z | y>, <y | s | w | u | p | v | r | t | q | z | e | x>, <z | t | r | q | v | p | w | s | u | y | x | e>>;

ct := Matrix(12, 12, {(1, 1) = e, (1, 2) = p, (1, 3) = q, (1, 4) = r, (1, 5) = s, (1, 6) = t, (1, 7) = u, (1, 8) = v, (1, 9) = w, (1, 10) = x, (1, 11) = y, (1, 12) = z, (2, 1) = p, (2, 2) = q, (2, 3) = e, (2, 4) = y, (2, 5) = u, (2, 6) = w, (2, 7) = z, (2, 8) = r, (2, 9) = x, (2, 10) = t, (2, 11) = v, (2, 12) = s, (3, 1) = q, (3, 2) = e, (3, 3) = p, (3, 4) = v, (3, 5) = z, (3, 6) = x, (3, 7) = s, (3, 8) = y, (3, 9) = t, (3, 10) = w, (3, 11) = r, (3, 12) = u, (4, 1) = r, (4, 2) = z, (4, 3) = t, (4, 4) = s, (4, 5) = e, (4, 6) = y, (4, 7) = v, (4, 8) = x, (4, 9) = p, (4, 10) = u, (4, 11) = q, (4, 12) = w, (5, 1) = s, (5, 2) = w, (5, 3) = y, (5, 4) = e, (5, 5) = r, (5, 6) = q, (5, 7) = x, (5, 8) = u, (5, 9) = z, (5, 10) = v, (5, 11) = t, (5, 12) = p, (6, 1) = t, (6, 2) = r, (6, 3) = z, (6, 4) = x, (6, 5) = w, (6, 6) = u, (6, 7) = e, (6, 8) = q, (6, 9) = y, (6, 10) = p, (6, 11) = s, (6, 12) = v, (7, 1) = u, (7, 2) = x, (7, 3) = v, (7, 4) = p, (7, 5) = y, (7, 6) = e, (7, 7) = t, (7, 8) = z, (7, 9) = s, (7, 10) = r, (7, 11) = w, (7, 12) = q, (8, 1) = v, (8, 2) = u, (8, 3) = x, (8, 4) = z, (8, 5) = q, (8, 6) = r, (8, 7) = y, (8, 8) = w, (8, 9) = e, (8, 10) = s, (8, 11) = p, (8, 12) = t, (9, 1) = w, (9, 2) = y, (9, 3) = s, (9, 4) = t, (9, 5) = x, (9, 6) = z, (9, 7) = p, (9, 8) = e, (9, 9) = v, (9, 10) = q, (9, 11) = u, (9, 12) = r, (10, 1) = x, (10, 2) = v, (10, 3) = u, (10, 4) = w, (10, 5) = t, (10, 6) = s, (10, 7) = q, (10, 8) = p, (10, 9) = r, (10, 10) = e, (10, 11) = z, (10, 12) = y, (11, 1) = y, (11, 2) = s, (11, 3) = w, (11, 4) = u, (11, 5) = p, (11, 6) = v, (11, 7) = r, (11, 8) = t, (11, 9) = q, (11, 10) = z, (11, 11) = e, (11, 12) = x, (12, 1) = z, (12, 2) = t, (12, 3) = r, (12, 4) = q, (12, 5) = v, (12, 6) = p, (12, 7) = w, (12, 8) = s, (12, 9) = u, (12, 10) = y, (12, 11) = x, (12, 12) = e})

elems:=convert(ct[1],list);
for i to nops(elems) do f(elems[i]):=i end do: #use remember table

[e, p, q, r, s, t, u, v, w, x, y, z]

M:=map(f,ct);

M := Matrix(12, 12, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (1, 4) = 4, (1, 5) = 5, (1, 6) = 6, (1, 7) = 7, (1, 8) = 8, (1, 9) = 9, (1, 10) = 10, (1, 11) = 11, (1, 12) = 12, (2, 1) = 2, (2, 2) = 3, (2, 3) = 1, (2, 4) = 11, (2, 5) = 7, (2, 6) = 9, (2, 7) = 12, (2, 8) = 4, (2, 9) = 10, (2, 10) = 6, (2, 11) = 8, (2, 12) = 5, (3, 1) = 3, (3, 2) = 1, (3, 3) = 2, (3, 4) = 8, (3, 5) = 12, (3, 6) = 10, (3, 7) = 5, (3, 8) = 11, (3, 9) = 6, (3, 10) = 9, (3, 11) = 4, (3, 12) = 7, (4, 1) = 4, (4, 2) = 12, (4, 3) = 6, (4, 4) = 5, (4, 5) = 1, (4, 6) = 11, (4, 7) = 8, (4, 8) = 10, (4, 9) = 2, (4, 10) = 7, (4, 11) = 3, (4, 12) = 9, (5, 1) = 5, (5, 2) = 9, (5, 3) = 11, (5, 4) = 1, (5, 5) = 4, (5, 6) = 3, (5, 7) = 10, (5, 8) = 7, (5, 9) = 12, (5, 10) = 8, (5, 11) = 6, (5, 12) = 2, (6, 1) = 6, (6, 2) = 4, (6, 3) = 12, (6, 4) = 10, (6, 5) = 9, (6, 6) = 7, (6, 7) = 1, (6, 8) = 3, (6, 9) = 11, (6, 10) = 2, (6, 11) = 5, (6, 12) = 8, (7, 1) = 7, (7, 2) = 10, (7, 3) = 8, (7, 4) = 2, (7, 5) = 11, (7, 6) = 1, (7, 7) = 6, (7, 8) = 12, (7, 9) = 5, (7, 10) = 4, (7, 11) = 9, (7, 12) = 3, (8, 1) = 8, (8, 2) = 7, (8, 3) = 10, (8, 4) = 12, (8, 5) = 3, (8, 6) = 4, (8, 7) = 11, (8, 8) = 9, (8, 9) = 1, (8, 10) = 5, (8, 11) = 2, (8, 12) = 6, (9, 1) = 9, (9, 2) = 11, (9, 3) = 5, (9, 4) = 6, (9, 5) = 10, (9, 6) = 12, (9, 7) = 2, (9, 8) = 1, (9, 9) = 8, (9, 10) = 3, (9, 11) = 7, (9, 12) = 4, (10, 1) = 10, (10, 2) = 8, (10, 3) = 7, (10, 4) = 9, (10, 5) = 6, (10, 6) = 5, (10, 7) = 3, (10, 8) = 2, (10, 9) = 4, (10, 10) = 1, (10, 11) = 12, (10, 12) = 11, (11, 1) = 11, (11, 2) = 5, (11, 3) = 9, (11, 4) = 7, (11, 5) = 2, (11, 6) = 8, (11, 7) = 4, (11, 8) = 6, (11, 9) = 3, (11, 10) = 12, (11, 11) = 1, (11, 12) = 10, (12, 1) = 12, (12, 2) = 6, (12, 3) = 4, (12, 4) = 3, (12, 5) = 8, (12, 6) = 2, (12, 7) = 9, (12, 8) = 5, (12, 9) = 7, (12, 10) = 11, (12, 11) = 10, (12, 12) = 1})

G := Group(M,labels=elems);

_m231969395104

 


 

Download Cayley.mw

I don't get an error message for the plot in Maple 2015, just an empty plot. But eval(S,w=1) gives -1.853089027*10^329399 so your numbers seem to be unreasonably large.


 

restart;

A:=(x^3-13*x^2+55*x-73)/(x-1)=0:
p:=numer(lhs(A));
realroot(p)[];

x^3-13*x^2+55*x-73

[169/64, 339/128]


 

Download realroot.mw

[Edited based on Carl's comment]. At least for real parameters (where the Matrix is Hermitian), there must be four eigenvectors.Not setting phi=Pi circumvents the OPs error message, and 4 eigenvectors are found, but then substituting phi=Pi leads to an error.


 

restart;

with(LinearAlgebra):

assume(k1,real,k2,real,m1,real,m2,real,phi,real);

Leave phi unspecified for now

A := <
          <0, 0, exp(I*k1) + m1, exp(I*k2) + m2>|
          <0, 0, exp(I*phi)*(exp(-I*k2) + m2), exp(-I*k1) + m1>|
          <exp(-I*k1) + m1, exp(-I*phi)*(m2 + exp(I*k2)), 0, 0>|
          <exp(-I*k2) + m2, exp(I*k1) + m1, 0, 0>
     >;

A := Matrix(4, 4, {(1, 1) = 0, (1, 2) = 0, (1, 3) = exp(-I*k1)+m1, (1, 4) = exp(-I*k2)+m2, (2, 1) = 0, (2, 2) = 0, (2, 3) = exp(-I*phi)*(exp(I*k2)+m2), (2, 4) = exp(I*k1)+m1, (3, 1) = exp(I*k1)+m1, (3, 2) = exp(I*phi)*(exp(-I*k2)+m2), (3, 3) = 0, (3, 4) = 0, (4, 1) = exp(I*k2)+m2, (4, 2) = exp(-I*k1)+m1, (4, 3) = 0, (4, 4) = 0})

Under the assumptions that the parameters are real, the Matrix is Hermitian and so must have 4 eigenvectors

simplify(A-A^%H);

Matrix([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]])

If we specifiy phi=Pi, we get the OP's error

evals,evecs:=LinearAlgebra:-Eigenvectors(eval(A,phi=Pi)):

Error, (in LinearAlgebra:-Eigenvectors) multiplicity mismatch

If we leave phi unspecified, then we don't get the error message, and get 4 eigenvectors

evals,evecs:=LinearAlgebra:-Eigenvectors(A):
nops(evals),nops(evecs);  #nops always reterns 3, as Carl points out
numelems(evals),numelems(evecs);

3, 3

4, 16

Now specify phi=Pi. Works for the eigenvalues, but not for the eigenvectors. Perhaps some manipulation could improve this, but I'm not sure

evals2:=eval(evals,phi=Pi);
eval(evecs,phi=Pi);

evals2 := Vector(4, {(1) = (2+m1^2+m2^2+2*m1*cos(k1)+2*m2*cos(k2))^(1/2), (2) = -(2+m1^2+m2^2+2*m1*cos(k1)+2*m2*cos(k2))^(1/2), (3) = (2+m1^2+m2^2+2*m1*cos(k1)+2*m2*cos(k2))^(1/2), (4) = -(2+m1^2+m2^2+2*m1*cos(k1)+2*m2*cos(k2))^(1/2)})

Error, numeric exception: division by zero

 


 

Download Hermitian2.mw

When legend is a list there need to be multiple curves, but you had one curve with 3 points. One way to do this is:

display(pointplot([28,.6481496576],color=blue),pointplot([28,.648149657615473],color=orange),pointplot([28,.6512873548],color=red),style=point,labels = ["k", "y(k)"], legend = ["10-digit precision", "15-digit precision", "Floating-point iteration"] ,legendstyle = [font = ["HELVETICA", 9], location = right]);
 

 

Not entirely certain I know what you want, but this may be a start.

[Edit: I changed pi (just a symbol) to Pi (the circle constant thing)]

At the beginning I define i to be sqrt(-1) as you want and D to be a regular variable rather than the differential operator.

Maple gives the answer as a sum over roots of a quartic polynomial. To get a simpler formula, you will need to give values to some variables or parhaps tell Maple their signs (using assuming)

Download Linear_System.mw

As well as Joe's corrections, you need to assign to y (y:=1). 
 

r:=proc(x)
    local y;
    if (x=1)
    then    
    y:=1;
    else
        y:=0;
    end if;
    return y
    end proc;    
 

proc (x) local y; if x = 1 then y := 1 else y := 0 end if; return y end proc

h:=proc(x);
    if (x= infinity)
    then    
    return 1 ;
    else
        return 0;
        end if;
    end proc

proc (x) if x = infinity then return 1 else return 0 end if end proc

r(1);r(2);

1

0

h(1);h(infinity);

0

1

 


 

Download ww.mw

 

I suspect you want gcdex(x^9-a, b*x^6-c, x); but the answer is 1. You may need to specify the numerical value of more of the coefficients.

Try

T := unapply('fsolve'(m(t, c) = -1, t = 0 .. (1/2)*Pi), c, numeric);

In general use unapply to make functions from expressions earlier in the worksheet. The numeric option means that plot and other functions evaluated with a symbolic value will not throw an error.

So the constant _C3 means another condition is required. Presumably you want the solution to drop off at y=infinity.

pdetest suggests your solution does not solve the pde.
 

Download pde.mw

Use := to assign the right-hand side to the left. Some other issues also:

v:= <1 |1| 0>;
w:=<1,1,0>;
M:=<1, 2, 3; 5, 4, 3; 7, 9, 0>;
c:=v.M;
d:=M.w;

v := Vector[row](3, {(1) = 1, (2) = 1, (3) = 0})

w := Vector(3, {(1) = 1, (2) = 1, (3) = 0})

M := Matrix(3, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (2, 1) = 5, (2, 2) = 4, (2, 3) = 3, (3, 1) = 7, (3, 2) = 9, (3, 3) = 0})

c := Vector[row](3, {(1) = 6, (2) = 6, (3) = 6})

d := Vector(3, {(1) = 3, (2) = 9, (3) = 16})

 


 

Download vectors.mw

Try entering in 1D Maple input, e.g. at a > prompt use ctrl-M then `&le;`

You will see that `&le;` is rendered as less-than-or-equals, as it would be in HTML.

Changes in red.
 

 RK2skritt:=proc(FR::procedure,xo,yo,vxo,vyo,h)
 local x, y, vx, vy, r, kx1, kx2, kx3, kx4, ky1, ky2, ky3, ky4, lx1, lx2, lx3, lx4, ly1, ly2, ly3, ly4, tmp;
 r:=sqrt(xo*xo+yo*yo);
 tmp:=-(h*FR(r))/(r);
 lx1:=h*vxo;
 ly1:=h*vyo;
 kx1:=tmp*xo;
 ky1:=tmp*yo;
 lx2:=h*(vxo+0.5*kx1);
 ly2:=h*(vyo+0.5*ky1);
 r:=sqrt((xo+0.5*lx1)^(2)+(yo+0.5*ly1)^(2));
 tmp:=-(h*FR(r))/(r);
 kx2:=tmp*(xo+0.5*lx1);
 ky2:=tmp*(yo+0.5*ly1);
 lx3:=h*(vxo+0.5*kx2);
 ly3:=h*(vyo+0.5*ky2);
 r:=sqrt((xo+0.5*lx2)^(2)+(yo+0.5*ly2)^(2));
 tmp:=-(h*FR(r))/(r);
 kx3:=tmp*(xo+0.5*lx2);
 ky3:=tmp*(yo+0.5*ly2);
 lx4:=h*(vxo+kx3);
 ly4:=h*(vyo+ky3);
 r:=sqrt((xo+lx3)^(2)+(yo+ly3)^(2));
 tmp:=-(h*FR(r))/(r);
 kx4:=tmp*(xo+lx3);
 ky4:=tmp*(yo+ly3);  #edit - one more here
 x:=xo+(lx1+2*lx2+2*lx3+lx4)/(6);
 y:=yo+(ly1+2*ly2+2*ly3+ly4)/(6);
 vx:=vxo+(kx1+2*kx2+2*kx3+kx4)/(6);
 vy:=vyo+(ky1+2*ky2+2*ky3+ky4)/(6);
 [x,y,vx,vy]; end proc:

 

 

Download proc.mw

There is a missing *. The differentiation works in Maple 2017.
 

Download Diff.mw

 

 

restart

Case 1

de1:=diff(U(x),x,x)=0;
bc1:=U(0)=10,U(L)=20;
ans1:=dsolve({de1,bc1},U(x));

diff(diff(U(x), x), x) = 0

U(0) = 10, U(L) = 20

U(x) = 10*x/L+10

Case 2

de2:=diff(U(x),x,x)=-x^2;
bc2:=U(0)=T,D(U)(L)=0;
ans2:=dsolve({de2,bc2},U(x));

diff(diff(U(x), x), x) = -x^2

U(0) = T, (D(U))(L) = 0

U(x) = -(1/12)*x^4+(1/3)*L^3*x+T

 

 


 

Download rod.mw

First 61 62 63 64 65 66 67 Last Page 63 of 83