Kitonum

21890 Reputation

26 Badges

17 years, 244 days

MaplePrimes Activity


These are replies submitted by Kitonum

@tomleslie  And I prefer that it's shorter (and/or faster). I do not see any reason to use for sets or lists   numelems  instead of  nops. You allude to a wider field of application of  numelems  in comparison with nops . But if we follow this logic, for example it's better to use  `**`  to raise to an exponent than `^` (because a single symbol  `*` can be used for multiplication and exponentiation). Or the area of any plane figure should be calculated by integration (for example, the area of a rectangle than just multiplying its sides).

Even when working with matrices, I prefer other commands than numelems, because it is usually required to know not only the total number of entries in the matrix, but the number of rows and the number of columns. Here is an example:

A:=<1,2,3; 4,5,6>;
m, n:=op(1, A);
`*`(%);
m*n;
numelems(A);
                                                    

 

 

                                                   
 

@tomleslie The actual number of points may not coincide with numpoints. See help for numpoints and the example. Note that near the origin the points are more often:

plot(abs(x), x=-2..2, style=point, symbol=solidcircle, numpoints=40);

@ssara  Nothing needs to be converted. Just open this file in your Maple.

@ssara  You do not need any for loops. The substitution and collection must be done immediately in the entire matrix. See the corrected file ss_new.mw 

@shimaa sadk  You can easily write these results into a list, and then assign names to them.

Example:

{x=1, y=2, z=3};
L:=eval([x,y,z], %);
a, b, c := op(L); 
# The new names (a multiple assignment)

                              

 

 

@das1404  I offered you a possible option for Maple 7 here, but it seems you did not read it.

@vv  I already answered this question twice, indicating the explicit formulas here. But for some reason OP does not read his own posts.

@asa12  I do not know what the issue is. In my 32 bit Maple 2015.2 (Windows 10) everything works correctly. Here is the file  Example_animation.mw
See screen-shot:

@asa12  In Maple 2015 everything works correctly. You have initialized the procedure code. And then probably you forgot to execute the following code:

RotationIn2D(2,1);

@das1404  Your calculations are correct, except  hs . For your parameters should be  hs=sqrt(2)/2  rather than  1/2 . In my code first there were 2 errors in the expressions for  st  and  hs  (I took the wrong segments). Now everything is fixed.

@asa12  The blue particle is at the origin. The red particle rotates around the blue one. x0, y0 are the initial coordinates of the red particle:

RotationIn2D:=proc(x0, y0)
local A;
uses plots;
A:=t-><cos(t),-sin(t); sin(t),cos(t)>;
animate(plot, [[[convert(A(s).<x0,y0>,list)[],s=0..t], [convert(A(t).<x0,y0>,list)]], style=[line, point], linestyle=3, color=red, symbol=solidcircle, symbolsize=17], t=0..2*Pi, frames=90,background=plot([[0,0]], style=point, symbol=solidcircle, color=blue, symbolsize=17), axes=none, scaling=constrained); 
end proc:


Example of use:

RotationIn2D(2,1);

                               

                                         

 

Edit.

@Markiyan Hirnyk  Thank you for attention! The reason for the error is that there are just no solutions for these parameters. I made the necessary adjustments to the procedure code. Now it returns an empty list in such cases.

For example 
HeronianTriangles(170, 165);

returns the solutions.

@acer Thanks. With Maple it can be made easier

restart;
sum(cos(2*Pi*k/n), k=0..n-1);
                                                   
                      0

But even easier to prove this identity manually, if we note that the sum of  n unit vectors with the beginning in the origin and whose ends lie at the vertices of the regular n-gon is equal to  0  (this identity is simply the projection of this vector equality on the horizontal axis.).

@ThU  Similar identities are often much easier to prove manually than with Maple. Here is an example in which the result is also obviously :

simplify(sum(cos(2*Pi*k/214748364), k=0..214748363));
     Error, (in SumTools:-DefiniteSum:-ClosedForm) summand is singular in the interval of summation

simplify(add(cos(2*Pi*k/214748364), k=0..214748363));
     Error, Maple was unable to allocate enough memory to complete this computation.  Please see ?alloc
 

 

@acer    @vv  Thanks for the helpful comments.

 @vv    `GAMMA/magic`:=100,100,infinity,50;   # I did not understand what that meant. Is it documented somewhere?

 

First 53 54 55 56 57 58 59 Last Page 55 of 134