zenterix

310 Reputation

4 Badges

3 years, 97 days

MaplePrimes Activity


These are questions asked by zenterix

I have the following procedure

export exportCsvMatrix := proc(m:: Matrix, fileName: string)

  ExportMatrix(fileName, m, target=csv):

end:

However, I would like to be able to pass a list of matrices as well.

How can I add a parameter type that is Matrix or list of Matrix?

I have a very difficult time finding things in the documentation.

I would like to see documentation for `<,>` and `<|>`, as in `<,>`(1,2,3,4).

If I write ?<|> in Maple I get

If I do ?<,> I get

However, there is no mention of the usage of the backticks.

Finally, if I do ?`<,>` I get

No mention of the use of `<,>`. I only know about this from a previous reply to one of my questions and now I have forgotten the details so I am trying to look it up but it's hard to find.

I just spent 5h trying to figure out why when I return a table from a procedure defined in an .mpl file, and then execute that procedure in a worksheet, I can't access the table entries by using regular ol' bracket notation.

I can see the keys and values by using indices and entries and passing in the return value of the procedure, but that's it.

I have tried using eval, and I have even tried reproducing my use case in a simpler worksheet to try to isolate the issue but the issue doesn't appear. I am working in an .mpl file within a larger Maple project. I have read about last name evaluation, and have tried using eval with a numeric second parameter. Nothing works.

The file is very small and contains one single procedure, and it doesn't import any other file.

When I get the return value from my procedure and print it out all I see is the name of the original table defined in the procedure and the subscript I am trying to access, but not the data.

Maddening. 

Consider the following. 

We have a matrix A with five parameters in it.

If we tell Maple to solve Ax=0, it gives us the trivial solution.

Then, if I make a matrix B where I choose specific values for those five parameters and I tell Maple to solve Bx=0 I get a non-trivial solution.

Why doesn't Maple give me a more informative result in the Ax=0 case? 

A := Matrix(5, 5, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = a__1, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (2, 5) = b__1, (3, 1) = -216, (3, 2) = -18, (3, 3) = 0, (3, 4) = 0, (3, 5) = c__1, (4, 1) = 0, (4, 2) = 0, (4, 3) = 1, (4, 4) = 0, (4, 5) = d__1, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 1, (5, 5) = e__1}) = Matrix(%id = 36893488151959194068)NULL

with(LinearAlgebra)

GaussianElimination(A)

Matrix(%id = 36893488151959184316)

(1)

LinearSolve(A, `<,>`(0, 0, 0, 0, 0))

Vector[column](%id = 36893488151959183100)

(2)

B := Matrix(5, 5, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = -216, (3, 2) = -18, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 1, (4, 4) = 0, (4, 5) = 1, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 1, (5, 5) = 4}) = Matrix([[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [-216, -18, 0, 0, 0], [0, 0, 1, 0, 1], [0, 0, 0, 1, 4]])NULL

GaussianElimination(B) = Matrix(%id = 36893488151959174788)NULL

LinearSolve(B, `<,>`(0, 0, 0, 0, 0))

Vector[column](%id = 36893488151959164916)

(3)

``

NULL

An even easier way to show a non-trivial solution is to just make the entire last column zero.

Download polyn_matrix.mw

Consider the following worksheet (perhaps it is better to download the worksheet and execute since the contents below aren't showing the commands used to plot the last two plots).

NULL

T = log(R)/(a+b*log(R))^2

plot(log(R)/(-1.16+.675*log(R))^2, R = 1000 .. 30000)

 

NULL

10^log[10](T) = log(R)/(a+b*log(R))^2

NULL

log[10](T) = log[10](log(R)/(a+b*log(R))^2)

NULL

w = log[10](z/(b*z+a)^2)

w = ln(z/(b*z+a)^2)/ln(10)

(1)

NULL

plot(log[10](z/(-1.16+.675*z)^2), z = log(1000) .. log(30000))

 

NULL

``

NULL

plots:-loglogplot(log(R)/(-1.16+.675*log(R))^2, R = 1000 .. 30000)

 

NULL

 

My question is about making a loglog plot of the equation

for R between 1000 and 30000.

 

The second to last plot is of w as a function of z, as in the last equation below

and the plot command is (where I have subbed in a=-1.16 and b=0.675)

In the second to last plot, of course we have negative values of w. If we were to consider the underlying values of T, they would never be negative of course.

The last plot is the command

I think this last plot is what I want (though I am not sure because I am not totally sure what plots:-loglogplot is doing).

 

My question is how to obtain this loglog plot manually. That is, I want the axes to show values of R on the x axis and T on the y axis (just like a usual loglog plot shows).

In other words, how to go from the second to last plot to the same plot but showing the corresponding R and T values instead of z and w.

Download loglog.mw

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