Maple 15 Questions and Posts Maple 15 Questions and Posts Feed

These are Posts and Questions associated with the product, Maple 15

HI,

 

I want to create a Textbox which will be opened in the beginning of a Maple code. In this Textbox I want to write an integer, which will be used for a following calculation.

I already found this code:

 

> restart; with(Maplets[Elements]);
print(`output redirected...`); # input placeholder
> maplet := Maplet([["Insert Text", BoxCell(TextBox['IB1'](1 .. 10))], [Button("OK", Shutdown(['IB1'])), Button("Cancel", Shutdown())]]);

Suppose that you wish to animate the whole view of a plot. By whole view, I mean that it includes the axes and is not just a rotation of a plotted object such as a surface.

One simple way to do this is to call plots:-animate (or plots:-display on a list of plots supplied in a list, with its `insequence=true` option). The option `orientation` would contain the parameter that governs the animation (or generates the sequence).

But that entails recreating the same plot each time. The plot data might not even change. The key thing that changes is the ORIENTATION() descriptor within each 3d plot object in the reulting data structure. So this is inefficient in two key ways, in the worst case scenario.

1) It may even compute the plot's numeric results, as many times as there are frames in the resulting animation.

2) It stores as many instances of the grid of computed numeric data as there are frames.

We'd like to do better, if possible, reducing down to a single computation of the data, and a single instance of storage of a grid of data.

To keep this understandable, I'll consider the simple case of plotting a single 3d surface. More complicated cases can be handled with revisions to the techniques.

Avoiding problem 1) can be done in more than one way. Instead of plotting an expression, a procedure could be plotted, where that procedure has `option remember` so that it automatically stores computed results an immediately returns precomputed stored result when the arguments (x and y values) have been used already.

Another way to avoid problem 1) is to generate the unrotated plot once, and then to use plottools:-rotate to generate the other grids without necessitating recomputation of the surface. But this rotates only objects in the plot, and does alter the view of the axes.

But both 1) and 2) can be solved together by simply re-using the grid of computed data from an initial plot3d call, and then constructing each frame's plot data structure component "manually". The only thing that has to change, in each, is the ORIENTATION(...) subobject.

At 300 frames, the difference in the following example (Intel i7, Windows 7 Pro 64bit, Maple 15.01) is a 10-fold speedup and a seven-fold reduction is memory allocation, for the creation of the animation structure. I'm not inlining all the plots into this post, as they all look the same.

restart:
P:=1+x+1*x^2-1*y+1*y^2+1*x*y:

st,ba:=time(),kernelopts(bytesalloc):

plots:-animate(plot3d,[P,x=-5..5,y=-5..5,orientation=[A,45,45],
                       axes=normal,labels=[x,y,z]],
               A=0..360,frames=300);

time()-st,kernelopts(bytesalloc)-ba;

                                1.217, 25685408
restart:
P:=1+x+1*x^2-1*y+1*y^2+1*x*y:

st,ba:=time(),kernelopts(bytesalloc):

g:=plot3d(P,x=-5..5,y=-5..5,orientation=[-47,666,-47],
          axes=normal,labels=[x,y,z]):

plots:-display([seq(PLOT3D(GRID(op([1,1..2],g),op([1,3],g)),
                           remove(type,[op(g)],
                                  specfunc(anything,{GRID,ORIENTATION}))[],
                           ORIENTATION(A,45,45)),
                    A=0..360,360.0/300)],
               insequence=true);

time()-st,kernelopts(bytesalloc)-ba;

                                0.125, 3538296

By creating the entire animation data structure manually, we can get a further factor of 3 improvement in speed and a further factor of 3 reduction in memory allocation.

restart:
P:=1+x+1*x^2-1*y+1*y^2+1*x*y:

st,ba:=time(),kernelopts(bytesalloc):

g:=plot3d(P,x=-5..5,y=-5..5,orientation=[-47,666,-47],
          axes=normal,labels=[x,y,z]):

PLOT3D(ANIMATE(seq([GRID(op([1,1..2],g),op([1,3],g)),
                           remove(type,[op(g)],
                                  specfunc(anything,{GRID,ORIENTATION}))[],
                           ORIENTATION(A,45,45)],
                    A=0..360,360.0/300)));

time()-st,kernelopts(bytesalloc)-ba;

                                0.046, 1179432                            

Unfortunately, control over the orientation is missing from Plot Components, otherwise such an "animation" could be programmed into a Button. That might be a nice functionality improvement, although it wouldn't be very nice unless accompanied by a way to export all a Plot Component's views to GIF (or mpeg!).

The above example produces animations each of 300 frames. Here's a 60-frame version:

