Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I have two symmetric real matrices as below (Mt,Kk).

I multilpy them in Mt.Kk.Mt.

But the result is not symmetric.!!!!why????

 

``

restart; with(LinearAlgebra)

Error, invalid input: with expects its 1st argument, pname, to be of type {`module`, package}, but received shareman

 

Mt := ImportMatrix("C:/Mt.mpl"); -1; Norm(Mt-LinearAlgebra:-HermitianTranspose(Mt), 2)

0.

(1)

Kk := ImportMatrix("C:/Kk.mpl"); -1; Norm(Kk-LinearAlgebra:-HermitianTranspose(Kk), 2)

0.

(2)

Aa := Typesetting:-delayDotProduct(Typesetting:-delayDotProduct(Mt, Kk), Mt); -1; Norm(Aa-LinearAlgebra:-HermitianTranspose(Aa))

4608.00000953674316

(3)

Aa

RTABLE(18446744074182082558, complex[8], Matrix, rectangular, Fortran_order, [], 2, 1 .. 45, 1 .. 45)

(4)

``

``

``

``

``

``

``

``

``

``

``

``

``

Download question.mw

I couldnt upload Kk.mlp and Mt.mlp so changed their extensions to mw. for using please change them to .mlp

Download Kk.mw

Download Mt.mw

 

I have been looking at a method for computing the inverse of a periodic, tridiagonal, matrix (tridiagonal with non-zero elements in (1,n) and (n,1), where n is the order of the matrix).

Using test matrices with rational elements I get a good improvement in execution time compared to Maple's MatrixInverse procedure from LinearAlgebra. However when I use algebraic elements I get faster times with small orders but from around
n=25 (for a particular example matrix) my method is running slower than MatrixInverse.

If I look at the element (1,1) of the inverse returned by both procedures I see that the Maple inverse is quite compact while the value returned by my procedure is very complex (on printing Maple extracts 17 subexpressions of varying complexity). I
have a check in the test rig to determine if the two inverses are the same; this uses

evalb(simplify(AinvMaple[i,j]-Ainv[i,j])==0)

and all the elements do agree.

The Maple MatrixInverse appears to be able to simplify the elements of the inverse; is this a feature of the algorithm that's being used or is there some mechanism I should be using to achieve this?

The source code of the procedure I've written (first 100 odd lines) and the test rig are attached. The file is set up to run the algebraic test (Test4) for n=20 and to print the (1,1) inverse elements generated by both the Maple and my procedures.

Any help in improving my code to produce simplified forms of the elements would be greatfully received.

Maple source as text file: KilicInv.txt

Hi everybody,

The Collatz conjecture can be used to give students a taste of a topic in Number Theory.  See the Wikipedia article for a good explaination.

https://en.wikipedia.org/wiki/Collatz_conjecture

Also, a conjecture is something that is probrably true.  Enjoy my little Maple procedure.  (in .mw and .pdf forms)

Collatz_third_time.mw

Collatz_third_time.pdf

Comments are appreciated.

Matt

 

I have two figures that's generated in Maple (by plot), then pasted them to a worksheet, which I would like to export them to PDF format with exactly the same as it seems on Maple, meaning that these two figures need to be on the same row.

However, in the exported PDF, these two figures are always in two rows: see Fig_1.mw and Fig_1.pdf 

What I tried was: to really resize these two figures into very small size, and the export works, however, I also need three figures or four figures in one row. See Fig_2.mw and Fig_2.pdf

So there is actually two questions:

1. Can I specify some parameters in Maple such that the exported PDF is exactly 'what I see is what I get'?

2. If #1 is impossible, where can I get the information on: width of the exported PDF, how to specify the precise size of plot command etc

Thanks,

does anybody know how to copy a rtable structure in a worksheet and paste it on the other worksheet?

I copy it by right click and paste on the other one but no data transfered.

How to express a chemistry equation in prefix expression

I have noticed this a couple of times now. If I  do a Saveas on a workbook document A to a new name B. Close maple. Reopen and load the new workbook document B it retains the old file name in the header bar and at the top of the workbook document list. The new filename is shown across the dark part at the top along with the old file name. The only fix I found the last time was to export the workbook as  B.mw, then saveas to B.maple and reattach documents. Painful.

 

 

Hi everyone!

I would really appreciate if someone could give me a hand on telling me what is wrong with this problem! pdsolve gives the error: Error, (in pdsolve/sys/info) found functions with same name but depending on different arguments in the given DE system: {f(0, y), f(x, 0), f(x, y), (D[2](f))(0, y), (D[2](f))(x, 0)}.


Thanks in advance!!! 




 

 

Hello,

I want to check via Maple whether the term is always bigger than c/4 (it is), but using verify(TERM, c/4, greater_than) just returns FALSE. I did assume(a > 0, b > 0, -1 <= c and c <= 1); It would be nice if you could tell me what exactly is causing the problem and how to solve it.

Thanks in advance

