Robert Israel

6522 Reputation

21 Badges

18 years, 183 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

@hirnyk : May I add that it's much better to include a worksheet (.mw or .mws) file rather than an image, so that we can run your actual code.  Or alternatively, copy 1D Maple input from the worksheet and paste (as plain text, please, not an image).

This works for me in Classic, but not in Standard (both Maple 13 and Maple 14): nothing moves.

This works for me in Classic, but not in Standard (both Maple 13 and Maple 14): nothing moves.

I don't think the existing dsolve will handle 4-point boundary value problems directly, but there may be some way to handle it by a type of "shooting method".  Can you post your equations (or a simplified version of them)?

@Preben Alsholm : You're right: all variables in the code seem to be automatically global.

@Preben Alsholm : You're right: all variables in the code seem to be automatically global.

Yes, a Slider component can have floats, but I believe Jarek was commenting about a Slider in a Maplet.  That does seem to be limited to integers, and it is an annoying limitation.  Of course you can map the integers to floats when you use them, but labels on the Slider will have to be integers.

Yes, a Slider component can have floats, but I believe Jarek was commenting about a Slider in a Maplet.  That does seem to be limited to integers, and it is an annoying limitation.  Of course you can map the integers to floats when you use them, but labels on the Slider will have to be integers.

Well, that's a completely different question. 

BTW, for no particularly good reason I changed x[1], x[2], x[3] to x1, x2, x3.

> eqs:= map(numer, convert(eq, set));
S:= Groebner[Solve](eqs);

               2     4       2                            2
 S := {[[16 + 8 x1  + x1  + 8 x2  + 16 x1 - 8 x2 x1 + 4 x2 x1 , %2],

        plex(x3, x2, x1), {x1, x1 + 2, %1, 1483524 + 2014912 x1

                      2             3              4             5
         - 25213396 x1  - 9137304 x1  + 15567907 x1  + 1193438 x1

                    6           7          8         9
         - 396303 x1  - 80686 x1  - 2206 x1  + 954 x1 }],

                2
        [[x1, x2  + 2, 1 + x3], plex(x3, x2, x1), {53 x2 - 72}],

        [[x1 - 4, -3 + x2, -2 + x3], plex(x3, x2, x1), {}],

        [[x1 + 2, x2 + 2, x3 + 2], plex(x3, x2, x1), {}], [[%1,

                            2       3                    2       2
        -10 + 166 x1 + 25 x1  - 4 x1  - 8 x2 x1 + 4 x2 x1  + 8 x2 ,

        %2], plex(x3, x2, x1), {x1}], [[1483524 + 2014912 x1

                      2             3              4             5
         - 25213396 x1  - 9137304 x1  + 15567907 x1  + 1193438 x1

                    6           7          8         9
         - 396303 x1  - 80686 x1  - 2206 x1  + 954 x1 ,

                 2     4       2                            2
        16 + 8 x1  + x1  + 8 x2  + 16 x1 - 8 x2 x1 + 4 x2 x1 , %2],

        plex(x3, x2, x1), {x1, %1}]}

              2     4                     3
  %1 := -17 x1  + x1  - 150 x1 + 26 + 4 x1

                       2     3
  %2 := 8 + 4 x1 + 2 x1  + x1  + 4 x2 x1 + 8 x3

This requires some interpretation.  There are six solutions here.  For example, the first solution has
16+8*x1^2+x1^4+8*x2^2+16*x1-8*x2*x1+4*x2*x1^2 = 0 and 8+4*x1+2*x1^2+x1^3+4*x2*x1+8*x3 = 0,
thus x1 is arbitrary with x2 a solution of a quadratic equation in x1, and x3 = -1-1/2*x1-1/4*x1^2-1/8*x1^3-1/2*x2*x1.  However, that's not a solution to your system since it makes the denominators 0. The one that gives you actual solutions is the third: [[x1-4, -3+x2, -2+x3], plex(x3,x2,x1), {}]: thus x1 = 4, x2 = 3, x3 = 2. 

> subs(x1 = 4, x2 = 3, x3 = 2, eq);

                            [0    0    0]
                            [           ]
                            [0    0    0]
                            [           ]
                            [0    0    0]

 

 

 

Well, that's a completely different question. 

BTW, for no particularly good reason I changed x[1], x[2], x[3] to x1, x2, x3.

