Kitonum

21860 Reputation

26 Badges

17 years, 239 days

MaplePrimes Activity


These are replies submitted by Kitonum

@acer  But why  match  command fails with this example (in Maple 2017.1). Is this a bug?

restart;
e:= x^2+y^2-8*x-12*y-92:
g:= (x+a)^2+(y+b)^2+c:
match(e=g, {x,y}, 's');
s;

                            false
                               s

                           
 

 


 

@Christopher2222  Change the ranges for the plotting:

restart;
F := x^2+y^2+a*x+b*y+c:
XY := [[8,0], [4,4], [14,4]]:
minimize(add((eval(F, {x = XY[i, 1], y = XY[i, 2]}))^2, i = 1 .. nops(XY)), location);
assign(op(%[2])[1]):
A := plot(XY, style = point, symbolsize = 15, symbol = solidcircle, color = red):
B := plots[implicitplot](F, x = -1 .. 15, y = -1 .. 11, color = green):
plots[display](A, B, scaling = constrained);

@ernilesh80  You wrote "can I also get  sign (positive or negative) of determinant of all possible 63 principal minors? "

Any principal minor is determined by some sublist of the list  [1,2, ..., n]  (A is a square matrix n x n). Here is a procedure that returns the positions and determinants of all leading principal minors (lpm) or principal minors (pm) of a matrix A:

Minors:=proc(A, p)
local n, L1, L2;
uses LinearAlgebra, combinat:
n:=Dimension(A)[1];
L1:=[seq([$1..k], k=1..n)];
if p=lpm then return seq(k=Determinant(A[k,k]), k=L1) else
L2:=subsop(1=NULL, powerset([$1..n]));
seq(k=Determinant(A[k,k]), k=L2) fi;
end proc:

 

Example of use:

A:=LinearAlgebra:-RandomMatrix(3, shape=symmetric);
Minors(A, lpm);  
# Leading principal minors
Minors(A, pm);  # Principal minors


 


 

 

@mohkam7  A slight adjustment of the procedure allows you also to work with polynomials containing symbolic coefficients, provided that conditions are imposed on them:

ClassTerms1:=proc(P::polynom, S::list(symbol), Ass::set:={})
local C, t, T, Terms, Tp, Tn, Tind;
C:=[coeffs(P,S,'t')];
T:=[t];
Terms:=convert(zip(`[]`,C,T),set);
Tp:=select(p->is(p[1]>0) and `and`(seq(type(degree(p[2],s),even), s=S)), Terms) assuming op(Ass);
Tn:=select(p->is(p[1]<0) and `and`(seq(type(degree(p[2],s),even), s=S)), Terms minus Tp) assuming op(Ass);;
Tind:=Terms minus `union`(Tp,Tn);
print(P_positive={seq(p[1]*p[2],p=Tp)});
print(P_negative={seq(p[1]*p[2],p=Tn)});
print(P_indeterminate={seq(p[1]*p[2],p=Tind)});
end proc:


Example of use:

ClassTerms1(a*x^2+b*x*y-c*y^2+d*x^2*y^2+x-5, [x,y], {a<0,b>0,c<0,d<0});

@Jalale  You can use  Explore  command to create similar animations with sliders. See help on this command.

@Jalale  I did not understand what you mean by  "... animation with distances like AB/A'B' =AC/A'C'..."

@savalan I do not understand what you wrote at all. An equation does not depend on how you designate its roots. Your equations in the for loop are the same initial equations with the same roots, only the expression for the root  d  is shifted because you are actually making a change of variable in the same equations.

@savalan   What's the problem? Here are the first 50 positive values of  d:

seq(eval(rhs(sol[2]), _Z1=z), z=0..49);
0.03689590440, 0.5368959044, 1.036895904, 1.536895904, 2.036895904, 2.536895904, 3.036895904, 3.536895904, 4.036895904, 4.536895904, 5.036895904, 5.536895904, 6.036895904, 6.536895904, 7.036895904, 7.536895904, 8.036895904, 8.536895904, 9.036895904, 9.536895904, 10.03689590, 10.53689590, 11.03689590, 11.53689590, 12.03689590, 12.53689590, 13.03689590, 13.53689590, 14.03689590, 14.53689590, 15.03689590, 15.53689590, 16.03689590, 16.53689590, 17.03689590, 17.53689590, 18.03689590, 18.53689590, 19.03689590, 19.53689590, 20.03689590, 20.53689590, 21.03689590, 21.53689590, 22.03689590, 22.53689590, 23.03689590, 23.53689590, 24.03689590, 24.53689590

@quo  Yes of course! The functional operator  ->  in Maple is a special form of a procedure.

See help  ?Functional operators

@Markiyan Hirnyk 

1. I do not understand, what do you mean by "The parametrization L:=[[[t,sin(Pi*t/3)/2],t=0..3],[[3,0],[0,3],[1,1]], [[t,sqrt(t)],t=1..0]]: is done by hand". L is the actual parameter of the procedure and we always specify it by hand. Of course, in the text of the procedure it is easy to provide an explicit specification of some sections of the border instead of a parametric one. But I did not do this, so as not to complicate the text of the procedure by the different ways of specification of the border. Therefore, instead of [f(x), x=a..b]  we must write [[t, f(t)], t=a..b] .

2. The procedure returns an exact (symbolic) result. If Maple can not symbolically compute the integral, it returns it in an inert form and we can use numerical methods, for example  evalf  command. I think this approach is simpler than replacing the region of integration with a polygon.

See an answer to this question in  this post .

@acer You are a real virtuoso in such things!

Obviously, the original expression is periodic with the period  2*Pi , because It contains only the functions of  sin(phi)  and  cos(phi). Therefore, it is sufficient to solve the equation, for example, in the range  0 .. 2*Pi  and continue periodically to any desired interval. The same applies to finding extremums (local or global).

 

More precisely: combine(ee) shows that the period is  Pi .

 

Edit.

@Rouben Rostamian   Convert your comment in an answer and you will get a lot of votes up for it. Mine be the first.

For example you can write:

s := Int(exp(-x^2)*cos(2*x*y), x = 0 .. infinity):
s=value(s);

First 63 64 65 66 67 68 69 Last Page 65 of 134