(9*a^3*b^3*c^2+4*a^6*c+16*a^5*b*c+47*a^4*b^2*c+82*a^3*b^3*c+47*a^2*b^4*c+16*a*b^5*c+4*b^6*c+16*a^5*b+80*a^4*b^2+132*a^3*b^3+80*a^2*b^4+16*a*b^5)*(a+2*b)^2*(a+b)^2*(2*a+b)^2/((4*a^6+28*a^5*b+77*a^4*b^2+106*a^3*b^3+77*a^2*b^4+28*a*b^5+4*b^6)*sqrt(-9*a^2*b^2*c^2+32*a^3*b*c+62*a^2*b^2*c+32*a*b^3*c+16*a^4+80*a^3*b+132*a^2*b^2+80*a*b^3+16*b^4)*sqrt(-9*a^4*b^4*c^2+24*a^6*b^2*c+28*a^5*b^3*c-14*a^4*b^4*c+28*a^3*b^5*c+24*a^2*b^6*c+16*a^8+112*a^7*b+276*a^6*b^2+296*a^5*b^3+220*a^4*b^4+296*a^3*b^5+276*a^2*b^6+112*a*b^7+16*b^8))

 

Here, I have a 3D map T=(T1,T2,T3) with

T1(x1,x2,x3)=x1*exp(6-2*x1-x2-0.3*x3),

T2(x1,x2,x3)=x2*exp(5-2*x1-2*x2-*x3),

T3(x1,x2,x3)=x3*exp(8-0.2*x1-x2-x3),

How can I use  IterativeMaps:-Attractor obtain the attractor for T.

After 3 hrs trying I give up.  I am a Maple newbie.

I need to read a plain text file, where each line contains 12 fields in it.

The fields are comma separated.  But some of the fields are quoted strings. Here is an example of one line below. I can read the line OK, as a string, using readline(), but I do not know how to split it correctly into 12 fields inside Maple once read, so I can access each field easily and make any changes I want.

The problem is that, once I read the line using readline(), it comes in as string. But it has string embeded in it allready, since the line in the file, allready has quoted string as fields.

Here is one line in file foo.txt

1,2,3,4,0.1,5,"int(x^2,x)","\frac{x^3}{3}",6,7,"(2*x + 1)^(3/2)/3","A"

Each line has the same number of fields. 12.  Now I do this:

current_line:=readline("foo.txt");

And now current_line is

"1,2,3,4,0.1,5,"int(x^2,x)","\frac{x^3}{3}",6,7,"(2*x + 1)^(3/2)/3","A""

And here I am stuck. I tried StringTools[Split], I tried sscanf, tried readata, and nothing worked. For example, if I do

sscanf(current_line,"%d,%d,%d,%d,%f,%d,%s,%s,%d,%d,%s,%s");

The result is

[1, 2, 3, 4, .1, 5, ""int(x^2,x)","\frac{x^3}{3}",6,7,"(2*x"]

The fields are

[integer,integer,integer,integer,float,integer,string,string,integer,integer,string,string]

The problem is the embeded string. I am sure there is a Maple function to do this easily, I just can't find it.

What is the correct way to read these lines, and split them into a Matlab list (of lists) so I can access them easily inside Maple?

Using Maple 2016.2

 

 

I tryed this, because i thought i might be abel to shade this new piecewise function later on, but i dont know how to tell maple that there is 2 y-axes values in the interval from (2;3):

so it failed. 

pleace help regards Niklas.

 

The commands below are from a response by Carl Love to a question posed on February 27, 2016.

Variable t is not mentioned in the plot of f. Does t assume one or more particular values in the construction of the plot?

When t is given a specific value before executing the plot command, the resulting plot appears to be independent of t's value.

What is the logic behind the plot's construction?

f:= cos(2*t/m) + cos(2*(t+5)/m):
plot('maximize'(f), m= 1..10);

Hi

I have a nonlinear PDEs, solved using finite difference in the square

I get the following nonlinear system of equation. Is there any idea how correct the code and display the solution.

I will appreciate any help in this question.

 

restart;
n:=100;
h:=1/(n+1);

# Boundary condition

for j from 0 by 1  to n+1 do
u[0, j] = 0;
u[n+1, j] = 0;
u[j, 0] = 0;
u[j, n+1] = 0 ;
end do;
## Loop for interior point in the square
for i from 1 by 1 to  n do
for j from 1 by 1 to  n do
(u[i+1, j]-u[i, j])*(u[i+1, j]-2*u[i, j]+u[i-1, j])+h*(u[i, j+1]-2*u[i, j]+u[i, j-1]) = 0;
end do;
end do;
 

How can I solve this system of equations with unknown u[i,j], where i,j=1,..,n

 

Many thanks for any help


Generate 8 random 3 by 3 matrices using the RandomMatrix command from the  LinearAlgebra package. As each matrix is generated use Eigenvalues to compute its eigenvalues. Then take the product of the eigenvalues, and check that for each matrix, this product is equal to the determinant of the matrix.  
 

1 2 3 4 5 6 7 Last Page 1 of 1241