Kitonum

21435 Reputation

26 Badges

17 years, 28 days

MaplePrimes Activity


These are replies submitted by Kitonum

@nMaple  Select  remember table assignment  and press  OK

@Markiyan Hirnyk  For  n=4  Maple 2015 works incorrectly. Here is the calculation in Maple 16 with visualization:

 

restart;

P := combinat[choose]({$1 .. 4}, 2):

S := combinat[powerset](P):

L := [seq(GraphTheory[Graph](4, S[k]), k = 1 .. nops(S))]:

M := [ListTools[Categorize]((x, y)-> GraphTheory[IsIsomorphic](x, y), L)]:

K := [seq(M[i, 1], i = 1 .. nops(M))]:

nops(K);

plots[display](Matrix(3, 5, [seq(GraphTheory[DrawGraph](K[k]), k = 1 .. 11), plot([[0, 0]], axes = none)$4]), scaling = constrained);

            

 

 

@Carl Love   Thank you, very elegant improvement. 

@Carl Love  I corrected and expanded my post.

@kegj  Should be  plot1  rather than  plot 1 . Copy my code and simply paste it into your document and run.

@kegj  You have forgotten to call  plots  package. I also removed the square brackets in  filled=[true,color=blue] . In older versions it causes an error, in the new versions can leave brackets.

 

y:=x->sin(x):

a:= -1:

b:=6:

plot1:=plot(sin(x), x=-1..6,color=red,title="graph of sin(x)"):      

plot2:=plot(sin(x),x=1..5,filled=true,color=blue):   

plots[display](plot1,plot2,view=[-1..6,-1..1],title="graph of sin(x)");

@nMaple  All is almost the same;

plot3d(x*y, x = 0 .. 2, y = x^2 .. 2*x, style = surface, filled = true, axes = normal, view = [-0.9 .. 2.4, -0.9 .. 4.4, 0 .. 8.4], orientation = [-67, 70]);

                                   

The proportions of the body in the drawing violated. This body is very narrow and high. Therefore, for a better understanding of its structure, I did not use the  scaling=constrained  option.

 

 

 

@nMaple   Add  style=surface  option and use  user lighting:

plot3d(x^2-y^2+4, x = -1 .. 1, y = 0 .. 2, style=surface, filled = true, axes = normal, view = [-1.4 .. 1.4, 0 .. 2.4, 0 .. 5.4], scaling = constrained, orientation = [50, 70]);

@nMaple  For different bodies color schemes may be different.

@Carl Love   Yes, you're right! I considered all my examples in classic worksheet Maple 2015. Check all in Maple 12. In fact there `+` command is significally faster than add command.

@Carl Love  You wrote  " I think that `+`(U[]) is faster than add(u, u= U)".  But the following examples with direct computation the sum of large number of terms does not confirm this conclusion.

The first 2 examples with the precomputed list:

restart;

X:=[seq(i^3, i=1..5000000)]:

t:=time():

`+`(X[]);

time()-t;

                            156250062500006250000000000

                                               9.453

restart;

X:=[seq(i^3, i=1..5000000)]:

t:=time():

add(x, x=X);

time()-t;

                             156250062500006250000000000

                                                7.797

 

In addition 2 examples without the precomputed list:

restart;

t:=time():

add(i^3, i=1..5000000);

time()-t;

                             156250062500006250000000000

                                                1.953

restart;

t:=time():

`+`(seq(i^3, i=1..5000000));

time()-t;

                             156250062500006250000000000

                                                18.032

 

@Alejandro Jakubi   In the help for  add  and  mul  of Maple 2015 is written:  

"The add(x) calling sequence is equivalent to add(i, i in x). Likewise, mul(x) is equivalent to mul(i, i in x)".

@Markiyan Hirnyk   Remove the extra spaces between  Matrix  and the left parenthesis from original code.

@Markiyan Hirnyk  Thank you for your helpful comment. It's interesting that  diff  command works elementwise for lists. For example, for  int  command this is not true.

First 95 96 97 98 99 100 101 Last Page 97 of 132