zenterix

310 Reputation

4 Badges

3 years, 98 days

MaplePrimes Activity


These are replies submitted by zenterix

@mmcdara What do you mean my worksheet doesn't have any plot commands? It contains the command VectorCalculus:-PlotVector(w), where w is a VectorCalculus:-RootVector.

@mmcdara 

About Question 1
I am aware of what can be done using Vector and Matrix. This is indeed what I have been using until a few hours ago. This is extremely useful of course, unless the goal is algebraic calculations using vectors, which is what I need currently. 

Now, it seems I have made a big error in thinking that _i is somehow special: it is not. 

@acer When I close the right panel the issue stops happening.

@Scot Gould By "Context Panel" you mean the righthand side panel, right? What exactly in the context panel are you suggesting would be useful to accomplish the goal of displaying the product of two matrices as matrix 1, a dot symbol, and matrix 2? 

Your attached worksheet has a product of two matrices in 2d math. Writing out the matrices manually as you did in your attached worksheet is definitely a step in the right direction. 

By playing with the UI I found that I can insert such a matrix using the panel on the left-hand side, in the "Matrix" palette. Is there a way to write such a matrix without using this palette, ie a command to do this? 

When I am reasoning through a problem or learning something new, I like to create worksheets where I sort of go through my reasoning. There is text and also formulas and things like matrices. I think I can use your solution in such worksheets.

@Jean-Claude Arbaut I created a new Worksheet in Worksheet Mode and wrote out the commands there. Here is the worksheet: MatrixEvalWorksheetMode.mw

Did not work.

I checked with Maple Input. It works. So the issue is the type of input not the worksheet mode.

Having to use Maple Input rather than 2d Input removes at least half the benefit and pleasure of using Maple.

@Carl Love I simply copied your code into a worksheet and pressed Enter. 

If I try to look at the code more closely, I see a proc called Trans. Most of the code (the operators) are beyond my current level of understanding of Maple. I see the following line of code

F := <1,2;3,4>: I:=<1,0;0,1>: `0`:= Matrix(2,3,0):

The correct backticks are being used on the 0 there. I even deleted them and put them in again manually.

I still see the error.

Here is the code in a worksheet: MatrixEval2.mw

@Kitonum The A% part stays that way in the output. MatrixEval.mw

@Scot Gould No, I am not talking about non-executable math.

Now, up to this point I have been using non-executable math, but then I decided it was time to ask the current question, which is about how I can actually see the pretty output of using executable math. I'd like to see the matrices in the usual format that would be used if I were writing this out on paper.

@Carl Love "Error, illegal use of an object as a name" when I run the code above in a Maple worksheet. That is some mindbogglingly  complicated code to accomplish this simple task. 

@Axel Vogt I want to see the actual matrix A then a dot then the actual matrix B

@acer Here is what the Maple research team says about this

"Maple's engine typically has no problem with these animations, but the GUI can easily get overloaded. You can make the simple example work by ending it with a colon instead of a semicolon so that the animation gets computed on the engine side, but not displayed. Unfortunately, you can't really do anything with this animation: both displaying it in the GUI directly, and trying to export it to e.g. GIF (which is done by the GUI, even if you use the command line command for it), fail.

The one approach that they could see working is using an entirely different approach for animation, where the frames are generated on the fly and displayed in a plot component. You can adapt the above example as follows:

with(DocumentTools):
with(Layout):
with(Components):
xml := Worksheet(Group(Input(Textfield(Plot(identity = "P"))))):
tbl := InsertContent(xml, output = table):
P_name := tbl["P"]; r := rand(0 .. 1):
testData := Matrix([seq([r(), r(), r()], i = 1 .. 10^4)], datatype = float[8]):
do_animation := proc() 
   local i:
   global testData, P_name:
   for i to upperbound(testData, 1) do 
      DocumentTools:-SetProperty(P_name, 'value', plots:-pointplot3d(testData[i], symbolsize = 100, view = [(-1 .. 2) $ 3], caption = sprintf("frame %d", i)), refresh = true):
   end do:
end proc:
do_animation():

I just wanted to leave this here in case it interests anyone. I don't know half the commands above yet.

@acer The parallelization is something that happens before this entire discussion of animations. 

In the current discussion, I provided a 10000x3 matrix where each row is a point in a trajectory. This matrix is actually an average of n trajectories. To compute the n trajectories, I use parallelization. That part works. 

Now, given the matrix, I want to create the animation.

Your suggestion of computing each frame on the fly seems to be the way but I am not sure how to do this in Maple. In python or javascript, for example, you pass a function to the animation function, and the former provides the next frame.

I am actually trying the animation in Python right now and it seems quite promising (though it is always a painful learning curve to start doing something in matplotlib after you haven't used it in a long while). 

@acer The trajectory is that of a qubit. Different trajectories are computed for different physical models. The objective is to be able to see the animations and analyze them to obtain insight into the physical modelling. So, it would be great to see it in Maple. It would be great to be able to save a specific animation to see it again later and compare with animations for other parameters/models.

What do you mean "compute each frame if done sequentially"?

@Rouben Rostamian @acer Here is an even simpler example in the sense that all I did was take an example from the docs of plots:-animate that contained the default 25 frames and increased the frames to 5000. Uses a lot of memory and takes forever. EvenSimplerExample.mw

I am inclined to conclude that the issue is with Maple plot procedures. Imagine trying to generate 100000 frames.

@acer @Rouben Rostamian

Here is a way simpler example of the problem: SimpleExample.mw

This just generates a 10000x3 matrix of 0s and 1s. Then it creates a sequence of calls to pointplot3d with one row from the matrix, and displays this insequence. 

This already uses huge amount of memory. This seems to indicate that the problem is not with the code I wrote, it is with the plot procedures, unless I am using the plot procedures themselves in a way that is not ideal.

1 2 3 4 5 6 Page 3 of 6