mmcdara

3815 Reputation

17 Badges

6 years, 123 days

MaplePrimes Activity


These are questions asked by mmcdara

Not that I can't sleep quietly without it, but why is the possibility of receiving a vote or being selected as the best answer (ok, this rarely happens) no longer proposed in my replies?
For instance, in a recent reply (not the one I'm the prouder of) the header appears like this, witho ot thum nor star below "1 hour ago")


TIA

Hi, 
I wonder what is I in MAPLE?
Obviously I is not an indeterminate

z := a+I*b:
indets(z);

# but

has(z, I)
                             {a, b}
                              true

What does this answer mean:

whattype(I);
                   complex(extended_numeric)

I would have thought that  I was some kind of protected symbol such as Pi, but it's not

attributes(Pi);
attributes(I);
                           protected

In fact, trying to assign 1 to I just returns an error saying this is not legal assignment

I:=1
Error, illegal use of an object as a name

So, what is I in Maple?

Thanks in advance

Hi,

It seems that it's not possible to change the tickmarks on axis 2 of a sparsematrixplot.
Mire of this, trying to change them seems to suppress them...
Perhaps this was a problem in Maple 2015 which has since been corrected?
By any chance, would you have a trick to correct this?

TIA
 

restart:

interface(version)

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

M := LinearAlgebra:-RandomMatrix(20,density=0.25,generator=0 .. 1);

M := Vector(4, {(1) = ` 20 x 20 `*Matrix, (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

(2)

plots:-sparsematrixplot(
   M, matrixview
);

 

plots:-sparsematrixplot(
   M, matrixview
  ,axis[1]=[tickmarks=[seq(i=i-1, i in [seq](1..20, 5))]]
  ,axis[2]=[tickmarks=[seq(j=j-1, j in [seq](1..20, 5))]]
);

 

plots:-sparsematrixplot(
   M, matrixview
  ,axis[2]=[tickmarks=[seq(i=i-1, i in [seq](1..20, 5))]]
);

 

 


 

Download sparsematrixplot.mw

Hi, 

Working with Legendre Polynomials (LegendreP) I observed that solve doesn't find the correct number of zeros.
More precisely, for N > 17, solve(LegendreP(N, x)) finds less zeros than N.

I wrote a procedure based on a theorem about the intertwined location of the zeros of orthogonal polynomial of successive degrees. So this problem is not blocking, but I would like to understand while solve(LegendreP(N, x)) doesn't always do the job.

Thanks in advance.
 

restart:

Z := n -> op~(2, { allvalues(solve(LegendreP(n,x))) } );

proc (n) options operator, arrow; `~`[op](2, {allvalues(solve(LegendreP(n, x)))}) end proc

(1)

Digits:=10:
Z(17):
numelems(%);

17

(2)

Z(18):
numelems(%);

16

(3)

Digits:=15:
Z(18):
numelems(%);

16

(4)

Digits:=20:
Z(18):
numelems(%);

15

(5)

Zf := n -> op~(2, { allvalues(solve(evalf(LegendreP(n,x)))) } );
Z(18):
numelems(%);

proc (n) options operator, arrow; `~`[op](2, {allvalues(solve(evalf(LegendreP(n, x))))}) end proc

 

15

(6)

# Let z[N][i] the ith zero of any orthogonal polynomial P(N,x) of degree N.
#
# It is known that each open interval(z[N][i], z[N][i+1]) contains
# exactly a unique zero of the of P(N+1,x).

Z17 := [ -1, Z(17)[], 1]:
Z18 := NULL:
for n from 1 to 18 do
  Z18 := Z18, fsolve(LegendreP(18,x),  x=Z17[n]..Z17[n+1]);
end do:
numelems({Z18})

18

(7)

# A procedure to compute zeros of LegendreP up to degree N


zeros := proc(N)
  local zeros_table, Z, n, p, z:
  zeros_table := table([0=[]]):
  Z := [-1, 1]:
  for n from 1 to N do
    z := NULL:
    for p from 1 to n do
      z := z, fsolve(LegendreP(n,x),  x=Z[p]..Z[p+1]);
    end do;
    zeros_table[n] := [z]:
    Z := [-1, z, 1]
  end do;
  return zeros_table
end proc:


 

Download LegendreP_zeros.mw

Hi, 

A few times ago a trainee asked me this question
         "given a matrix formula, can Maple find the transpose of this formula?"

More precisely, let's say E, A, B and C are four (abstract) matrices (let's say symbols) with consistent dimensions such that E = A+B*C, can Maple "find" that ET = AT + CT * BT (where  ET represents the transpose of E)?

I come back to this problem regularly because the trainee was quite frustrated by my negative answer (note she had the same request form the inverse of a matrix formula).

The best I'm capable to do is given in the attached file (transposition only).
This seems to work correctly even if did not do intensive testing.

Do you have any ideas on how to implement the transposition and inversion computation rules in Maple?
For example, given 

E := A &* B^(-1))

Maple would return 

Transpose(E);
      (B^(-1))^T &* A^T 
# or better   E^(T) = (B^T)^(-1) &* A^T
# and 
Inverse(E);
   B &* A^(-1)


Thanks in advance for you involvement
 

restart:

Transpose := proc(e)
  local tr, t:

  tr := `#mo("т")`:

  define(
    t,
    t(`&*`(a::anything, b::anything)) = &*(b^tr, a^tr),
    t(a::anything+b::anything)=a^tr+b^tr,
    t(a^tr)=a,
    'linear', 'flat'
  ):
 
  t(expand(e));

  return eval(%, map(u -> (u^tr)^tr = u, indets(e, name)));
end proc

proc (e) local tr, t; tr := `#mo("т")`; define(t, t(`&*`(a::anything, b::anything)) = `&*`(b^tr, a^tr), t(a::anything+b::anything) = a^tr+b^tr, t(a^tr) = a, 'linear', 'flat'); t(expand(e)); return eval(%, map(proc (u) options operator, arrow; (u^tr)^tr = u end proc, indets(e, name))) end proc

(1)

Transpose(A+B)

B^`#mo("т")`+A^`#mo("т")`

(2)

Transpose(2*A + B &* C)

2*A^`#mo("т")`+`&*`(C^`#mo("т")`, B^`#mo("т")`)

(3)

Transpose((A + B) &* (A + B))

`&*`(A^`#mo("т")`, A^`#mo("т")`)+`&*`(B^`#mo("т")`, A^`#mo("т")`)+`&*`(A^`#mo("т")`, B^`#mo("т")`)+`&*`(B^`#mo("т")`, B^`#mo("т")`)

(4)

Transpose((A + B) &* Transpose(A + B) + Transpose(Transpose(A)) )

`&*`(B, A^`#mo("т")`)+`&*`(A, A^`#mo("т")`)+`&*`(B, B^`#mo("т")`)+`&*`(A, B^`#mo("т")`)+A^`#mo("т")`

(5)

 


 

Download transposition.mw

First 11 12 13 14 15 16 17 Last Page 13 of 33