I want to plot the astroid by the following code, but only the part in the first quadrant appears. I don't know that is wrong and how to solve the problem. Thanks.
with(plots):
a:=1:
implicitplot(x^(2/3)+y^(2/3)=a^(2/3),x=-a..a,y=-a..a);
In fact, the same problem occurs in plotting explicit power functions with fractional powers. The following can only produce half of the whole graph. What can't Maple plot the whole graph in the domain of the function y=x^(1/3)?
If you read the help-page root, you'll see that it returns the "principal root", defined by the formula root(x,n) = exp(1/n * ln(x)). The help-page ?^ also summarizes this. In your example, x^(1/3) acts like root(x,3). For example,
> (-1.0)^(1/3);
0.5000000001 + 0.8660254037 I
> root(-1.0,3);
0.5000000001 + 0.8660254037 I
The complex values don't show up on your graph, as they are not numeric (real).
On the other hand, surd returns -(-x)^(1/n) for x<0 when n is an odd integer. See its help-page. So for your plot, try,
Thanks. But how can I solve the problem in Maple 8?
It seems that Maple does not allow power functions with fractional powers or decimal powers to take negative values even if they are defined there like y=x^(1/3)..
The same problem with plot
In fact, the same problem occurs in plotting explicit power functions with fractional powers. The following can only produce half of the whole graph. What can't Maple plot the whole graph in the domain of the function y=x^(1/3)?
with(plots):
plot(x^(1/3),x=-2..2,thickness=3);
principal root
If you read the help-page root, you'll see that it returns the "principal root", defined by the formula root(x,n) = exp(1/n * ln(x)). The help-page ?^ also summarizes this. In your example, x^(1/3) acts like root(x,3). For example,
> (-1.0)^(1/3); 0.5000000001 + 0.8660254037 I > root(-1.0,3); 0.5000000001 + 0.8660254037 IThe complex values don't show up on your graph, as they are not numeric (real).
On the other hand, surd returns -(-x)^(1/n) for x<0 when n is an odd integer. See its help-page. So for your plot, try,
Reading the help-pages is generally a good idea.
acer
surd
In Maple 11.02,
acer
How to solve it in Maple 8?
Thanks. But how can I solve the problem in Maple 8?
It seems that Maple does not allow power functions with fractional powers or decimal powers to take negative values even if they are defined there like y=x^(1/3)..
works for me
These two examples below work for me in Maple 8,
acer
Ok in Maple 8
Yes, both work very well in Maple 8.
So my problem is completely solved.
Thank you very much.
plot(surd(x,3),x=-2..2,thickness=3);
with(plots): a:=1:
implicitplot(surd(x^2,3)+surd(y^2,3)=a^(2/3),x=-a..a,y=-a..a);
surd
Thank you, acer.
Using surd (which I don't know before) in Maple 8 can solve the second problem by the following code (which can produce the whole graph):
with(plots):
plot(surd(x,3),x=-1..1);