7911 Reputation

17 Badges

8 years, 189 days

MaplePrimes Activity

These are replies submitted by Kitonum

@vv  Your procedure works well for polynomials with numerical coefficients, but if a polynomial contains parameters, then the procedure fails, for example
GetCoeff(x^2-a*x+5, x);


@vv   Perhaps to avoid this, it suffices to require that  f  be homeomorphic mapping?

@Markiyan Hirnyk    Of course, this example works properly only with an affine map. For non-linear mapping every facet of cuboid should be set separately.

with(plottools): with(plots):
f:=unapply([x^2+3,x*z+3, y-z+3], (x,y,z));
# A nonlinear mapping 
S1:=plot3d([x,0,z], x=0..1, z=0..2.5, style=surface, color=khaki):
S2:=plot3d([x,2,z], x=0..1, z=0..2.5, style=surface, color=khaki):
S3:=plot3d([x,y,0], x=0..1, y=0..2, style=surface, color=khaki):
S4:=plot3d([x,y,2.5], x=0..1, y=0..2, style=surface, color=khaki):
S5:=plot3d([0,y,z], y=0..2, z=0..2.5, style=surface, color=khaki):
S6:=plot3d([1,y,z], y=0..2, z=0..2.5, style=surface, color=khaki):
display(p, F(p), scaling=constrained, axes=normal, orientation=[-15,80], labels=[x,y,z]);




@toandhsp  Replace  %  by  %/sign(lcoeff(%))

@vv   Try this example

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

@vv   Very good solution, vote up. But can this technique be useful for a quadrilateral, etc ?

@dantevergil  The shortest ways Acer suggested above. If you do not want to use  remove  or  select  commands, here's another way without packages:

phephoi1 := proc (A, B)
local k, i, C;
for i from 1 to nops(A) do
   if A[i] in B then k:=k+1; C[k]:=A[i]; fi;
end do;
convert(C, list);
end proc:


Example of use:

A := [1, 2, 3, 5, 6, 7];
B := [2, 4, 7, 11, 8];
phephoi1(A, B);

@acer   Oh sure. My goal was to keep the idea of initial code, but to make it work.

@Zeineb I think it's possible, but I do not know how, because I do not work with Matlab.

A quote from the help:

"Calling Sequence
ProbabilityFunction(X, t, options)

X - algebraic; random variable or distribution
t - algebraic; point (assumed to be an integer) ...."


Theta:=[ 0, Pi/3, 2*Pi/3, Pi]:
Phi:=[ 0, Pi/3, 2*Pi/3, Pi, 4*Pi/3, 5*Pi/3, 2*Pi, 7*Pi/3]:
{seq(seq(F(theta,phi), phi=Phi), theta=Theta)}:
A:=plots[pointplot3d](%, color=red, symbol=solidcircle, symbolsize=15):
B:=plottools[sphere]([0,0,0], 1, style=surface):
C:=plots[spacecurve]([cos(t),0,sin(t)], t=0..2*Pi, color=blue):
C1:=plots[spacecurve]([cos(t)*cos(Pi/6),sin(t)*cos(Pi/6),1/2], t=0..2*Pi, color=blue):
C2:=plots[spacecurve]([cos(t)*cos(Pi/6),sin(t)*cos(Pi/6),-1/2], t=0..2*Pi, color=blue):
plots[display](A, B, seq(plottools[rotate](C,Pi/3*k,[[0,0,0],[0,0,1]]), k=1..6), C1, C2, axes=normal, view=[-1.4..1.4,-1.4..1.4,-1.4..1.4]);



@Markiyan Hirnyk 

B2 = (1/2)*sqrt(27*z^3-27*z^2+4) - (3/2)*z*sqrt(3*z-3) = 

= sqrt((27*z^3-27*z^2+4)/4) - sqrt((27*z^3-27*z^2)/4) >0  because  sqrt  is an

increasing function and   27*z^3 - 27*z^2>0  if  z>1

@Markiyan Hirnyk  I don't understand what your (-1)*(-1);  means ?

Under the condition  z>1  it's obvious that  B1>0  and  B2>0


@Markiyan Hirnyk   If  B1*B2 = 1  (see above) then  B1^(1/3) * B2^(1/3) = 1

@Lali_miani  I've already wrote  "To simplify the answer the numerical values of the system parameters should be specified" 

For example:

indets(Sys) minus {x, y, z};

L :=  %=~ [1, 2, 3, 4, 5, 6, 7, 8, 9];

solve(eval(Sys, L), {x, y, z});



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