vv

13837 Reputation

20 Badges

9 years, 326 days

MaplePrimes Activity


These are replies submitted by vv

@toandhsp 

eq:=proc(L::listlist,x::name,y::name,z::name)
  primpart(LinearAlgebra:-Determinant(<Matrix([[x,y,z],L[]])|<1,1,1,1>>));
  %*signum(lcoeff(%))=0
end:

Note that this also works if the list contains floats.

@Kitonum 

If the polygon is not "convex", the order of the points is essential.
The triangles are colored in the order A1A2A3, A1A3A4, A1A4A5,...
so,  see:
PolyOnUnitSphere([ <1,2,1>, <1,0,0>, <0,1,0>, <0,0,1>]);

Probably inserting numbers near vertices as textplot could be useful.

Best regards,
V.A.

 

Indeed, e.g.

restart;
PolyOnUnitSphere:=proc(A::list(Vector[column](3)),pt:=true,sph:=true) #A[i] = directions (or points on sphere)
uses LinearAlgebra,plots,plottools;
local a:=map(Normalize,A,2), n:=nops(A), u,v,i, L,P:=NULL;
L:= seq( plot3d(1.01*Normalize(a[1]+v*(a[i]+u*(a[i+1]-a[i])-a[1]),2), u=0..1,v=0..1,color=red,style=surface,_rest), i=2..n-1);
if pt=true then P:= pointplot3d(eval(1.01*~a),symbolsize=20,color=blue,symbol=solidsphere)  fi;
display(`if`(sph=true,sphere(style=surface),NULL), L, P);
end:

PolyOnUnitSphere([ <0,0,1> , <1,0,0>, <1,1,-1.5>, <1,2,1>, <0,1,0>]);

 

@Markiyan Hirnyk 

I know the definitions (it's a part of my job to know them). I tried to explain the Maple point of view (that the argument of f is supposed to be an integer); it is mathematically OK. It would be easy in Maple to define f(x)=0 for x in R \ N but probably the actual implementation has some advantages (e.g. speed).

@sand15athome 

So, we have different opinions.

Let P be a discrete probability in N = {0,1,....}.
This means that P is defined on 2^N --> [0,1], (it is a measure).
Its probability function is
f : N --> R,  f(n) = P({n}).
Here f(5.1) does not make sense.
Maple has an extension F of f and returns F(5.1) instead. That's all.

In the case of a continuous distribution we have the ProbabilityDensityFunction.
For the Normal(0,1) distribution it is
f(t) = (1/2)*sqrt(2)*exp(-(1/2)*t^2)/sqrt(Pi),  t in R.
But here also, t=I (=sqrt(-1)) does not produce an error, f(I) is actually a real number, and I think that nobody sees this as a bug.

As a rule, Maple tries to use the largest possible domain of definition for a function.

 

We all know that Maple has bugs. But any CAS has.
It would be nice if Maple solves the bugs faster and maintains a list of known bugs and their status.
In your other thread (about Probability) the bugs are clear.
Here, ProbabilityFunction(X, 1.1) = 0 is OK: 1.1 is not in the sample (within current precision). Note that X is not supposed to take only integer values (unlike Geometric). The situation is not perfect but acceptable in my opinion (as long as it is documented).

I don't see any bug.

ProbabilityFunction(Geometric(p), t);
is defined clearly as piecewise(t < 0, 0, p*(1-p)^t)  for 0 < p <=1,  t::integer.
The fact that it returns values instead of an error when t is not integer should not be a problem, and it is easier then to work with floats (no need for round). [Think of n! for noninteger n].

max( maximize(a-b,x=0..1), maximize(b-a,x=0..1) );
convert(%, radical);

@Markiyan Hirnyk 

But it's not complicated. If alpha is algebraic and a[k] are its conjugates (k=1..n) considered by Norm, then the conjugates of x - alpha are x - a[k].
So,  mul(x - a[k], k=1..n)  = Norm(x - alpha) = the minimal polynomial of alpha.

@Markiyan Hirnyk 

f1 is an algebraic number (or element) over the field Q(z).
The conjugates of f1 are the roots of the minimal polynomial; ==> the mentioned expression of the minimal polynomial.

@Markiyan Hirnyk 

If alpha is an algebraic number (over a field)  expressed with RootOfs then

evala( Norm(x - alpha) )

is the minimal polynomial for alpha (by definition).
See ?evala,Norm

@Markiyan Hirnyk 

z>1 was considered implicitly because the ode was considered in an interval containing z=2 and z=3, corresponding to x=1 and x=2.
So, all we need to know is that the hypergeometric function
hypergeom([1/3, 2/3], [3/2], w)
exists (and is C^2) for w<=0.

I prefer to work in cartesian coordonates

restart;
with(plots):with(plottools):
f:=r^2 *cos(theta)+r*sin(theta):
r1:= 0.3+0.1*cos(theta):
r2:= 0.5+0.1*cos(theta):
p:=densityplot(f, theta=0..2*Pi, r=r1..r2,  
colorstyle = HUE, style = patchnogrid):
T:=transform( (u,v) -> [v*cos(u),v*sin(u)]):
display(T(p));

@arman 

When coords=polar, the axes are cartesian.
Why don't you plot directly in cartesian coordinates? Simply use x=r*cos(t), y=r*sin(t).
P.S. Your image is missing.

 

@one man 

Try this simple one which is obvious by hand:

x1^4 + x2^4 + x3^4 - 1 = 0, x3 = 0.

First 125 126 127 128 129 130 131 Last Page 127 of 176