vv

12780 Reputation

19 Badges

8 years, 300 days

MaplePrimes Activity


These are answers submitted by vv

Example

restart;

F:=[x^2+y^2+z^2, x*y+y*z+z*x, x*y*z-1];

[x^2+y^2+z^2, x*y+x*z+y*z, x*y*z-1]

(1)

G,A := Groebner:-Basis(F, tdeg(x,y,z), output=extended);

[x*y+x*z+y*z, x^2+y^2+z^2, x*z^2+y*z^2+1, y^3+y^2*z+y*z^2+z^3-1, z^4-x-y-2*z, y^2*z^2+y+z], [[0, 1, 0], [1, 0, 0], [0, z, -1], [y+z, -x, 1], [z^2, -x*z-y*z, x+2*z+y], [0, y*z, -y-z]]

(2)

nops(G);

6

(3)

Matrix(A) . <F> = <G>: simplify(%);

(Vector(6, {(1) = (y+z)*x+y*z, (2) = x^2+y^2+z^2, (3) = 1+(x+y)*z^2, (4) = y^3+y^2*z+y*z^2+z^3-1, (5) = z^4-x-y-2*z, (6) = y^2*z^2+y+z})) = (Vector(6, {(1) = (y+z)*x+y*z, (2) = x^2+y^2+z^2, (3) = 1+(x+y)*z^2, (4) = y^3+y^2*z+y*z^2+z^3-1, (5) = z^4-x-y-2*z, (6) = y^2*z^2+y+z}))

(4)

#############

for i to nops(F) do
  Groebner[NormalForm](F[i], G, tdeg(x,y,z), R[i]);
od;

0

 

0

 

0

(5)

B:=Matrix([seq(R[i], i=1..nops(F))]):
B . <G> = <F>:  simplify(%);

(Vector(3, {(1) = x^2+y^2+z^2, (2) = (y+z)*x+y*z, (3) = x*y*z-1})) = (Vector(3, {(1) = x^2+y^2+z^2, (2) = (y+z)*x+y*z, (3) = x*y*z-1}))

(6)

 


Download groeb1vv.mw

f := (x, y) -> piecewise([x, y] = [0, 0], 0, (x^3*y - x*y^3)/(y^2 + x^2)):
f(0,0);
#                               0

fx0:=limit((f(x,0)-f(0,0))/x, x=0);
#                            fx0 := 0

fy0:=limit((f(0,y)-f(0,0))/y, y=0);
#                            fy0 := 0

limit(( f(x,y)- fx0*x - fy0*y )/(x^2+y^2), [x=0,y=0]); 
#                            -1/4 .. 1/4

 ==> f has partial derivatives (both are zero) at (0,0)

 but it is not differentiable at (0,0).

restart;
phi := (p__1, p__2, q__1, q__2, xi) -> p__1*exp(q__1*xi) - p__2*exp(q__2*xi):
xi:=2:   # <----
for p__1 in [0,1,-1,I,-I] do
for p__2 in [0,1,-1,I,-I] do
for q__1 in [0,1,-1,I,-I] do
for q__2 in [0,1,-1,I,-I] do
  result1 := evalf(phi(p__1, p__2, q__1, q__2, xi));
  print('phi'(p__1, p__2, q__1, q__2, xi)=result1);
od od od od:

 

Don't use the dot (.) operator for usual multiplication; it is reserved for noncommutative multiplication  (usually dot product) . Use * instead.
For example,

simplify(v . ( 2/v + 1));
is not simplified if v is a name.

1. Use
showstat(DEtools:-odeadvisor);
or better:
showstat(DEtools[odeadvisor]);
because DEtools is a table-based package.

2.

stopat(DEtools[odeadvisor]);
 #                    [DEtools[odeadvisor]]
ode:=y(x)*(2*x^2*y(x)^3+3)+x*(x^2*y(x)^3-1)*diff(y(x),x)=0;
DEtools[odeadvisor](ode);

 

If possible, don't use floats in symbolic computation (here limit)

Compare:

limit(n*(1/3 - 1/(3+1/n)),n=infinity);
#                               1/9
limit(n*(1/3. - 1/(3+1/n)),n=infinity);
#                        -Float(infinity)

So, replace in W:  3.6  with 36/10  etc.

Of course, just use the menu File > Page Setup...
or Ctrl+Shift+P
Then Export or Print to a pdf port.

A is a diagonalizable matrix (the minimal polynomial being X^2 - X)

The possible diagonal forms are D1 and D2 below.

restart;

with(LinearAlgebra):

D1, D2 := DiagonalMatrix([0,0,1]), DiagonalMatrix([0,1,1]);

D1, D2 := Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1})

(1)

The general form for a nonzero A is  T^(-1) . Dk . T,  where T is nonsingular and k in {1,2}.

Example:

T:=RandomMatrix(3, generator=rand(-3..3)): A:=T^(-1).D1.T;

Matrix(3, 3, {(1, 1) = -3, (1, 2) = -3/2, (1, 3) = 0, (2, 1) = 8, (2, 2) = 4, (2, 3) = 0, (3, 1) = -7, (3, 2) = -7/2, (3, 3) = 0})

(2)

A^2-A;  # Check

Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0})

(3)

 

 

