Kitonum

19049 Reputation

26 Badges

14 years, 140 days

MaplePrimes Activity


These are answers submitted by Kitonum

Obviously, if  |z - 6*I| = 3  then  all such points  z  lie on the circle with center at the point  [0, 6]  and radius :

restart;
z:=3*cos(t)+(3*sin(t)+6)*I; 
minimize(argument(evalc(z)), t=0..2*Pi, location);
eval(z, %[2,1,1][]);  # The answer

                             

restart;
n:=4:
combinat:-permute([1$n,-1$n],n);

     [[1, 1, 1, 1], [1, 1, 1, -1], [1, 1, -1, 1], [1, 1, -1, -1], [1, -1, 1, 1], [1, -1, 1, -1], [1, -1, -1, 1], [1, -1, -1, -1], [-1, 1, 1, 1], [-1, 1, 1, -1], [-1, 1, -1, 1], [-1, 1, -1, -1], [-1, -1, 1, 1], [-1, -1, 1, -1], [-1, -1, -1, 1], [-1, -1, -1, -1]]                  

Try the following simple code:

restart;
a:=a+1;


You will probably get the same error. So deal with your last assignments.

Try the following simple code:

restart;
a:=a+1;


You will probably get the same error. So deal with your last assignments.

It's easier to do this using the  plots:-inequal  command:

restart;
A:=plot(1/x, x=0..3, 0..3, thickness=2):
B:=plots:-inequal({x>=0,x<=1}, x=0..3,y=0..3, optionsfeasible = [color = "LightBlue"]):
plots:-display(A,B);

                 

 

`%+`(seq((-1)^(n + 1)/(2*n - 1), n = 1 .. 4));

                                

                   

Here is the fragment from the help  ?plot,structure :

"GRID(a..b, c..d, A)
The GRID structure represents surfaces in 3-D space defined by a uniform sampling over a rectangular (aligned) region of the plane.  The GRID structure takes the form GRID(a..b, c..d, A) where a..b is the x-range, c..d is the y-range, and A is a two-dimensional Array.  If you have an m-by-n grid, then element A[i, j] is the function value at grid point (i, j), for i in 1..m and j in 1..n.  The Array A may be replaced by a list of the form [[z11,...z1n], [z21,...z2n],...[zm1...zmn]] where zij is the function value at grid point (i, j)."

(i, j) are not values of x and y, but indexes for function z values. In your example i=1..4, j=1..3

Here are two simple steps to get the desired simplification. We take the second step only if we are not satisfied with the first one:

simplify(evalc(w)); # The first step
numer(%)/expand(denom(%)); # The second step

                                         


You've spent a lot of time looking for a one-line code. You could use it to do more useful things.

The standard way is to use the  piecewise command:

restart;
f:=piecewise(x<0,1/x, x>=0,sqrt(x));
plot(f, x=-4..4, -4..2, scaling=constrained, discont);

If you don't like the notation Maple uses, you can enter the notation you want. For example, you could write e^x instead of exp(x) (but first you must to assign  e:=exp(1) ). Some conversions are also useful,  for example  convert(..., elementary)  or   convert(..., factorial)  or   convert(..., ln)  ans so on.

You wrote that you don't like the black border when we use the  legend  option. We can show the legends without using this option and without any borders. Here are two solutions to the problem. In the left picture below, the equations of the graphs are written next to the corresponding lines. In the right picture, the equations are written next to small segments of the corresponding color (as done when using the  legend option):

restart;
p:=eval([x,y],solve({y=1/x,y=1/x^2},{x,y})):
A:=plot([1/x,1/x^2], x=0..4, 0..4, color=[red,blue]):
T:=plots:-textplot([[1,1,typeset("(", p[1],",",p[2], ")")],[0.5,3.4,y=1/x^2],[2.8,0.3,y=1/x]],align={above,right}, font=[times,bold,14]):
P:=plots:-pointplot([1,1], symbol=solidcircle, symbolsize=15):
T1:=plots:-textplot([[1.2,1.1,typeset("(", p[1],",",p[2], ")")],[3.5,2,y=1/x^2],[3.5,2.6,y=1/x]], font=[times,bold,14]):
A1:=plot([[[2.5,2],[3,2]],[[2.5,2.6],[3,2.6]]], color=[blue,red]):
P1:=plots:-display(A,T,P):
P2:=plots:-display(A,T1,P,A1):
plots:-display(<P1 | P2>);

   

                 

The  plot  command has no options for constructing asymptotes, but you can first automatically calculate the asymptotes using the  Student:-Calculus1:-Asymptotes  command, and then plot them using the formulas already found. In your example below, for plotting I have replaced the asymptote  x=0  with  x=0.05  so that it does not coincide with the vertical axis:
 

restart:
expr:=(x^2 + 5*x + 1)/abs(x):
A:=plot(expr, x= -8..6, -5.5..12, color= green, thickness=2, legend=(f(x)=expr)):
As:=Student:-Calculus1:-Asymptotes(expr, x); # List of all the asymptotes
As1:=subsop(3=(x=0.05),As):
B:=plots:-implicitplot(As1, x=-8..6, y=-5.5..12, linestyle=3, color=[blue,cyan,red], thickness=0, legend=As):
plots:-display(A, B, size=[400,500]);

[y = -x-5, y = x+5, x = 0]

 

 

 


 

Download asymp.mw

The cause of the problem is easy to see if your code is written in 1Dmath:

restart;

K__vxa[1] := 2.0154553049*10^17;

0.2015455305e18

(1)

`#mrow(mi("\`K__vxa\`"),mfenced(mn("1"),open = "&lsqb;",close = "&rsqb;"))`+K__vxa[1];

`#mrow(mi("\`K__vxa\`"),mfenced(mn("1"),open = "&lsqb;",close = "&rsqb;"))`+0.2015455305e18

(2)

NULL

Download Prj_1Dmath.mw

Should be Pi  not  pi:

evalc(exp(2*I*k*Pi)) assuming k::integer;
evalc(exp((2*k+1)*I*Pi)) assuming k::integer;
evalc(exp(I*Pi/2));
evalc(exp(3*I*Pi/2));
evalc(exp(I*Pi/3));

Another easy way is to replace the curve with a polygon with more sides (I used 500 ones):

#Circle of reference
R0 := 1:
C0 := t-> < cos(t), sin(t), 0 >:

#Variable radius
R := t-> R0*(1 + 1/2*sin(t)):

#Variable phase
Dt := t-> Pi/2*sin(2*t):

#CONCAVE Curve
C := t-> R(t)*C0(t - Dt(t)):
'C(t)' = C(t);

#Range
t1, t2 := 0, 2*Pi:

#Plot
GC := plots:-spacecurve(C(t), t = t1..t2, color = "Red", thickness = 3
, linestyle = solid
, scaling = constrained, axes = frame, orientation = [50,40,0]):
GB:=plottools:-polygon([seq(convert(C(t),list),t=0..evalf(2*Pi),evalf(2*Pi/500))], color=red):
plots:-display(GB );

C(t) = (Vector(3, {(1) = (1+(1/2)*sin(t))*cos(t-(1/2)*Pi*sin(2*t)), (2) = (1+(1/2)*sin(t))*sin(t-(1/2)*Pi*sin(2*t)), (3) = 0}))

 

 

 

Download PPP.mw

First 7 8 9 10 11 12 13 Last Page 9 of 272