Kitonum

21530 Reputation

26 Badges

17 years, 85 days

MaplePrimes Activity


These are answers submitted by Kitonum

I do not know of such a built-in function, but here is a simple procedure that in many cases solves the problem:

Separation:=proc(F)
local F1, F2, S, Sx, Sy;
F1:=factor(F);
F2:=evalindets(F1, {`^`,function}, expand);
S:={op(F2)};
Sx:=select(depends,S,x);
Sy:=S minus Sx;
if not(type(F1,`*`) or type(F1,`^`) or type(F1,function)) or depends(Sx,y) or depends(Sy,x) then return NULL else
[combine(`*`(op(Sx))), combine(`*`(op(Sy)))] fi; 
end proc:



Examples of use:

Separation(((3*y + y^2)*3*x)/(x + sin(x)));
                                               [x/(x+sin(x)), 3*y*(y+3)]

Separation((3*y + x^2)*3*x/(x + sin(x)));
                                                             NULL

Separation(2^(x^2-y+2*x));
                                                 [2^(x^2+2*x), 2^(-y)]

 

Edit.

 

plottools:-getdata  command seems appeared in Maple 15. If you have an older version, you can use another method (see an example below):

op([1,1], plot(x^2, x=0..2));

                                                   

with(LinearAlgebra):
A := Matrix([[-2,1,1],[0,2,0],[-4,1,3]]);
Eigenvalues(A);

sys1 := Eigenvalues(A)[1]*IdentityMatrix(3)-A;
sys2 := Eigenvalues(A)[2]*IdentityMatrix(3)-A;
sys3 := Eigenvalues(A)[3]*IdentityMatrix(3)-A;

LinearAlgebra:-NullSpace(sys1); # for eigenvalue1
simplify(4*~LinearAlgebra:-NullSpace(sys2)); # for eigenvalue2

Addition. Of course it's easier to use Eigenvectors command for these purposes

The simple  Sylvester  procedure gives a direct solution to the problem of the type of definiteness of a symmetric square matrix by applying the Sylvester's criterion for all possible cases:

Sylvester:=proc(A)
local n, L1, L2;
uses LinearAlgebra, combinat:
n:=Dimension(A)[1];
L1:=[seq([$1..k], k=1..n)];
if `and`(seq(`if`(Determinant(A[k,k])>0,true,false), k=L1)) then return `Positive definite` else
if `and`(seq(`if`((-1)^nops(k)*Determinant(A[k,k])>0,true,false), k=L1)) then return `Negative definite` else
L2:=subsop(1=NULL, powerset([$1..n]));
if `and`(seq(`if`(Determinant(A[k,k])>=0,true,false), k=L2)) then return  `Positive semidefinite` else
if `and`(seq(`if`((-1)^nops(k)*Determinant(A[k,k])>=0,true,false), k=L2)) then return  `Negative semidefinite` else
`Indefinite` fi; fi; fi; fi;
end proc:


Examples of use:

Sylvester(<-1,2; 2,-5>);
                       Negative definite

Sylvester(<1,2; 2,3>);
                           Indefinite

Sylvester(<-5, 0, 0; 0, 0, 0; 0, 0, -1>);
                     Negative semidefinite

 

Use  is  command for this:

is(1000 < 5^(1/2));
                                    false

In Maple the number pi should be coded as  Pi  rather than pi . For numeric value use  evalf  command:

cos(Pi/2);
evalf[5](Pi);  
# Pi with 5 digits

                               0
                           3.1416
 

 

You have a space after  solve  command, which Maple in 2d math interprets as multiplication. Remove it and everything will work:

solve(arctan((2*x^2-1)/(2*x^2+1)) = 0, x);

                                         (1/2)*sqrt(2), -(1/2)*sqrt(2)

A little shorter:

e1_1:=-gamma*r*theta/(w*beta*(theta-1));
subs(1/(theta-1)=-1/(1-theta), e1_1);

                        

or even shorter:

subs(theta-1=-``(1-theta), e1_1);

 

Edit.

A:=[<5,5,5>, <1,2,3>, <-5,1,2>];
LinearAlgebra:-Basis(A);

You can calculate this double integral by writing it as an iterated one:

restart;
with(Student[Calculus1]):
a := Int(Int(exp(cos(x)), y = 0 .. sin(x)), x = 0 .. (1/2)*Pi) ;
ShowSolution(a);

                

 

 

Or

sol:=dsolve(diff(y(x),x)= x/(sqrt(x^2-16))*1/(2*y(x)), implicit);
applyop(simplify, [1, 2], %);
solve(%, y(x));


or

sol:=dsolve(diff(y(x),x)= x/(sqrt(x^2-16))*1/(2*y(x)), implicit);
evalindets(%, `*`, simplify);
solve(%, y(x));

or

sol:=dsolve(diff(y(x),x)= x/(sqrt(x^2-16))*1/(2*y(x)), implicit);
solve(map(simplify, lhs(%)), y(x));

 

The procedure classifies the terms of an arbitrary multivariate polynomial with numeric coefficients according to the indicated characteristics:

ClassTerms:=proc(P)
local S, C, t, T, Terms, Tp, Tn, Tind;
S:=indets(P);
C:=[coeffs(P,S,'t')];
T:=[t];
Terms:=convert(zip(`[]`,C,T),set);
Tp:=select(p->p[1]>0 and `and`(seq(type(degree(p[2],s),even), s=S)), Terms);
Tn:=select(p->p[1]<0 and `and`(seq(type(degree(p[2],s),even), s=S)), Terms minus Tp);
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:

P:=randpoly([x,y,z], dense, degree = 4);

ClassTerms(P);

 

ClassTerms.mw

If the function is linear, then you can delete this option in your code or do not use it at all if you make a linearity check as follows:

type(a*x+b*y+c, linear(x, y));
                              true 

type(a*x^2+b*y+c, linear(x, y));

                              false

                              
 

Do

labels=[z,`&Delta;z`/`&Delta;t`]
 

See the toy example:

f:=x[1]->x[1]^2;



whattype(x[1]);

                       indexed


A workaround:

f:=x1 -> x1^2;  # Or
f:=x__1 -> x__1^2;

                            

First 152 153 154 155 156 157 158 Last Page 154 of 290