Kitonum

14448 Reputation

24 Badges

11 years, 268 days

MaplePrimes Activity


These are replies submitted by Kitonum

@weidade37211  I do not know how to explain this difference. I tried both methods and found that the second one is faster and does not need square brackets.

@acer  My comment above related to calculation of  cos(Pi/7)  and I used the de Moivre's formula and then  solve . The value of  sin(Pi/7)  probably cannot be simplified as well as  cos(Pi/7) .

@vv  I meant real radicals (without the imaginary unit  I ). Your expression can be slightly simplified, for example

cos(Pi/7) = (1/12)*(-28+(84*I)*sqrt(3))^(1/3)+7/(3*(-28+(84*I)*sqrt(3))^(1/3))+1/6

without  sqrt .

 

 

@CyberRob  If you are working with polynomials in several variables, then you must tell Maple what these variables are. How does Maple know what you call monomials and what are coefficients. Maple has the  coeffs  command for extracting coefficients and corresponding monomials of a multivariate polynomial. See the example below for a polynomial with two variables ( x  and  y ):

restart;
P:=2*x^2-3*x*y+a*y^2-b*x+7;
coeffs(P, [x,y], 't');  # Coefficients
t;  # Corresponding monomials

                     P := a*y^2-b*x+2*x^2-3*x*y+7
                             2, -3, -b, a, 7
                          x^2, x*y, x, y^2, 1

@CyberRob  I think that there simply isn’t such a command that is guaranteed to return the simplest form of some expression. For example, in the following example, using the  expand  command, we remove the parentheses. I do not know a way to get the initial form of this expression:

Expr:=(x^2-3*x+1)^10+(x+5)^11;
expand(Expr);

                        Expr := (x^2-3*x+1)^10+(x+5)^11
     x^20-30*x^19+415*x^18-3510*x^17+20295*x^16-84996*x^15+266610*x^14-639180*x^13+1185645*x^12-1713689*x^11+1936936*x^10-1712315*x^9+1206270*x^8-432930*x^7+1710360*x^6+7133754*x^5+25801545*x^4+64449615*x^3+107422290*x^2+107421845*x+48828126

@CyberRob  Use  simplify  for this new expression:

simplify(c4*dnub*kpbr*ksr*nur*nurdel + c4*dnur*kpbr*ksr*nub*nurdel + nub);

                   c4*kpbr*ksr*nurdel*(dnub*nur+dnur*nub)+nub

@CyberRob   p=~1  equates each element of the list  p  to 1 . op(f)  returns all operands of  f , i.e. separate summands. The  algsubs  command makes the appropriate substitutions in  [op(f)]  from the list  R . See

restart;
f:=(a+b)*x1+(a^2+b^2)*(x1+x2^2)+c*(x2-x3)*a*b:
p:=[a+b,a^2+b^2,c*b*a]:
R:=p=~1;
[op(f)];
cof:=[seq(algsubs(R[i], [op(f)][i]),i=1..nops(p))];

                     R := [a+b = 1, a^2+b^2 = 1, c*b*a = 1]
                [(a+b)*x1, (a^2+b^2)*(x2^2+x1), c*(x2-x3)*a*b]  
                           cof := [x1, x2^2+x1, x2-x3]   

@vv  IntegrationTools  is not necessary here. We can start from the integral, just one extra line will be added:

Int(cosh(cos(2*t)),t=0..2*Pi);
Op := op(1,%); 
simplify(convert(Op, exp)); 
map(int, %, t = 0 .. 2*Pi);

 

 

@radaar  I don’t know a method that would allow all intermediate iterations to be obtained with one call of  Optimization:-Minimize command. Try  infolevel[Optimization]  setting, which returns some additional information, in particular the number of major iterations:

restart;

infolevel[Optimization]:=3;
f:=exp((x-1)^2+(y-2)^2);

Optimization:-Minimize(f);

              

 

 

restart;
with(plots): with(plottools):
L:=[[-0.12,2],[-0.14,0],[0.14,0],[0.12,2]]:
L1:=[[0.05,2],[4,1],[2,4],[3.5,3.5],[1,7],[2,6.5],[0,10]]:
A:=plot(L, color=brown, thickness=10):
B:=plot([op(L1),op(map(t->[-t[1],t[2]],ListTools:-Reverse(L1)))], color="Green", thickness=10):
C:=polygon([op(L1),op(map(t->[-t[1],t[2]],ListTools:-Reverse(L1)))], color=green):
Tree:=display([A, B, C], scaling=constrained, axes=none):
Points:={[-0.2,-0.2],[0.1,0.4],[0.2,0.1],[0,0],[0.1,-0.1],[-0.2,0.1],[-0.1,0.2],[-0.05,0.45],[0.3,-0.3],[0.1,0.25]}:
r:=()->combinat:-randperm(Points):
P:=()->pointplot(r(),color=["Blue"$2, "Yellow"$2,"Crimson"$2,"Cyan"$2,"Pink"$2],symbol=solidcircle,symbolsize=20):
AnimTree:=seq(display(P()),k=1..50):

S:=cat("Happy New Year 2020!   "$3):
N:=length(S): a:=0.77*Pi: h:=2*Pi/N:
Text:=display(seq(textplot([cos(a-k*h), sin(a-k*h),S[k+1]], 
        rotation=-Pi/2+a-k*h, color=red, 'font'=["times","bold",30]), k=0..N-4)):
display(seq(display(AnimTree[i],Text,homothety(Tree, 0.12, [0,-0.6]))$3, i=1..50),insequence, axes=none, size=[500,500]);

               

 

 


New_Year_2020.mw

 vv 6618
A good idea! But it looks a little gloomy. And the middle is desirable to fill something. If you don't mind, I can offer my option.

@Carl Love  I understand that this is the design and it is not new, but it is very sad that it has not yet been fixed.

@Carl Love  I still consider this as a bug. Take a look at how Mathematica does the same calculation:

N[1014.1 - 1007, 2]
                                       
7.1

In fact, in this example we have an iteration of two functions( `-`  and  evalf ), if we write this calculation as  evalf(`-`(P3,P1), 2)  or  evalf[2](`-`(P3,P1)) . In accordance with generally accepted rules, the internal function must first be calculated, and then the external function. We see in this example that these evaluational rules themselves in Maple are erroneous.

Interestingly, if we write this calculation explicitly as an iteration of two functions, the result will be correct:

(evalf[2]@`-`)(1014.1,1007);
                                                   
7.1


Thus we see 2 conflicting results:

evalf[2](`-`(1014.1,1007)) <> (evalf[2]@`-`)(1014.1,1007);

@Glowing  I use Maple 2018.2

Should be  exp(-5*t)  instead of  e^(-5*t) .
e is just a symbol in Maple not the number 2.71828...

3 4 5 6 7 8 9 Last Page 5 of 108