Kitonum

21445 Reputation

26 Badges

17 years, 46 days

MaplePrimes Activity


These are replies submitted by Kitonum

@nm  I do not know an universal way to automatically solve this problem (finding of a domain). We could write a procedure for this  if Maple solved the problem even for the simplest elementary functions. For example, here are my attempts to find the domain for the function  sqrt  (the answer is obvious  x>=0):

restart;
solve(Im(sqrt(x))=0, x);
allvalues(%);
solve(sqrt(x)<0 or sqrt(x)>=0);
RealDomain:-solve(sqrt(x)<0 or sqrt(x)>=0);
solve(sqrt(x)<0 or sqrt(x)>=0) assuming real;   


 

@SGJanssens   M^(-1)

@nm Of course, from the standpoint of common sense, there is no difference. But Maple is a system of computer algebra and everything that is obvious to a person must be properly programmed. Clearly, developers have a lot more work to do on this.

For example, Maple does not know how to find  RealRange(0,2) union RealRange(1,3) :

R1:=RealRange(0,2);
R2:=RealRange(1,3);
R1 union R2;
simplify(%);
is(%=RealDomain(0,3));

                     

 

@Carl Love  We have

solve(evalc(Im(x*ln(y))), {x,y}); 
                                       
 {x = 0, y = y}, {x = x, 0 <= y}


But  ln(0)  does not exist.

Unfortunately, Maple makes mistakes in the simplest examples, for example:

solve(x*ln(y)<0);
RealDomain:-solve(x*ln(y)<0);
                                       
 {y = y, x < 0}, {y = y, 0 < x}
                                         {y = y, x < 0}, {y = y, 0 < x}
 

@Rouben Rostamian  Here is another animation, in which the quadrilateral takes various forms, in particular, becomes non-convex and even degenerate. For  t = 0  this coincides with my picture above.

restart;
VanAubel:=proc(t)
local P, Q, A, B, Squares, Pol, L1, L2, T1, T2;
uses plottools, plots;
P[1], P[2], P[3], P[4]:=<0,0>,<7*cos(t),7*sin(t)>,<sqrt(52)*cos(2*t+arctan(2/3)),sqrt(52)*sin(2*t+arctan(2/3))>,<sqrt(5)*cos(3*t+arctan(2)),sqrt(5)*sin(3*t+arctan(2))>:
P[5]:=P[1]:
assign(seq(Q[i]=(P[i]+P[i+1])/2+<0,1; -1,0>.(P[i+1]-P[i])/2, i=1..4)):
assign(seq(A[i]=Q[i]+(Q[i]-P[i]), i=1..4)):
assign(seq(B[i]=Q[i]+(Q[i]-P[i+1]), i=1..4)):
Pol:=polygon([seq(convert(P[i],list),i=1..4)],style=line, color=blue, thickness=2):
Squares:=seq(polygon(convert~([P[i],P[i+1],A[i],B[i]],list),style=line, color=green, thickness=2), i=1..4):
L1:=line(convert~([Q[1],Q[3]],list)[], color=red, thickness=2):
L2:=line(convert~([Q[2],Q[4]],list)[], color=red, thickness=2):
T1:=seq(textplot([convert(P[i],list)[],convert(cat(P,i),string)], align=left), i=1..4):
T2:=seq(textplot([convert(Q[i],list)[],convert(cat(Q,i),string)], align={above,left}), i=1..4):
display(Pol,Squares, L1, L2, T1, T2, scaling=constrained, axes=none, size=[400,500]);
end proc:

plots:-animate(VanAubel,[t], t=0..2*Pi, frames=180, paraminfo=false);

@tomleslie If we add the multiplier  signum(x) , then your example will work in all cases (of course in the real domain):

restart;
A:=sqrt(x^2+y^2)/x;
B:=signum(x)*sqrt(collect(A^2,x));
eval(A,{y=1,x=-2});
eval(B,{y=1,x=-2});

 

@vv  A wonderful geometric application of complex numbers.

@Carl Love  In this context, assuming real  is needed not for  solve, but for the correct operation of  Re  and  Im  commands. Therefore, your criticism seems unfounded to me.

Compare:

Re(x+I*y);
Re(x+I*y) assuming real;

 

@Carl Love  Here we do not get anything new. This will not be a solution for any  , but only for  k=1  or  k=-1 . See:

restart;
sys:={-6*c+(3/2)*c^2-2*b-3*b*c+(3/2)*b^2-3*a*c+(k^2)*b-b+(3/2)*(a^2)+(k^2)*a-a=0,
-2*b-3*b*c+3*(b^2)-6*a*c+2*(k^2)*c-2*c-9*a*b+3*(k^2)*b-3*b+6*(a^2)+4*(k^2)*a-4*a=0,
(3/2)*(b^2)-3*a*c+(k^2)*c-c-9*a*b+3*(k^2)*b-3*b+9*(a^2)+6*(k^2)*a-a=0, 
-3*a*b+(k^2)*b-b+6*(a^2)+4*(k^2)*a-4*a=0, 
(3/2)*(a^2)+(k^2)*a-a=0}:
simplify(eval(sys, {a = (k^2-1)/3, b= 0, c= 0}));
solve(%);

@Sabrina Kamal  Just add this command in the end of your code.

Please upload the worksheet in which this error occurs using the thick green up-arrow in the MaplePrimes's editor.

@Carl Love  Thank you for indicating this inaccuracy.
At first I did not notice the third example at all, but when I noticed, I forgot about this phrase.
By the way, if we are very scrupulous, it is worth noting that, for example,  A = 1 is not always, but if  s<>Pi*k  (k  is an integer) because

eval(A, s=Pi*k) assuming k::integer;
Error, (in assuming) when calling '`one of {cos, eval, sin}`'. Received: 'numeric exception: division by zero'

 

@farah adanan Probably you are right, since in Maple 2018 everything works properly. I do not have Maple 18.

Addition - try to remove this line  local gamma;  as Preben indicated.

@farah adanan Probably you have not fixed everything. Save your worksheet in which the error occurs and load a link to it here using the bold green up-arrow in the mapleprime's editor. I'll check.

@Markiyan Hirnyk  Obviously the reason is in  rational  option. Examples show that in a solidly filled region the function takes complex values.
Look at these simple examples:

plots:-implicitplot(sqrt(-x^2-y^2), x=0..1,y=0..1);
plots:-implicitplot(sqrt(-x^2-y^2), x=0..1,y=0..1, rational);
plots:-implicitplot(sqrt(-x^2-y^2), x=0..1,y=0..1, gridrefine=2, rational);

 

First 43 44 45 46 47 48 49 Last Page 45 of 133