AmusingYeti

135 Reputation

8 Badges

6 years, 113 days

MaplePrimes Activity


These are questions asked by AmusingYeti

Is there a means of getting Maple to detect and print the operating system which it is being run on? Searching for this topic is awkward as it returns page after page of troubleshooting guides on how to get Maple running on different operating systems.

Conventionally in Bash I would use something like: echo $(uname)

I am solving a very ill-conditioned generalised matrix eigenvalue problem which has the form (Apologies, the Maple Math input option is not working at all)

Av = aBv

Where A and B are matrices, a are the eigenvalues and v the eigenvectors.

Matrix, B, has a condition number of 1E40 which means Cholesky decomposition, Schur decompositions etc... are highly unstable. I have found that by transforming all the diagonal matrix elements of matrix B to one greatly reduces the condition number (down to 1E25).

To do this I divide the elements on each row by the row element which sits on the diagonal of the matrix, which is shown for a basic 3x3 example:

[1,2,3]
|4,5,6|
[7,8,9]

Becomes:

[1,2,3]
|4/5,1,6/5|
[7/9,8/9,1]

Is there a name for this particular matrix transformation? I also do the same operation to matrix A but using the diagonal elements of B.

Many thanks

-Yeti

I have written a Maple code which extracts terms in a matrix into two new matrices dependent on certain markers. I am running into problems with this particular code as it requires enormous amounts of RAM when going to large matrix sizes (32GB+); and will take 4-5 days to complete for larger matrix sizes, or simply crashes.

Each matrix element is an algebraic expression containing A and B and the markers hh and ss. The example in the attached Maple file (3 x 3 matrix) is a minimal working example and the actual expressions are much longer and the matrices much larger (5000 x 5000 or larger). I utilise the symmetry of the matrix to ease the process, and use the tril command of MTM to extract only the lower triangular matrix; as this is all that is needed for the next stage (I have yet to test how efficient this command is, but use it for now).

The two markers hh and ss are targeted and if found in an expression that term will be extracted accordingly. The matrix elements are expanded and a procedure run over the matrix and will extract terms with hh into one matrix and terms with ss into another matrix. I think the map(expand,...) part is what causes the memory issue; but I believe this needs to be done to correctly extract terms.

Any help or tips are greatly appreciated on how to increase efficiency and improve this method.
 

Sub_matrix_extraction.mw

-Yeti

 

 

Converting a mathematical expression into postfix notation (also known as Reverse Polish Notation (RPN)) is a great way to speed up evaluation of arithmetic using a stack.

I was wondering if Maple has any inbuilt functionality to convert a string in infix notation to one in postfix notation? As a simple example:

(A + B * C) / (D + E * F)

Looks like this in RPN:

A B C * + D E F * + /

I cannot find anything with regards to Maple implementations of this. It would save me time to not have to write a RPN calculator in Maple if there is one already floating around somewhere. I would like to use Maple to output strings in RPN which can then be evaluated faster in another language.

 

-Yeti

I am writing a matrix to file where each matrix element is placed on a new line. An example of such code:

restart:
HH:=Matrix([[x**2,x**z,z**12],[2*x,5**y,6**1]]):
filenameHH:=fopen("test.txt",WRITE,TEXT):

nRow,nCol :=LinearAlgebra[Dimension](HH);
for i from 1 to nRow do
   for j from 1 to nCol do
      fprintf(filenameHH,"%a\n",HH[i,j]):
   od:
od:
fclose(filenameHH):

When this is printed to file, it will print as the power sign ^ regardless of the input it is given. This particular output file will be read in by another language, and due to this the power symbol "^" is not desired, but instead " ** ". By converting the matrix into a string format and applying string operations, this can be done; but is there a simpler way to do it?

-Yeti

1 2 3 4 5 Page 1 of 5