Write a procedure, primesum, whose input is a positive integer n and whose output is the sum of all primes p such that p is less than or equal to n. You may use th built-in procedure isprime.

Maple 15 Crashes...

January 22 2012 Vesnog 15

Greetings,

I have purchased Maple 15 Student Edition 2 months ago. My problem is that when I click the button under the text "To obtain a complete annotated solution, click:" Maple crashes. This happens in the browse tasks window accessed through Tools>Tasks>Browse. In addition to this issue, the interactive commands does not seem to work. How can resolve these issues? I am running a 64-bit version of Maple 15 under Windows 7 Home Premium 64-bit.

Any help is appreciated.

DEQ from Transfer Function...

January 21 2012 ThU 365

Dear Forum,

I have a rational transfer function, like

Y(s)/X(s)=G(s)=(s^2+s+1)/(s^3-3*s^2+5)

With the DynamicSystems package, Maple can compute a state space representation, but I want a single DEQ in y(t) of 3rd order. What is the best way to let Maple compute this?

 

Equation of a plane...

January 20 2012 toandhsp 195

Write the equation of a pane (P) which passes through the point E(2,1,0) and F(1,2,1) such that distance from the point A(1,-2,-1) to the plane (P) twice distance from the point B(2,4,3) to the plane (P).

My main idea is based on, if the line (d) passes through...

I wrote a program in order to find coordinates orthocenter of the triangle. Please comment for me. This is my code:

restart;

with(geom3d);

point(A,1,-3,0);

point(B,-2,1,1);

point(C,3,1,2);

line(AB,[A,B],t);

line(BC,[B,C],t);

ab:=ParallelVector(AB); 

bc:=ParallelVector(BC);

eq1:=Equation(plane(P,[C,ab],[x,y,z]));

eq2:=Equation(plane(Q,[A,bc],[x,y,z]));

eq3:=Equation(plane(ABC,[A,B,C],[x,y,z]));

Hi there. 

I'm making some 2D contour plots and am desperate to know what the values are which are assigned to the different contour levels. e.g., a red band must be reading value 120 (say) and an orange one 80, but how can I get this and show it on a legend in the plot? It's crucial to the value of the plot. 

Many thanks for any help!

David

Hello,

I'm trying to solve the following system in Maple but it doesn't show me any solution:

2*(1-a1^2)*x(t)*y2(t) - 2*k*(1-a1*a2)*(x(t)^2)=m

k*diff(x(t),t)-diff(y2(t),t)=x(t)(m/2-1)+y2(t)

where x(0)=0 and y2(0)=0 , k>0,...

I'm working on a simple toy model as an introductory example to some work I am writing up. I was hoping the example would be simple enough to get some nice analytical results to write up. However, maple is giving me some odd results.

Essentially I have taken the integral of the absolute value of an error that I have caluclated which has given me a somewhat nonsensical result. The attached file contains the specifics (hopefuly it's visible)...

Hello everyone


I'm a new maple user, so I'm really sorry if this question is dumb, I've tried to find people with a similar problem but didn't find anyone.

So this is my problem: when I try to multiply a vector with a variable it gives me this:

> Restart; With(LinearAlgebra);
> B1 := [1, 2, 0, -1];
[1, 2, 0, -1]
> B2 := [0, 1, -1, 0];
[0, 1, -1, 0]
> A1 := a*B1+b*B2;

Hi all,

I have data which I want to give a simpler and a smaller interpolation function. Not necessary with Cubicspline as in the code attached (polynomial, exponential, etc..).

Thanks in advance

interpolation.mw

I'd like to hear a sound alert when Maple 15 (64bit version, on Windows 7 64bit) finishes the execution of a command.

For example, I have a very lengthy function to simplify. I use

simplify(function,size)

but it takes too long. It would be very helpful for me to hear a sound when this simplification finishes so that I can come back to see the result and go on.

Hi,

I got a worksheed with some dualaxisplots generated in a loop. As it would take some time to rightclick on each of them and export it as eps, I'm searching for a fine solution to automatically export them. For plot(); and display(); I found some nice solutions, but using dualaxisplot, I receive the following error:

Error, (in plots:-dualaxisplot) dual-axis plots are not available for the current interface or device

This...

Hi,

I got a worksheed with some dualaxisplots generated in a loop. As it would take some time to rightclick on each of them and export it as eps, I'm searching for a fine solution to automatically export them. For plot(); and display(); I found some nice solutions, but using dualaxisplot, I receive the following error:

Error, (in plots:-dualaxisplot) dual-axis plots are not available for the current interface or device

This...

First 25 26 27 28 29 30 31 Last Page 27 of 38