Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

20 years, 337 days
Mihailovs, Inc.
Owner, President, and CEO
Tyngsboro, Massachusetts, United States

Social Networks and Content at Maplesoft.com

Maple Application Center

I received my Ph.D. from the University of Pennsylvania in 1998 and I have been teaching since then at SUNY Oneonta for 1 year, at Shepherd University for 5 years, at Tennessee Tech for 2 years, at Lane College for 1 year, and this year I taught at the University of Massachusetts Lowell. My research interests include Representation Theory and Combinatorics.

MaplePrimes Activity


These are replies submitted by Alec Mihailovs

You are welcome! I like to read replies like that - and I should say that they are very rare. In most cases I don't get any reply at all (and sometimes replies are quite insulting.)
Actually, it can be done quite simple,
r:=rand(8):
G:=GF(2,3,x^3+x+1):
M:=Matrix(3,()->G[ConvertIn](x^r()));

                     [       2           2         2]
                     [  x + x       1 + x     1 + x ]
                     [                              ]
                M := [                   2          ]
                     [    x         x + x       1   ]
                     [                              ]
                     [         2                 2  ]
                     [1 + x + x       x         x   ]
                
T:=a->map(c->modp1(ConvertOut(c,x),2),a):
`&*`:=(a,b)->map(G[ConvertIn],T(a).T(b)):
DetG:=G[ConvertIn]@LinearAlgebra:-Determinant@T:
Ad:=a->map(G[ConvertIn],LinearAlgebra:-Adjoint(T(a))):
Inv:=M->map(G[`*`],Ad(M),G[inverse](DetG(M))):
For example,
Inv(M);

                   [                   2          ]
                   [    x         1 + x       1   ]
                   [                              ]
                   [         2         2          ]
                   [1 + x + x     1 + x       x   ]
                   [                              ]
                   [                             2]
                   [    0         1 + x     1 + x ]

Inv(M) &* M;

                            [1    0    0]
                            [           ]
                            [0    1    0]
                            [           ]
                            [0    0    1]

DetG(M);
                                     2
                                x + x
Actually, it can be done quite simple,
r:=rand(8):
G:=GF(2,3,x^3+x+1):
M:=Matrix(3,()->G[ConvertIn](x^r()));

                     [       2           2         2]
                     [  x + x       1 + x     1 + x ]
                     [                              ]
                M := [                   2          ]
                     [    x         x + x       1   ]
                     [                              ]
                     [         2                 2  ]
                     [1 + x + x       x         x   ]
                
T:=a->map(c->modp1(ConvertOut(c,x),2),a):
`&*`:=(a,b)->map(G[ConvertIn],T(a).T(b)):
DetG:=G[ConvertIn]@LinearAlgebra:-Determinant@T:
Ad:=a->map(G[ConvertIn],LinearAlgebra:-Adjoint(T(a))):
Inv:=M->map(G[`*`],Ad(M),G[inverse](DetG(M))):
For example,
Inv(M);

                   [                   2          ]
                   [    x         1 + x       1   ]
                   [                              ]
                   [         2         2          ]
                   [1 + x + x     1 + x       x   ]
                   [                              ]
                   [                             2]
                   [    0         1 + x     1 + x ]

Inv(M) &* M;

                            [1    0    0]
                            [           ]
                            [0    1    0]
                            [           ]
                            [0    0    1]

DetG(M);
                                     2
                                x + x
