Kitonum

21880 Reputation

26 Badges

17 years, 242 days

MaplePrimes Activity


These are answers submitted by Kitonum

Formally to extract the sequence of used arithmetic operators from  an expression you can as follows:

a:=3*x^3-5*x^2+3*y:
S:=convert(a,string):
Operators:={"+", "-", "*", "^"}: 
StringTools:-Select(s->is(s in Operators), S);
seq(s, s=%);
ListTools:-Collect([%]);

                               


Edit.

Give these points names  A, B, C, E  that mean their coordinates:

curve := y^2 = x^3 - 43*x + 166;
Points:=[[3,8],[-5,16],[11,32],[3,-8]]:
A, B, C, E:= op(Points);
plots:-display([
plot(+sqrt(rhs(curve)),x = -10..12),
plot(-sqrt(rhs(curve)),x = -10..12),
plots:-pointplot([A, B, C, E],symbol = solidbox)
]);


To label these points on the plot, use plots:-textplot command.

Addition. After you give names to these points, when using plots:-textplot command, you do not need to retype their coordinates (you can just refer to their names):

restart;
curve := y^2 = x^3 - 43*x + 166:
Points:=[[3,8],[-5,16],[11,32],[3,-8]]:
Labels:=["A","B","C","E"]:
plots:-display([
   plot(+sqrt(rhs(curve)),x = -10..12),
   plot(-sqrt(rhs(curve)),x = -10..12),
   plots:-pointplot(Points, symbol = solidbox, color=[green,red,    blue,yellow], symbolsize=17), 
   plots:-textplot([seq([op(Points[i]),Labels[i]], i=1..4)],  align=above, font=[roman,16])
]);

 



Edit.

If you want Maple not to open the parentheses, then do this:

z:=-x-y*I;
(-1)*``(-z);

                            z := -x - y I
                             - (x + y I)

or immediately type

z:=-``(x+y*I);
                           z := - (x + y I)


If later you want Maple to open parentheses, then use  expand command:

z:=-``(x+y*I);
expand(z);

                                 -x - y I


This way you can always сarry the desired factor out of brackets of some  expression, for example:

P:=-3/2*x^2-x+5/2:
-1/2*``(P/(-1/2));
                                     
  -1/2*(3*x^2+2*x-5)


Edit.

The domain of definition of your function is a semicircle. Use the direct plotting in this domain:

plot3d(4*x*y^2-x^2, x=0..1, y=-sqrt(1-x^2)..sqrt(1-x^2), scaling=constrained, numpoints=10000, axes=normal);

                   

 

Another option is the using of the polar coordinates:

plot3d(eval([x,y,4*x*y^2-x^2],[x=r*cos(t),y=r*sin(t)]), r=0..1, t=-Pi/2..Pi/2, scaling=constrained, axes=normal);

VerticesOfCuboid:=proc(V1::list, V2::list)
[V1, seq(subsop(i=V2[i], V1), i=1..3), V2, seq(subsop(j=V1[j], V2), j=1..3)];
end proc: 


Example of use:

VerticesOfCuboid([1,1,2], [3,4,5]);

               [[1, 1, 2], [3, 1, 2], [1, 4, 2], [1, 1, 5], [3, 4, 5], [1, 4, 5], [3, 1, 5], [3, 4, 2]]


Addition. In geom3d you can specify a cuboid by  parallelepiped  command and find its parameters by other commands (detail, vertices, faces  and so on).

There are several ways to do this. Here are two ones:

restart;
f := unapply(x*(8*x^2+5*x+cos(y)), x, y);
p := solve({diff(f(x, y), x) = 0, diff(f(x, y), y) = 0}, {x, y});
eval([x,y], p[1]); 
# The first way
assign(p[1]);  # The second way 
x, y; 

I understood  this  to mean that  P  is an operator in the functional space and therefore we can do so:

P:=u->(i,j)->u(i+1,j);


Example of use:

u:=(i,j)->i^2+j^2;
v:=P(u);  
# v is a new function
v(2,3);
                                    

 

For  Q  everything is similar.

Example:

y:=t-><sin(t), cos(t), exp(2*t)>;
series~(y(t), t, 3);

                                

For the example, I have specified values for  u, L, :

restart;
z:=(-1/(4*(-u+L)))*(4*p^2*b^2*d-3*g*c*p^2);
u:=2:  L:=1:  c:=0.6: 
constr:={ 1-(2*d)/(p*(sqrt(g)+1))<=b, b<=1, 0<=d, d<=L, c<=p, p<=u, 1<=g, g<=4};  
Optimization:-Maximize(z, constr);

       

 

Edit.

 

 

You can use  `A=B=C`  instead. Output will be without any quotes.

If you need to use this as a logical condition (for example inside a selection statement  if ... fi), then write  A=B and B=C

Try (only for purely visual purposes)

exp(`2 t`) ;


This is a workaround for Classic Interface. In Standard one there are no any parentheses around the exponent.


Edit.

Use  InertForm  package.

Example:

A:=<1,2; 3,4>:
B:=<3,4; 1,2>:
with(InertForm):
L := Parse("A*B"):
Display(L) = A.B;

                      

A+`&lambda;I`=<1,2; 3,4>;  # Or

A+`&lambda; I`=<1,2; 3,4>;                     

                               

To solve this problem,  combinat:-composition  command is useful. 

restart;
mondeg:=proc(var::list(name), d::nonnegint)
local n, L;
uses combinat, ListTools;
n:=nops(var);
L:=[seq(map(t->t-~1, Reverse(convert(composition(k+n, n),list)))[], k=0..d)];
map(t->`*`((var^~(t))[]), L);
end proc:


Example of use:

mondeg([x,y,z], 3);
         [1, x, y, z, x^2, x*y, x*z, y^2, y*z, z^2, x^3, x^2*y, x^2*z, x*y^2, x*y*z, x*z^2, y^3, y^2*z, y*z^2, z^3]

 

P:=6*x^2+x-2:
factor(P);
map(t->lcoeff(t)*``(t/lcoeff(t)), factor(P));

                                                             (3*x+2)*(2*x-1)
                                                            6*(x+2/3)*(x-1/2)

Does this match what you wanted?

First 145 146 147 148 149 150 151 Last Page 147 of 292