zenterix

310 Reputation

4 Badges

3 years, 97 days

MaplePrimes Activity


These are replies submitted by zenterix

@Rouben Rostamian  @acer One example of an optimization to memory usage in the code is the following (though i am not sure how to accomplish it).

The animation plots a "trail" of the last 1000 points of the arrow's trajectory on the sphere. If plots:-display would accept a function that would give it the current animation frame, then I could compute such trails on the fly (basically accessing a rolling window of a matrix, computed in the function passed in to plots:-display). But since apparently plots:-display doesn't accept such a function as an argument, the data for each of the 10000 frames of this trail are kept in memory.

However, after a few checks it seems that the arrows themselves are what take up so much memory. I am trying to optimize the arrows. Replacing plots:-arrow with plots:pointplot3d uses a fourth as much memory.

@Rouben Rostamian  Would you be willing to try to run a test animation?

I created this respository for testing animations. All you have to do is run the worksheet and it will animate an arrow on a sphere with 10000 points in the trajectory. The actual animations I want to run will have at least ten times this amount of points. 

However, even this meager 10000 stays stuck "evaluating" on a 16 core 256GB RAM computer. Something clearly is wrong.

I'm going to send the linked repository to Maple's support to see if they can help me figure this out.

As for the heap, is the setting you're referring to the one set by kernelopts(jvmheaplimit)? Mine is already at 65536, but kernelopts(limitjvmheap) is false, so as far as I can tell the limit on the heap isn't applied.

@acer I can now see the result used by Maple on paper.

If f(x)=ax^2+bx+c and g(x)=f(kx), then when we write out the equations for the roots of g(x) we find the expression 

which means that the roots of f(x/2) are the roots of f(x) divided by 2. 

Furthermore, the roots of 4f(x/2) are the same as the roots of f(x/2).

Hence, I understand the result given my Maple now.

@acer in your calculations you reached the equation y^2-2y+4=0. Ie, the that solves the system is a root of this quadratic polynomial. 

Let's solve it (I'm just going to show one of the solutions, the other is with the negative sign)

Discriminant = 4-4*4=-12

y=(2+sqrt(-12))/2

=(2+2sqrt(3)i)/2

=1+sqrt(3)i

Maple on the other hand is telling us that this is the same as 2 times the solution to y^2-y+1=0.

But how did it know that? Like, how would a human have come up with that particular way of expressing the solution, and why?

@acer Okay, that option is indeed helpful it gives the same two complex roots that I obtain by hand. 

However, I think my original question was actually about the actual math part. Where does that quadratic 2(y^2-y+1) come from?

@acer Indeed I am actually using the array-style return for rkf45. 

@acer How do we file bug reports?

@Joe Riel 

I was able to reproduce your successful result. Thank you.

@tomleslie 

I have been reading the docs and in particular the user and programming manuals. I think there is a lack of examples and explanation of edge cases and gotchas, of which there are many.

Consider Chapter 11 "Writing Packages" from the programming manual. I spent a ton of time trying to work my way through that and just simply could not. Some commands wouldn't work as expected. I've posted about it before, but for example the following snippet

Note: Maple automatically adds lib subdirectories of directories in HOMEDIR/maple/toolbox as well as your current directory to the predefined variable libname. Therefore, modifying the .mapleinit or maple.ini file is only necessary if you want to designate a directory as the default location in which the savelib command will save your library files.

simply does not seem to be true. I created multiple example directories and tried to go through the examples. The lib directory of my current directory does not seem to be added automatically to libname. I wasted tons of time on this.

And once again, for this post, just to to be absolutely sure of what I am saying I literally just tried it once again for the umpteenth time. Here's what I just did:

I created a directory called PackageTest and inside I created a directory lib with a file called PackageTest.mla (using LibraryTools:-Create). Then I created a file in this newly created PackageTest directory called packageTest.mpl containing the following code

module PackageTest()

     option package:

     export myAdd := proc(a,b)

          a + b:

     end:

end:

Then, in a maple worksheet (PackageTest/packageTest.mw) I read the mpl file and ran the command 

LibraryTools:-Save('PackageTest', cat(kernelopts(homedir), "/maple/Packages/PackageTest/lib/PackageTest.mla"))

At this point, my expectation is that if I open a worksheet that has current working directory as 

cat(kernelopts(homedir), "/maple/Packages/PackageTest)

then Maple should: "automatically adds lib subdirectories of directories in HOMEDIR/maple/toolbox as well as your current directory to the predefined variable libname", ie should add PackageTest/lib to libname and thus the package PackageTest that I defined should be available.

Either I am crazy or dumb or this documentation is badly written or plain wrong or atrocious.

 

Finally, look, I am new to the Maple community and I'd like to learn to use it but having been part of other communities I have to say the documentation here is just... confusing sometimes. Isn't it a goal of a program like this that new users can be up and running quickly and productively? It seems like this isn't an important consideration.

If Maple has been around for so long, how come you don't find that much information on how to do different things and there are seemingly only a handful of very knowledgeable people on using Maple that answer the questions here (like yourself)?

The original point of this entire thread is that hopefully I will be able to write up what I consider better documentation in a few weeks or months that prioritizes being productive.

@tomleslie 

I guess I am starting to complain a lot about Maple in my posts. Coming from the world of Python and Javascript the documentation just seems so not user-friendly. The documentation seems like a big reference manual. This might be nice for someone who already knows Maple (and even for such people I have my doubts given the quality of the writing of these docs), but tutorial-style documentation for common tasks would be much more useful for people trying to learn Maple (and not just learn in an old-fashioned trial-and-error low productivity way, but in an efficient way that draws on someone having produced thoughtful, didactical tutorials).

Take the documentation on the Grid package. It lists out the 18 commands in the package. Am I supposed to go through all of the 18 to find out how this package is usually used? 

There is so much inertia it seems.

Have a look at this page, for Grid:-Run. This page is seemingly abandoned. The formatting of the page runs way to the right. Someone didn't care at all about the reader of this. Like, is this command so unimportant that no one cares to maintain the documentation page for it?

@acer The thing I hadn't understood was that was considered a continuous function in the first case. Now I know.

@mmcdara Sure, there are multiple options. This question isn't very interesting I know. It boils down to not having realized I was using the wrong syntax. However, as I mentioned to @acer, the incorrect syntax seems so natural that it is weird that it is incorrect.

@acer I guess my question was based on the impression that plot(i, i=1..5) seems so very similar to plot(l[i], i=1..5) that I naturally expected it to work. To me, the expected result is obvious: that both plots be exactly the same (given, as I said, l=[1,2,3,4,5]).

I guess the two commands are not the same, though I can't really explain at depth why. The first expression seems to have the function f(i)=i as the first argument. The second expression has an expression that is the accessing of an element of a list.

I think the answer turns out to be that it's just the way the syntax works.

The documentation says that the first argument is either a function as in the following example

plot(x^2, x=1..10)

or we can pass in two vectors/lists/arrays as the first two arguments, representing and y.

The example I asked about doesn't fall into either of these categories I guess. 

@dharr 

As I said initially, the user who executes the mpl file knows where it is located yes, so that person can execute it. 

But then, the code in the mpl file will do things based on its own location. For example, create files and put them in locations relative to its own location.

In my case, the mpl file will create animations and put them in a directory called Animations located in the same directory as the mpl file.

1 2 3 4 5 6 Page 4 of 6