restart;
FD:=proc(f::procedure, i::nonnegint, h::algebraic)# Finite Difference
    if i=0 then return f fi;
    x -> ( FD(f,i-1,h)(x+h) - FD(f,i-1,h)(x) )
    end proc:

f:= x -> x^5:
FD(f,3,h)(x): simplify(%);
seq( simplify(FD(f,i,1)(x)), i=0..6 );

          150*h^5+180*h^4*x+60*h^3*x^2

          x^5, 5*x^4+10*x^3+10*x^2+5*x+1, 20*x^3+60*x^2+70*x+30, 60*x^2+180*x+150, 120*x+240, 120, 0

 

Denote by p the polynomial.
Solving the equation p=0 wrt sigma and ploting the result
it is easy to conclude that p has a unique positive root in Z for any real sigma.
This root can be obtained by solve symbolically or numerically (for a numeric sigma).
 

p:=6125*Z^4 + 68644*Z^3*sigma - 219625*Z^3 + 255712*Z^2*sigma - 959250*Z^2 + 238144*Z*sigma - 1113500*Z - 245000;

6125*Z^4+68644*Z^3*sigma-219625*Z^3+255712*Z^2*sigma-959250*Z^2+238144*Z*sigma-1113500*Z-245000

(1)

s:=solve(p,sigma);

-(125/4)*(49*Z^4-1757*Z^3-7674*Z^2-8908*Z-1960)/(Z*(17161*Z^2+63928*Z+59536))

(2)

plot(s, Z=0 .. 60);

 

sol:=solve(eval(p, sigma=2), Z, explicit)[1]; # Take e.g.sigma=2

82337/24500+(1/73500)*3^(1/2)*((49000*(359854610853484+(40500*I)*72450303118439610323^(1/2))^(2/3)+42281618707*(359854610853484+(40500*I)*72450303118439610323^(1/2))^(1/3)+307992598564000)/(359854610853484+(40500*I)*72450303118439610323^(1/2))^(1/3))^(1/2)+(1/73500)*6^(1/2)*((-24500*((49000*(359854610853484+(40500*I)*72450303118439610323^(1/2))^(2/3)+42281618707*(359854610853484+(40500*I)*72450303118439610323^(1/2))^(1/3)+307992598564000)/(359854610853484+(40500*I)*72450303118439610323^(1/2))^(1/3))^(1/2)*(359854610853484+(40500*I)*72450303118439610323^(1/2))^(2/3)+4958451303347259*3^(1/2)*(359854610853484+(40500*I)*72450303118439610323^(1/2))^(1/3)+42281618707*(359854610853484+(40500*I)*72450303118439610323^(1/2))^(1/3)*((49000*(359854610853484+(40500*I)*72450303118439610323^(1/2))^(2/3)+42281618707*(359854610853484+(40500*I)*72450303118439610323^(1/2))^(1/3)+307992598564000)/(359854610853484+(40500*I)*72450303118439610323^(1/2))^(1/3))^(1/2)-153996299282000*((49000*(359854610853484+(40500*I)*72450303118439610323^(1/2))^(2/3)+42281618707*(359854610853484+(40500*I)*72450303118439610323^(1/2))^(1/3)+307992598564000)/(359854610853484+(40500*I)*72450303118439610323^(1/2))^(1/3))^(1/2))/((359854610853484+(40500*I)*72450303118439610323^(1/2))^(1/3)*((49000*(359854610853484+(40500*I)*72450303118439610323^(1/2))^(2/3)+42281618707*(359854610853484+(40500*I)*72450303118439610323^(1/2))^(1/3)+307992598564000)/(359854610853484+(40500*I)*72450303118439610323^(1/2))^(1/3))^(1/2)))^(1/2)

(3)

evalf(sol)

17.86765643+0.4233227866e-9*I

(4)

 

Download solveZ.mw

These examples are useless. See also an algebraic equivalent:

restart;
eq:=sin(x)+x^4+x^2+x+1;
s:=solve(eq, x);      # RootOf(eq, x)
is(eval(eq, x=s)=0);  # FAIL

 

This seems to be related to the bug in the evaluation of 0^n.
See strange odetest result. Is this valid? - MaplePrimes

restart;
diff(1,x)^n;  # 0
0^n;          # 0^n
diff(1,x)^n;  # 0^n

Also for  diff(1,x) replaced with sin(0).

It's a bug about 0^x, not about odetest.

restart;
simplify(0^x) assuming x>0;
                 0^x
normal(0^x) assuming x>0;
                 0^x
eval(0^x) assuming x>0;
                 0^x
expand(0^x) assuming x>0;
                 0^x
0.0^x assuming x>0;
                 0.^x
#########################
is(0^x = 0) assuming x>0;
                 true
limit(0^x, x=x) assuming x>0;
                 0
eval(z^x, z=0) assuming x>0;
                 0
simplify(sin(0)^x) assuming x>0;
                 0
is(0.0^x = 0) assuming x>0;
                 true
#########################
eval(z^x, z=0) assuming x<0;   # ?
                 0

The bug seems to be rather old.
Also strange, in Maple 2018,  0^x  automatically simplifies to 0 (without any assumption).
I suspect that 0^x = 0 was removed from automatic simplification but the evaluation/simplification was not modified.
 

1 2 3 4 5 6 7 Last Page 1 of 114