acer

32348 Reputation

29 Badges

19 years, 329 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Since there has been exporting to image files in this thread, Robert may have had in mind something close to the trusty, dusty 640x480 (4:3) vga standard graphics mode. See also vesa.

acer

Since there has been exporting to image files in this thread, Robert may have had in mind something close to the trusty, dusty 640x480 (4:3) vga standard graphics mode. See also vesa.

acer

Did you mean you instead pass [result] as the first argument to pointplot, ie. the expression sequence result wrapped in a list.

And did you want to instead create result so that it took the rhs() of f(i)? You want result to be a list of lists, with each inner list having two purely numeric entries (not equations).

result := seq([i, rhs(f(i))], i = 0 .. 25);

plots:-pointplot([result]);

acer

Did you mean you instead pass [result] as the first argument to pointplot, ie. the expression sequence result wrapped in a list.

And did you want to instead create result so that it took the rhs() of f(i)? You want result to be a list of lists, with each inner list having two purely numeric entries (not equations).

result := seq([i, rhs(f(i))], i = 0 .. 25);

plots:-pointplot([result]);

acer

It is a shame that the newer NumericalAnalysis:-IsMatrixShape doesn't behave like LinearAlgebra:-IsDefinite does with respect to nonsymmetric Matrices and the positive-definite check. It might be a recent coding oversight (read: bug) in the NumericalAnalysis package.

As mentioned above, the definition used by IsDefinite is that the scalar quantity computed by x^%T.M.x , for any Vector x not all zero, is strictly greater than 0 for a positive-definite Matrix. That's a fine definition, regardless of whether the Matrix is symmetric.

In the case that the Matrix M happens to be symmetric the eigenvalues will also be [not only real but also] strictly positive. That doesn't hold in the nonsymmetric case, and so isn't the general definition. OK.

Now, any real Matrix M can be split into two parts, one of which is symmetric and the other of which contributes nothing to x^%T.M.x . Since the two parts add up to be equal to M the whole, one need only test the symmetric part of M in order to ascertain whether M is positive definite. That`s what LinearAlgbera:-IsDefinite does.

> M:=Matrix([[1,0],[1/2,1]]):

> (M+M^%T)/2 + (M-M^%T)/2 - M; # two parts, add to equal the whole
                                 [ 0 0 ]
                                 [     ]
                                 [ 0 0 ]

> N:=(M+M^%T)/2: # so-called "symmetric part" of M

> Student:-NumericalAnalysis:-IsMatrixShape(N,positivedefinite); # good
                                    true

> <a,b>^%T . (M-M^%T)/2 . <a,b>; # contributes nothing
                                      0

> LinearAlgebra:-IsDefinite(M); # good
                                    true

> Student:-NumericalAnalysis:-IsMatrixShape(M,positivedefinite); # oh dear
                                    false

acer

In this particular case, I think that `simplify` could be expected to do better.

If there is no `ds` then it can get shortened to a form using both sin(x)^2=1-cos(x)^2 and cos(x)^2=1-sin(x)^2. But that trig simplification gets missed when the terms appear in a coefficient of a polynomial in ds.

> simplify((sin(x)^2-1)*sin(x)*(1-cos(x)^2));
                                     3       2
                              -sin(x)  cos(x) 

> T:=(sin(x)^2-1)*sin(x)*(1-cos(x)^2)*ds+dt;
                 /      2    \        /          2\        
                 \sin(x)  - 1/ sin(x) \1 - cos(x) / ds + dt

> simplify(T); simplify(T,trig); # worth an SCR
                                  2                4        
                 -sin(x) ds cos(x)  + sin(x) cos(x)  ds + dt
                                  2                4        
                 -sin(x) ds cos(x)  + sin(x) cos(x)  ds + dt

> Tsimp:=map(simplify,(collect(T,ds)));
                                 3          2     
                          -sin(x)  ds cos(x)  + dt

> coeff(Tsimp,ds);
                                     3       2
                              -sin(x)  cos(x) 

> coeff(T,ds);simplify(%);
                     /      2    \        /          2\
                     \sin(x)  - 1/ sin(x) \1 - cos(x) /
                                     3       2
                              -sin(x)  cos(x) 

acer

In this particular case, I think that `simplify` could be expected to do better.

If there is no `ds` then it can get shortened to a form using both sin(x)^2=1-cos(x)^2 and cos(x)^2=1-sin(x)^2. But that trig simplification gets missed when the terms appear in a coefficient of a polynomial in ds.

> simplify((sin(x)^2-1)*sin(x)*(1-cos(x)^2));
                                     3       2
                              -sin(x)  cos(x) 

> T:=(sin(x)^2-1)*sin(x)*(1-cos(x)^2)*ds+dt;
                 /      2    \        /          2\        
                 \sin(x)  - 1/ sin(x) \1 - cos(x) / ds + dt

> simplify(T); simplify(T,trig); # worth an SCR
                                  2                4        
                 -sin(x) ds cos(x)  + sin(x) cos(x)  ds + dt
                                  2                4        
                 -sin(x) ds cos(x)  + sin(x) cos(x)  ds + dt

> Tsimp:=map(simplify,(collect(T,ds)));
                                 3          2     
                          -sin(x)  ds cos(x)  + dt

> coeff(Tsimp,ds);
                                     3       2
                              -sin(x)  cos(x) 

> coeff(T,ds);simplify(%);
                     /      2    \        /          2\
                     \sin(x)  - 1/ sin(x) \1 - cos(x) /
                                     3       2
                              -sin(x)  cos(x) 

acer

This is the first parser difference I mention here.

acer

This is the first parser difference I mention here.

acer

It's a bug in the documentation only, I think, that it doesn't describe the nonsymmetric case.

The term "positive definite" refers to what sign the scalar value x^%T.A.x can take on for any nonzero column Vector x, rather than (always) what sign the eigenvalues have. Hence Robert's example below is not a counter-example to match your bracketed/ie description, I think.

Now, some texts state the definition of the term "positive definite" by stating that "A symmetric/hermitian matrix is positive-definite if..." and so of course with that wording the symmetric aspect is built right into the concept. And for a symmetric/hermitian Matrix the positive-definiteness matches whether the eigenvalues are all positive. But the definition needn't be taken as always including the symmetric quality.

Modulo bugs, you ought to be able to rely on IsDefinite for nonsymmetric Matrices.

Having said that, I sort of remember that there was a short-lived (1 release, then fixed, maybe in Maple 12?) glitch introduced in the recent past for the nonsymmetric case. It's Sunday afternoon,... and I hope that I haven't remembered that situation all wrong.

acer

That looks nice. I notice that you had to find an acceptable X (as described above), here based on some extra knowledge about the source.

"..in the car example you might be able to state a range for acceptable width of clusters on the basis of ...[].. and the known car speeds."

acer

That looks nice. I notice that you had to find an acceptable X (as described above), here based on some extra knowledge about the source.

"..in the car example you might be able to state a range for acceptable width of clusters on the basis of ...[].. and the known car speeds."

acer

An uncharacteristic slip. Perhaps Joe meant [{L[]}[]]

;)

acer

An uncharacteristic slip. Perhaps Joe meant [{L[]}[]]

;)

acer

I'm sorry, but I've been very busy with real-life commitments. I haven't forgotten, though. It's "on my list".

acer

First 463 464 465 466 467 468 469 Last Page 465 of 592