Also, it is convenient to use map for producing a list from a list,
plotList:=map(plot,fns,x=-3..3):
By the way, in the described situation the plot can be created without display, just as
plot(fns,x=-3..3);
that has an additional advantage of using different colors for different curves.
It is possible to add { from the lhs,
s:=MathML:-Export(piecewise(x+2*y=0,``,x+4*y+3*z=5,``,x+y+z=0,``)):
MathML:-Import(s);

              PIECEWISE([``, x+2*y = 0],[``, x+4*y+3*z = 5],[``, x+y+z = 0])
It is possible to add { from the lhs,
s:=MathML:-Export(piecewise(x+2*y=0,``,x+4*y+3*z=5,``,x+y+z=0,``)):
MathML:-Import(s);

              PIECEWISE([``, x+2*y = 0],[``, x+4*y+3*z = 5],[``, x+y+z = 0])
In Standard Maple, you can set its color to white, like in the following example,
plot(x^2-1,x=-2..2,axis[2]=[color=white]);
In Standard Maple, you can set its color to white, like in the following example,
plot(x^2-1,x=-2..2,axis[2]=[color=white]);
Manuals were produced by exporting Maple (command line or Classic Maple) to LaTeX, not by using the Document mode.
Manuals were produced by exporting Maple (command line or Classic Maple) to LaTeX, not by using the Document mode.
It can be done with colors as
with(plots):
a:=implicitplot([2*R^3-R^2+5*R^2*q+4*R*q^2+q^3=0,
                 q^3+3*R*q^2-R^2+3*R^2*q+R^3=0,
                 R^2+2*R^3+3*R^2*q-q^3=0,
                 q^2+R=.3],R=0..2,q=0..1,
   color=[red,green,blue,black],numpoints=100000):
f:=piecewise(2*R^3-R^2+5*R^2*q+4*R*q^2+q^3>0 and
   q^3+3*R*q^2-R^2+3*R^2*q+R^3>0 and R^2+2*R^3+3*R^2*q-q^3>0 and
   q^2+R>.3,1,0):
b:=implicitplot(f>0.5,R=0..2,q=0..1,filled=true,
                numpoints=100000,coloring=[green,white]):
display(a,b);
What you wanted exactly, can be done as
with(plots):
a:=implicitplot([2*R^3-R^2+5*R^2*q+4*R*q^2+q^3=0,
                 q^3+3*R*q^2-R^2+3*R^2*q+R^3=0,
                 R^2+2*R^3+3*R^2*q-q^3=0,
                 q^2+R=.3],R=0..2,q=0..1,
   color=[red,green,blue,black],numpoints=100000):
with(plottools):
c:=seq(line([max(.3-q^2,0),q],[2,q]),q=0..1,0.05):
d:=seq(line([R,max(fsolve(q^3+3*R*q^2-R^2+3*R^2*q+R^3,q),0)],
      [R,min(fsolve(R^2+2*R^3+3*R^2*q-q^3,q),1)]),R=0..2,0.1):
display(a,c,d);
It can be done with colors as
with(plots):
a:=implicitplot([2*R^3-R^2+5*R^2*q+4*R*q^2+q^3=0,
                 q^3+3*R*q^2-R^2+3*R^2*q+R^3=0,
                 R^2+2*R^3+3*R^2*q-q^3=0,
                 q^2+R=.3],R=0..2,q=0..1,
   color=[red,green,blue,black],numpoints=100000):
f:=piecewise(2*R^3-R^2+5*R^2*q+4*R*q^2+q^3>0 and
   q^3+3*R*q^2-R^2+3*R^2*q+R^3>0 and R^2+2*R^3+3*R^2*q-q^3>0 and
   q^2+R>.3,1,0):
b:=implicitplot(f>0.5,R=0..2,q=0..1,filled=true,
                numpoints=100000,coloring=[green,white]):
display(a,b);
What you wanted exactly, can be done as
with(plots):
a:=implicitplot([2*R^3-R^2+5*R^2*q+4*R*q^2+q^3=0,
                 q^3+3*R*q^2-R^2+3*R^2*q+R^3=0,
                 R^2+2*R^3+3*R^2*q-q^3=0,
                 q^2+R=.3],R=0..2,q=0..1,
   color=[red,green,blue,black],numpoints=100000):
with(plottools):
c:=seq(line([max(.3-q^2,0),q],[2,q]),q=0..1,0.05):
d:=seq(line([R,max(fsolve(q^3+3*R*q^2-R^2+3*R^2*q+R^3,q),0)],
      [R,min(fsolve(R^2+2*R^3+3*R^2*q-q^3,q),1)]),R=0..2,0.1):
display(a,c,d);
A region given by an inequality can be colored using implicitplot command. For example,
plots[implicitplot](x^2+y^2<1,x=-2..2,y=-2..2,filled=true);
Colors can be changed by using coloring option. For example,
plots[implicitplot]((x-0.5)^2+(y-0.5)^2<1,x=-2..2,y=-2..2,filled=true,
coloring=[green,white]);
For several inequalities it can be done as in the following example,
with(plots):
a:=implicitplot([2*R^3-R^2+5*R^2*q+4*R*q^2+q^3=0,
                 q^3+3*R*q^2-R^2+3*R^2*q+R^3=0,
                 R^2+2*R^3+3*R^2*q-q^3=0,
                 q^2+R=.3],R=0..2,q=0..1,
   color=[red,green,blue,black],numpoints=100000):
f:=piecewise(2*R^3-R^2+5*R^2*q+4*R*q^2+q^3>0 and
   q^3+3*R*q^2-R^2+3*R^2*q+R^3>0 and R^2+2*R^3+3*R^2*q-q^3>0 and
   q^2+R>.3,1,0):
b:=implicitplot(f>0.5,R=0..2,q=0..1,filled=true,
                numpoints=100000,coloring=[green,white]):
display(a,b);
I don't see how that can be easily done. That, perhaps, goes into 'Product Suggestions' category. From other point of view, in this particular example, I would click Text at the beginning of the line, type
This is the formula that we have been looking for, 
then switch to Math, enter the formula and click enter button. Then the formula would appear in the middle of the next line and would be properly labeled. To avoid duplication, the expression at the end of the text can be deleted. It is not what you wanted, but in general, it is a better style.
I don't see how that can be easily done. That, perhaps, goes into 'Product Suggestions' category. From other point of view, in this particular example, I would click Text at the beginning of the line, type
This is the formula that we have been looking for, 
then switch to Math, enter the formula and click enter button. Then the formula would appear in the middle of the next line and would be properly labeled. To avoid duplication, the expression at the end of the text can be deleted. It is not what you wanted, but in general, it is a better style.
First 159 160 161 162 163 164 165 Last Page 161 of 180