vv

13822 Reputation

20 Badges

9 years, 316 days

MaplePrimes Activity


These are answers submitted by vv

A strange fact (which I don't understand) is that in Maple there are both left and right versions of spherical coordinates!

The left one is for plot3d:
[u,v,w] -> [u*cos(v)*sin(w), u*sin(v)*sin(w), u*cos(w)]

and the right one is in VectorCalculus:
[u,v,w] -> [u*cos(w)*sin(v), u*sin(w)*sin(v), u*cos(v)].

Of course, as Carl has shown they can be redefined by the user, but it is confusing.

restart;
S:= rhs~(solve({-x-y+3*z =a, -x+2*y = b, 3*x-2*y-z = c}, [x,y,z])[]):
A:=eval(S, [a=1,b=0,c=0]):
B:=eval(S, [a=0,b=1,c=0]):
C:=eval(S, [a=0,b=0,c=1]):
OO:=[0,0,0]:
plots:-polygonplot3d([[OO,A,B], [OO,A,C], [OO,B,C]]);

In your example, you can do this only if the rank of the system is r=19 and the rank corresponding to the unknowns Z1,...,Z19 is also r=19.
In this case you can solve wrt Z1,...,Z19, e.g.
solve( sys, {seq(Z||i,i=1..r)} );

At top level `.` is used as a noncommutative (but associative) operator not related to any algebraic structure.
It was designated mainly for rtables.
You can see this executing

showstat(`.`);

 

Note that generally, (a.b)^(-1)  is not equal necessarily to  b^(-1) . a^(-1), because e.g. a^(-1) may not exist.
For example:

 

a:=<1,2,3;4,5,6>;
b:=<1,2;3,4;5,6>;

a := Matrix(2, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (2, 1) = 4, (2, 2) = 5, (2, 3) = 6})

 

b := Matrix(3, 2, {(1, 1) = 1, (1, 2) = 2, (2, 1) = 3, (2, 2) = 4, (3, 1) = 5, (3, 2) = 6})

(1)

(a.b)^(-1);

Matrix([[16/9, -7/9], [-49/36, 11/18]])

(2)

a^(-1);

Error, (in rtable/Power) power -1 not defined for non-square Matrices; try LinearAlgebra[MatrixInverse] to obtain a pseudo-inverse

 

 

Of course, as you have noticed, some packages (e.g. GroupTheory) may implement special simplification rules concerning `.` in some contexts.

AFAIK in Physics package, a noncommutative multiplication is implemented
(actually, here `.` and `*` are redefined), but I don't use this package and I cannot say more.

The problem reduces to compute

 

J:=Int( ln(1-y)*y^a*(1-y)^b, y=0..1);

Int(ln(1-y)*y^a*(1-y)^b, y = 0 .. 1)

(1)

(a>-1, b>-1)

 

Maple is not able to find it without a little help.

 

Jn:=-(1/n)*Int( y^(a+n)*(1-y)^b,y=0..1);

-(Int(y^(a+n)*(1-y)^b, y = 0 .. 1))/n

(2)

jn:=value(Jn);

-GAMMA(b+1)*GAMMA(a+n+1)/(n*GAMMA(a+b+n+2))

(3)

simplify( sum(jn, n=1..infinity) ) assuming a>-1,b>-1;

-(Psi(a+b+2)*b^2-Psi(3+b)*b^2+3*b*Psi(a+b+2)-3*Psi(3+b)*b+2*Psi(a+b+2)-2*Psi(3+b)+2*b+3)*GAMMA(a+1)*GAMMA(b+1)/((b^2+3*b+2)*GAMMA(a+b+2))

(4)


 


 

M := Matrix(14, 2, [[0, 0], [0, 4170], [1, 3966], [1, 3466],
[3, 3058], [3, 3058], [4, 1854], [4, 1354], [7, -2258],
[7, -2758], [8, -3962], [8, -3962], [10, -4370], [10, 0]]):

pcw:=proc(M::Matrix,x)
local m:=upperbound(M,1),i,p:=NULL;
for i to m-1 do
  if M[i,1]<>M[i+1,1] then
    p:=p, x<M[i+1,1], M[i,2]+(x-M[i,1])/(M[i+1,1]-M[i,1])*(M[i+1,2]-M[i,2]);
  fi
od;
piecewise(p,undefined)
end:

f:=pcw(M,x):
#plot(f,x=0..10);
a:=solve(f,x); evalf(a);
'area'=int(f,x=0..a);  evalf(%);

3085/602

 

5.124584718

 

area = 8313225/602

 

area = 13809.34385

(1)

restart;

Edit:
I have interpreted your matrix as representing a piecewise linear (discontinuous) function (as your plot shows).

I think that this is intentional. After all, we can see 10 as a binary number.

b:=convert(0.01,binary);
    .1010001111 10^-6
op(b);
   
1010001111, -16
``(op(1,b))*2^(``(op(2,b)));

 

 

 

 

 

 

Use one of the following:

plot3d(p1, -1 .. 1, -1 .. 1);

expr:=piecewise(x^2+y^2 <= 1, x*y-y^2, 0);
plot3d(expr, x = -1 .. 1, y = -1 .. 1);

plot3d('p1(x,y)', x = -1 .. 1, y = -1 .. 1);

 

 

The command to plug n=1 into the expression S is:
eval(S, n=1);

The command solve is to find the root(s) of the equation S=0, and the syntax solve(S, n=1) is wrong.
You should read (or at least browse) the Maple User Manual.

No need for assumptions, but instead:

- Don't use square brackets [ ... ],  they are list delimiters.
- Don't use inert Int , or use value(%) after that.
- (optional) use Maple (1D) input.

int( (x/L)^3 - 1, x=0..L );

           

                              

 

Yes, arrays of plots refuse to be exported (by context menu or by plottools:-exportplot).
Workaround:

restart;
p:=seq(plot(x^k,x=-1..1),k=1..4):
plotsetup(png,plotoutput="d:/temp/ex-array.png");
plots:-display(<p[1],p[2];p[3],p[4]>);
plotsetup(default);


subs(_Z9 = n, rhs(symbolic));
(of course the numeric suffix may differ).

 


 

Just describe the body using inequalities:

 

c(x) <= y <= d(x),   a <= x <= b

and use the simple and well-known formulae.

This is in two dimensions. Similarly for 3 or more.

(It may be needed to decompose the body into several such regions.)

 

Example for a upper half disk:

A:=  [y = 0 .. sqrt(1-x^2), x = -1..1] ;

[y = 0 .. (-x^2+1)^(1/2), x = -1 .. 1]

(1)

d:=1; # density
M := int(d,A);
xM:=int(x*d,A)/M;
yM:=int(y*d,A)/M;

1

 

(1/2)*Pi

 

0

 

(4/3)/Pi

(2)

When coords=cylindrical,  r  is ploted as a function of theta and z.
Even in your worksheet the notation is misleading; you use plot3d( f(r), theta=..., r=...)
but actually r should be z; it does not matter, of course, but your intentions are then not clear.

evalb(evalf[3](Pi=3.14));
                              true
evalb(evalf[4](Pi=3.14));
                             false

 

First 96 97 98 99 100 101 102 Last Page 98 of 120