zenterix

310 Reputation

4 Badges

3 years, 97 days

MaplePrimes Activity


These are questions asked by zenterix

This question is based on the following worksheet I created specifically to show my question: Animation_Test.mw

Unfortunately, MaplePrimes gives me an error when I try to insert the contents here directly.

Basically my question is about the syntax of plots:-display.

I have a sphere

sphereDisplay := plottools:-sphere([0, 0, 0], 1, transparency = 0.9);

and something which is the result of calling plots:display on a sequence of two other other plots:-display.

arrowAndTrailDisplay := plots:-display(seq(plots:-display(computeArrowPlotFrame(m, t, red), computeTrailPlotFrame(m, t, windowSize, red)), t = times), insequence = true)

You can see in the attached worksheet what computeArrowPlotFrame and computeTrailPlotFrame are, but they are basically lists of plot structures. arrowAndTrailDisplay is thus an animation containing two different sequences of frames.

I wish to have Maple plot the sphere and the animation together. This works as expected (a static sphere and the animation of an arrow and a trail of the path of the tip of the arrow)

plots:-display([sphereDisplay, arrowAndTrailDisplay]):

but the following does not work as expected (instead it plots each frame separately)

plots:-display([arrowAndTrailDisplay])

adding insequence=true to the latter makes it work. But my question is why do I have to add that? I can't understand, from syntax standpoint why the former plots arrowAndTrailDisplay as an animation but the latter does not.

I've been spending a lot of time recently basically as a physics research assistant in my spare time (which is 24/7). I've worked as a programmer before, so I have experience with other languages, but not Maple.

However, even though I literally have the whole day every day to spend trying to figure things out it seems like the documentation is quite lacking sometimes and there are things I simply cannot find without the very useful help from this community here at MaplePrimes (small example further below).

I've been thinking a lot about improving the documentation. I've always been the person on my teams pushing people to have better documentation and being better at communication.

Now, Maple isn't open source, so I can't just contribute to a repository or something. I would like to make a repository of my own that sort of mirrors parts of the documentation but is written in a way that to me feels more didactical, and with a lot of examples and edge cases that I am finding in practice.

There are so many things that happen that are unexplainable to me. My documentation wouldn't be an encyclopedic reference like the official documentation obviously, but it would rather try to explain certain things better and show cool examples.

Is there any appetite from anyone in the community here (especially the more experienced people) to help me (essentially by answering a ton of my questions as they come up, and then maybe reviewing my write-ups as I push to Github, and even maybe having an actual call to answer a question I might have)? I think this would be a helpful contribution for future users of Maple.

Just to give a small example from the last two hours of a section in the documentation that I found to not be didactical enough.

In the documentation about the Maple preprocessor, there are essentially no examples. On updating the include path, there is the following snippet

The include path can be specified on the command line that invokes Maple by using the -I option or it can be modified by calling kernelopts(includepath). Multiple paths can be specified within a single string separated by commas or semicolons or alternatively a list of paths can be entered. When using kernelopts(includepath), do not prefix the include path with -I. The maximum number of include path entries is 25.

What exactly does "calling kernelopts(includepath)" mean? I tried kernelopts(includepath) := "my/path/here". Didn't work. Perhaps I have a lack of imagination but I only found out it is kernelopts(includepath = "my/path/here") from a post here in this community. 

Consider the following code in an .mpl file

$define MACRO1 "1"

$define MACRO2 "2"

 

$ifdef __FILE__

$define MACRO3 "3"

$endif

 

$ifdef MACRO1

$define MACRO4 "4"

$endif

 

f := proc()

print(MACRO1, MACRO2, MACRO3, MACRO4, __FILE__):

end:

If we run this from a worksheet and call the procedure f, the printed output is

"1", "2", MACRO3, "4", "/Users/zenterix/..."

Why does $ifdef __FILE__ evaluate to false? Ie, why doesn't MACRO3 get defined? I thought __FILE__ was a predefined macro.

I have a procedure that makes lots of plots using plots:-odeplot.

So that I don't have to write the "plots:-" part every time, at the beginning of the procedure I wrote "odeplot:=plots:-odeplot:".

Is this a bad idea in any way?

Why does the command plot(i,i=1..5) work but not plot(l[i],i=1..5) where l is the list l=[1,2,3,4,5]?

l := [1, 2, 3, 4, 5]

[1, 2, 3, 4, 5]

(1)

plot(i, i = 1 .. 5)

 

plot(l[i], i = 1 .. 5)

 

NULL

Download plot-list.mw

First 8 9 10 11 12 13 14 Page 10 of 15