Alec Mihailovs

Dr. Aleksandrs Mihailovs

4455 Reputation

21 Badges

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

Social Networks and Content at Maplesoft.com

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 answers submitted by Alec Mihailovs

Also, StringTools package has Generate command that does exactly what you want (if you want strings),
s:=StringTools:-Generate(3,"01");

    s := ["000", "001", "010", "011", "100", "101", "110", "111"]

printf("%s",<s[]>);

000
001
010
011
100
101
110
111
Why should you choose Maple? Get all of them.
f:=piecewise(0<t and t<Pi,sin(3*t),0):
f1:=convert(f,Heaviside);

      f1 := sin(3 t) Heaviside(t) - sin(3 t) Heaviside(-Pi + t)

plot(f,t=-1..4);
Similarly for another function.
In your example it can be done as simple as
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 more complicated cases see my blog entry How to Color a Region.
Unfortunately, pdsolve doesn't work with initial or boundary conditions - the problem is not in the syntax. The usual way is to find a general solution through pdsolve and apply initial and boundary conditions to it after that.
You have to do the steps manually. For example,
z = (1+y+y^2-y^3)/(1-y)^3;
                                      2    3
                             1 + y + y  - y
                         z = ---------------
                                       3
                                (1 - y)

%*denom(rhs(%));

                                    3           2    3
                      3     (-1 + y)  (1 + y + y  - y )
              (-1 + y)  z = ---------------------------
                                            3
                                     (1 - y)

normal(%);

                            3               2    3
                    (-1 + y)  z = -1 - y - y  + y

%-rhs(%);

                          3              2    3
                  (-1 + y)  z + 1 + y + y  - y  = 0

expand(%);

                             2      3            2    3
           -z + 3 z y - 3 z y  + z y  + 1 + y + y  - y  = 0

collect(%,y);

                  3               2
         (z - 1) y  + (-3 z + 1) y  + (3 z + 1) y - z + 1 = 0

solve(%,y); 
         
                       <Output omitted>

simplify(fnormal(evalf(subs(z=0.8,[%]))),zero);

             [-8.897926850, -0.05747450800, 1.955401358]
For example (in Standard Maple),
'R+``(`V&middot;c`) mod c = R mod c';

            R+``(`V·c`) mod c = R mod c;
with(plots): p1:= contourplot( x*y, x=0..10, y=0..20, contours=20,color=green): p2:= contourplot((10-x)*(20-y)^2, x=0..10, y=0..20, contours=20, color=blue): p3:= plot(solve(implicitdiff(x*y,y,x)=implicitdiff((10-x)*(20-y)^2,y,x),y), x=0..10): display(p1,p2,p3);
In Windows, I have maplestd2e.sty in the ETC folder. In Windows, this folder should be copied to the place where latex style files are located. With MiKTeX - to C:/localtexmf/tex/latex (with refreshing of fndb after that.)
For example,
a:=sprintf("%a",evalf(exp(1)/10,100)):
select(isprime,[seq(parse(a[2..n]),n=2..100)]);

  [2, 271, 2718281, 27182818284590452353602874713526624977572470936\

        99959574966967627724076630353547594571]
A natural approach would be seq(combinat:-fibonacci(n),n=1..10); 1, 1, 2, 3, 5, 8, 13, 21, 34, 55
You don't need Sketch for that. In Windows, you can use Paint (or any other graphics editor) to draw a picture. Save it in a file, then in Maple click Insert - Image, find that file, and insert it.
For example,
y:=proc(n)
option remember;
a + int(x * y(n-1), x)
end:
y(0):=a:

gfun:-guessgf(PolynomialTools:-CoefficientList(y(10),x),x)[1];

                            a*exp(x^2/2)
Building a sequence by adding element by element is one of the worst ways of doing that. Still, for this exercise it can be done as P:=NULL: for p while nops([P])<10 do P:=P, `if`(isprime(p),p,NULL) od: P; 2, 3, 5, 7, 11, 13, 17, 19, 23, 29
For example,
op(2,x^2);

                                  2

degree(x^2,x);
                                  2
I don't exactly understand the second question. What are v0, v1, v2? The following does something similar to the request,
coeffs(add(i,i=s)+add(i,i=p),[x,y]);

                  v1 + v2 + v0, 1 + b, 2 + c, 3 + a
v0, v1, and v2 are added, because they are considered to be constants. If they are considered to be variables, then the result is
coeffs(add(i,i=s)+add(i,i=p),[x,y,v0,v1,v2]);

                     1 + b, 2 + c, 1, 1, 1, 3 + a
The requested answer can be obtained as follows,
f:=p->selectremove(a->degree(a,[x,y])=0,p):

coeffs(add(i,i=f(s)[2])+add(i,i=f(p)[2]),[x,y]),
op(f(s)[1]),op(f(p)[1]);

                   1 + b, 2 + c, 3 + a, v1, v2, v0
First 68 69 70 71 72 73 74 Page 70 of 76