Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 364 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@sunflower wrote:

I don't know how to create a matrix which have det=2. I don't understand

Multiplying a row or column of a matrix by c causes the determinant to be multiplied by c. So, multiplying a whole matrix by c^(1/n), c > 0, causes the determinant to be multiplied by c.

@vv Thanks for spotting the problem and suggesting the solution. Correcting the sign with signum(det) doesn't always work. Here's some corrected code:

restart:
macro(LA= LinearAlgebra):
n:= 9:
while not det::positive do
     A:= LA:-RandomMatrix((n,n), datatype= float[8], shape= symmetric);
     det:= LA:-Determinant(A)
end do:
A:= (2/det)^(1/n)*A;

@JohnS Take heart, John S: Your posted solution is far more elegant than my first two attempts, each of which I almost posted. The first of these was to multiply the first row by 2/det. The second was to take the first attempt and multiply by a random permutation matrix and then adjust for the sign of the permutation.

So, I promoted your Reply to an Answer and gave it a vote up.

Note that your code doesn't use RandomTools.

For more-elegant posts, note that you can use Shift-Enter in MaplePrimes to avoid those ugly blank lines between lines of code.

@tomleslie The OP picked up this usage of uses from reading my code examples. 

Stylistically, I object to the form

uses <package 1>, <package 2>, ...;

preferring instead the form

uses <abbrev 1>= <package 1>, <abbrev 2>= <package 2>, ...;

The reason that I object to the former is that it makes it difficult for a reader to know which global names come from which packages and which come from the writer's own definitions.

Likewise, I generally object to using the with command and I use instead, for example,

macro(LA= LinearAlgebra);

I will use a with command to load overloaded operators from a package; using infix operators in prefix form with a package prefix is too much for me.

 

 

@Ramakrishnan The midpoint methods avoid evaluating a BVP system at the boundary points, and thus avoid some singularities. You can access them using option method= bvp[midrich] or method= bvp[middefer]. See help page ?dsolve,numeric,bvp.

What makes you (Sunflower) think that there are errors?

@asa12 You are correct that the bracket represents dot product. The symbol that you're transcribing as 1_i_j is almost certainly the Kronecker delta. It's defined as 1 if i = j, and 0 otherwise.

Each entry of the matrix product A.B (for real-valued A and B) comes from taking the dot product of one row of A with one column of B. So yes, the matrix product B.B^* is equivalent to taking the dot product of each vector with each other vector, including with itself.

@asa12 The essential part of the computation is the B.B^*; the simplifyfnormal~, and zero are only there to remove the spurious infintesimal imaginary parts caused by round-off error.

I don't know in which version of Maple the notation B^* for the conjugate transpose (aka Hermitian transpose) was introduced. If your Maple 15 objects to this, then B^%H will certainly work (the H standing for Hermitian).

Regarding the "definition" of orthonormality that you claim that your book uses: I think that you're misreading it, and certainly it's wrong. The correct definition is

@John Fredsted Here are two facts that can help you to produce session-independent results:

1. Code that uses randomly generated data will execute using the same random numbers in different sessions as long as you start from restart and don't use the randomize() command.

2. The order that items are listed in Maple sets is session independent. This was not always the case, but it's been true for several years now.

@Markiyan Hirnyk Why replace plottools with plots? Neither is necessary. Nor is the presence of plottools the source of any trouble. The command plot is top-level, not in any package.

@zia9206314 Executing your worksheet, and then executing the command

p1;

I get this plot

It only takes about one second.

@Just_Some_Guy Yes, I saw the attached file. It contains what you've done so far. I want to see an example of what you want as the final product: a plot with error bars.

@tazatel I think that your main problem is that decimal numbers need to be entered with a decimal point rather than a comma. In other words, what you have entered as 0,0215 must be entered as 0.0215 or .0215 or 2.15e-2, etc.

I need a clarification of the problem statement. What does "exactly two points lie astride every [one] of these lines" mean? Using the colors in your example, does it mean "exactly two [blue] points lie astride every [one] of these [red] lines"? Still, I don't know what "astride" means. My first guess is that it means that if we form the six line segments determined by the blue points, then each of the red lines is intersected by exactly one of these line segments. However, that isn't true for the example diagram. A second guess is that each of the eight red rays and eight red line segments is intersected by exactly one of the line segments determined by the blue points. In that case, we need to deal with the complication that there are some triple intersections.

@Markiyan Hirnyk I base my comments just on careful observation of MaplePrimes over the past three years. Jon Mcloone has made no post in the past three years. If he had, I certainly would've upvoted it. I read everything on MaplePrimes, so I certainly would've seen it. I've seen Comments by Mcloone, but not Posts.

Some Comments by Mcloone can be found in the thread http://www.mapleprimes.com/posts/201237-Comparisons

His Users' page is http://www.mapleprimes.com/users/JonMcloone

First 446 447 448 449 450 451 452 Last Page 448 of 709