Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

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:

Hello,

I am trying to run maple file for k=1, k=2 ....

My do-loop did not work. What I would like to do is to solve the ODE then have new inc and solve it again.

I should have U(405) then U(770) ....

 

> restart;

> with(DEtools); with(plots);

> lambda := 0.1; delta := .5;

tau := 40;

> for k to 3 do 365*k end do;

> ode := diff(U(t), t) = -lambda(t)*U(t)*U(t);

> inc1 := U(0) = 100;

Need to do in maple smth like that:


I am searching for an analytical solution, if one exists, of a first-order differential equation of the Chini type, which is a generalization of the Abel type. The equation I'm trying to solve is very closely related to one presented in Maple's help files and which does admit an integral representation, namely the equation reported by Kamke as number 152 (according to the reference given in Maple). The equation I'm grappling with is similar to Kamke152 but with the forcing...

Let A(2;-2;3), B(4;-5;6) and (M(1;2;3) be three points. Write the equation of the plane (P) passing through two points A and B 

Problem: Write the equation internal bisector and external bisector of a triangle ABC with A(1,2,-7), B(3,-1,-1), C(-5,14,-3). This is my code.

restart;
> with(LinearAlgebra):
> A:=: B:=: C:=: M:=:
>v:=1/Norm(A-B,2)*(A - B) + 1/Norm(A-C,2)*(A - C): M=A + v*t;
>u:= 1/Norm(A-B,2)*(A - B) - 1/Norm(A-C,2)*(A - C): M=A + u*t;
in the commands M = A + v*t and M = A + u*t, please comment for me. Thank you.

Hello everybody,

I represented a polynomial P type:
P := a + b*x + c*x^2-d*y + e*y^2 + f*x*y
(where a, b, c, d, e, d, are real)

using fucntion pointplot3D
G1 := plot3d(P, x = 0 .. 5, y = -0,5 .. 1);
display(G1);

I represented this polynomial which look like a paraboloid.

I'm just wondering if I can animate continuously...

It's possible to define a field in Maple 15 with 2 kinds of indices, say type spacetime μ,ν,ρ... and one of the type integer, i,j,k varying from 1 to n?

 

I would like to define a field like Aμi where:

 

Aμ1=Aμ

Aμ2=Bμ 

 

and so on.  

 

Thank you Washington Inacio

The cost of some mathematical sites (estimated bizinformation.org):
 8.000.000 $ - wolfram.com
   372.456 $ - webmath.exponenta.ru (Russian Maple in education)
   292.301 $ - maplesoft.com

    82.342 $ - exponenta.ru
    61.278 $ - webmath.ru
    54.895 $ - math.ege
    43.302 $ - univ.kiev.ua (Kiev National University)

I expected

int(x^(-13/10), x):
eval(%,x=1000)-eval(%,x=1/1000);

-(1/300)*1000^(7/10)+(10/3)*1000^(3/10)

but i get

int(x^(-13/10), x=1/1000..1000);

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.

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.

MAPLE is not able to show me the output of nested loop. How can I get it?

for i from 0 to N do for j to 3 do

eqn[i] := sort(coeff(lhs(dequn[j]), epsilon, i)) = coeff(rhs(dequn[j]), epsilon, i)

end do

nested_loops.mwend do

Suppose I have a system of three coupled equations as:

eqn[1] := a*x+b*x^2+c*x^3

eqn[2] := a1*x+b*x^3

eqn[3] := a2*x^2+b2*x^3 = a*x^2

If I simply write

eqs :=( eqn[1], eqn[2], eqn[3])

the equations get coupled.

1. Can I do it using loop structure?

2. Secondly, after coupling suppose I want to collect coefficoent of x, x^2 and x^3 from three equations ang get the equation in form

eq[0]:=a=0,a1=0

evalhf: more than 500 locals

From where that restriction is? Is it workaroundable?

First 1621 1622 1623 1624 1625 1626 1627 Last Page 1623 of 2223