> eqs:= map(numer, convert(eq, set));
S:= Groebner[Solve](eqs);

               2     4       2                            2
 S := {[[16 + 8 x1  + x1  + 8 x2  + 16 x1 - 8 x2 x1 + 4 x2 x1 , %2],

        plex(x3, x2, x1), {x1, x1 + 2, %1, 1483524 + 2014912 x1

                      2             3              4             5
         - 25213396 x1  - 9137304 x1  + 15567907 x1  + 1193438 x1

                    6           7          8         9
         - 396303 x1  - 80686 x1  - 2206 x1  + 954 x1 }],

                2
        [[x1, x2  + 2, 1 + x3], plex(x3, x2, x1), {53 x2 - 72}],

        [[x1 - 4, -3 + x2, -2 + x3], plex(x3, x2, x1), {}],

        [[x1 + 2, x2 + 2, x3 + 2], plex(x3, x2, x1), {}], [[%1,

                            2       3                    2       2
        -10 + 166 x1 + 25 x1  - 4 x1  - 8 x2 x1 + 4 x2 x1  + 8 x2 ,

        %2], plex(x3, x2, x1), {x1}], [[1483524 + 2014912 x1

                      2             3              4             5
         - 25213396 x1  - 9137304 x1  + 15567907 x1  + 1193438 x1

                    6           7          8         9
         - 396303 x1  - 80686 x1  - 2206 x1  + 954 x1 ,

                 2     4       2                            2
        16 + 8 x1  + x1  + 8 x2  + 16 x1 - 8 x2 x1 + 4 x2 x1 , %2],

        plex(x3, x2, x1), {x1, %1}]}

              2     4                     3
  %1 := -17 x1  + x1  - 150 x1 + 26 + 4 x1

                       2     3
  %2 := 8 + 4 x1 + 2 x1  + x1  + 4 x2 x1 + 8 x3

This requires some interpretation.  There are six solutions here.  For example, the first solution has
16+8*x1^2+x1^4+8*x2^2+16*x1-8*x2*x1+4*x2*x1^2 = 0 and 8+4*x1+2*x1^2+x1^3+4*x2*x1+8*x3 = 0,
thus x1 is arbitrary with x2 a solution of a quadratic equation in x1, and x3 = -1-1/2*x1-1/4*x1^2-1/8*x1^3-1/2*x2*x1.  However, that's not a solution to your system since it makes the denominators 0. The one that gives you actual solutions is the third: [[x1-4, -3+x2, -2+x3], plex(x3,x2,x1), {}]: thus x1 = 4, x2 = 3, x3 = 2. 

> subs(x1 = 4, x2 = 3, x3 = 2, eq);

                            [0    0    0]
                            [           ]
                            [0    0    0]
                            [           ]
                            [0    0    0]

 

 

 

@John May : You seem to have left something out in your first definition of PP.  I think you want




PP:= [piecewise(t<0,-t^2/8,t<.8*Pi,P[1],0),
          piecewise(t<0,t,t<.8*Pi,P[2],0),
          piecewise(t<0,t, 0)];

The Pacman should be moving, not the dots.  Also you should use scaling=constrained so the Pacman is circular rather than elliptical.  Something like this, perhaps.

 

> frame := proc(n)
plots[display](
  [ plots[pointplot]([seq([j+1/2,0], j = 4 + ceil((n+1)/4) .. 10)],
       colour = black, symbol = solidcircle, symbolsize = 30),
    plottools[pieslice]([n/4, 0], 5, Pi/8*abs(mods(n,4)) .. 2*Pi -
Pi/8*abs(mods(n,4)), colour = yellow)])
end proc;
plots[display]([seq(frame(i),i=1..24)],insequence=true,scaling=constrained, axes=none);

Other than February 29, the day of the year with the fewest births (in typical Western countries) is December 25.  Other holidays and Sundays also have few births.  The reason is obvious, when you think of it: the obstetricians want the day off, so they don't schedule Caesarians for those days.  See e.g. <http://www.cdc.gov/nchs/data/statab/t001x16.pdf>

@hermitian : No, in a for loop the index variable is given numerical values before the body of the loop is executed.  Thus

for i from 1 to 3 do
  f(i)
end do;

will only call f with arguments, 1, 2 and 3, and not with a symbolic argument i.

Similarly, certain functions, notably seq and add, have special evaluation rules that prevent premature evaluation:
in

seq(f(i), i = 1 .. 3);

the f(i) is only evaluated after i is assigned a value 1, 2 or 3.  But by far the majority of Maple functions, including plot, do not have special evaluation rules, so their arguments are all evaluated before the code of the function begins.

@hermitian : No, in a for loop the index variable is given numerical values before the body of the loop is executed.  Thus

for i from 1 to 3 do
  f(i)
end do;

will only call f with arguments, 1, 2 and 3, and not with a symbolic argument i.

Similarly, certain functions, notably seq and add, have special evaluation rules that prevent premature evaluation:
in

seq(f(i), i = 1 .. 3);

the f(i) is only evaluated after i is assigned a value 1, 2 or 3.  But by far the majority of Maple functions, including plot, do not have special evaluation rules, so their arguments are all evaluated before the code of the function begins.

First 23 24 25 26 27 28 29 Last Page 25 of 187