Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

**I am trying write a procedure (bit(n,k)) that print all the binary sequences with 2 following conditions:
  - Each of the sequences has the length of 'n'. (n elements)
 - k bits of n elements have the value 1. (all the remains have the value 0)
   Example: bit(3,2) and the result is ((101),(110),(011)).
**My code:
bit := proc (n, k)
     local one, index, i, d;
     global A;
     one := 0;
     index := 1;
     A := [seq(0, i = 1 .. n)];
     d := proc (index)
        if one = k or index = n+1 then return NULL; end if;
        for i from 0 to 1 do
              A[index] := i;
              if i = 1 then one := one+1; end if;
              if one = k then print(op(A)); end if;
             d(index+1);
             if i = 1 then one := one-1; A[index] := 0; end if;
        end do;
     end proc;
     d(1);
end proc;
>bit(5,1);
result:
0, 0, 0, 0, 1
That 's not the answer for the excercise. What is the problem?

 

I have a question that I hope someone can help with. We perform extreme value analysis on expressions. My this I mean that we evaluate expressions for each combination of min or max values of each variable in the expression. For example, the expression a*b+c*d has 4 variables and we would evaluate the expression for all of the 16 combinations of a,b,c, and d to determine the worst-case result. I understand that the worst case results may not occur at the extreme values of the variables, but that is a different question.

 What I would like to know is if there is a way to reduce the number of calculations by splitting the expression into independent parts. In the example above, the expression consists of 2 parts a*b and c*d. These parts could be evaluated separately. Each has 2 variables, and each would therefore requires  4 combinations of variables to determine the extreme values of the results. So in this case, the number of calculations is 4+4=8, which is half of the initial 16  runs as would be done with a full-factorial analysis. Also, because each calculation is done on only part of the original expression, each calculation takes less time.

Is there a way to find the independent parts of an arbitrary expression so that each independent part could be evaluated separately to speed processing?

Thanks

In the right bottom corner of the Maple window, there is data on Time, Bytes, and Available. My task is supposed to perform computation, however the Time data reached the value of 33393.1 s (about 9 hours) and is not being updated (the value does not increase) anymore for at least half an hour. Is this normal or does it mean that something is wrong with my computation process? Windows Task Manager indicates that CPU Usage is 100% and mserver uses about 40-50%. The procedure I use (diffalg(04), Rosenfeld-Groebner) is such that I have no idea how much time the task will require.

Thank you

I use Maple worksheet mode (not document mode). When I have a long line of code, or when I display some Maple source code, and if the line do not fit the current window size, the line will wrap to the next line, and make it hard to read the code.

Is there a way to configure the setting do that Maple keeps long line on same line and then I can use the horizontal scroll bar if I want to see the full line. This way the code is easier to read for me.

I looked at OPTIONS->DISPLAY and no see no such option. I also looked at few other options.

Here is a screen shot of what  I mean. Line 165 is too long and it wraps for example

Any one know if it possible to see the steps used by the limit() function as one does with many other functions such as dsolve and int ?  This is what I tried

restart;
infolevel[limit]:=5;
interface(verboseproc=3);
limit(x^2 *log(x),x=0);

But I see no steps, only the final answer. Are not all Maple functions possible to trace? How does one know which functions can generate trace and which do not?

I am using Maple 2016.1

I wanted to see something like:

let x=1/t, hence expression becomes  (-ln t)/t^2, now taking limit as t->infinity. Applying L'Hopital rule, limit t->infinity of -1/(2 t^2) which gives zero.

I assumed this is something what Maple does internally, (but there are other ways also) and wanted to see what Maple does.

 

Hi

I would like to extract the Anew matrix from the old matrix A. such that each row from Anew matrix has a square form of old matrix i.e all number from each row in the Anew form a square in my old matrix A ...

Is there any loop to determie  the Anew matrix in general  case

Such that A new

A := Matrix([[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [11, 12, 13, 14, 15, 16, 17, 18, 19, 20], [21, 22, 23, 24, 25, 26, 27, 28, 29, 30], [31, 32, 33, 34, 35, 36, 37, 38, 39, 40], [41, 42, 43, 44, 45, 46, 47, 48, 49, 50]])

Anew = Matrix([[2, 13, 22, 11], [4, 15, 24, 13], [6, 17, 26, 15], [8, 19, 28, 17], [13, 24, 33, 22], [15, 26, 35, 24], [17, 28, 37, 26], [19, 30, 39, 28], [24, 35, 44, 33], [26, 37, 46, 35], [28, 39, 48, 37]])

Many thanks

For some strange reason my matrices are shown in a very bizarre format (see imgur link). All I want is to simply see the 6x6 matrix with the numerical values - any help would be greatly appreciated. http://imgur.com/a/qaQmb

    My profile picture was formerly animation and looked like this: 


  It would be interesting to paint a triangle on a sphere. How can I do that?

> restart;
> with(plots); with(StringTools); with(plottools);
> INF := 999999999999999999999;
                     999999999999999999999
> NULL;
> MinoxAngle := 200; MikromaAngle := 350; MinicordAngle := 290; GamiAngle := 280; GamiFocal := 0.25e-1; SummitarDial := [1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2, 2.2, 3, 4, 5, 6, 7, 10, 20, INF]; Minox35MLDial := [3, 4, 6, 10, 20, INF]; Minox35Angle := 100; MinicordDial := [.35, .4, .5, .6, .7, .8, .9, 1, 1.2, 1.5, 2, 3, 4, 8, INF]; Mini := nops(MinicordDial); MikromaDial := [.5, .6, .7, .8, .9, 1, 1.2, 1.5, 2, 2.5, 3.5, 6, INF]; MinoxLXDial := [.2, .24, .3, .4, .6, 1, 2, 30]; MinoxLXAngle := 270; GamiDial := [.5, .6, .7, .8, 1, 1.2, 1.5, 2, 3, 5, 99990000000000]; MinoxBDial := [8*(1/12), 10*(1/12), 1, 1.5, 2, 3, 6, INF]; MinoxBAngle := 270;
                              200
                              350
                              290
                              280
                             0.025
[1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2, 2.2, 3, 4, 5, 6, 7, 10, 

  20, 999999999999999999999]
            [3, 4, 6, 10, 20, 999999999999999999999]
                              100
 [0.35, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.5, 2, 3, 4, 8, 

   999999999999999999999]
                               15
    [0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.5, 2, 2.5, 3.5, 6, 

      999999999999999999999]
              [0.2, 0.24, 0.3, 0.4, 0.6, 1, 2, 30]
                              270
   [0.5, 0.6, 0.7, 0.8, 1, 1.2, 1.5, 2, 3, 5, 99990000000000]
         [2  5                                        ]
         [-, -, 1, 1.5, 2, 3, 6, 999999999999999999999]
         [3  6                                        ]
                              270

> NULL;
> dd := GamiDial; N := nops(dd); dstx := [seq(convert(dd[i], string), i = 1 .. N)];
   [0.5, 0.6, 0.7, 0.8, 1, 1.2, 1.5, 2, 3, 5, 99990000000000]
                               11
  [".5", ".6", ".7", ".8", "1", "1.2", "1.5", "2", "3", "5", 

    "99990000000000"]
> NULL;
> MinicordAngle := 290;
                              290
> NULL;

> LensDial := proc (LensName, focal, Angle, scale, dr) local p1, p2, p3, p8, pk, pt, rk, R, R2, R3, Rc, c1, ds2; R := 1600; R2 := 1400; R3 := 1200; Rc := 1500; CaptionTail1 := "EXTENSION ANGLE"; CaptionTail2 := "LENS FOCUSING DIAL"; Caption1 := Join([LensName, CaptionTail1]); Caption2 := Join([LensName, CaptionTail2]); q := 180/Pi; rotation := 90; dir := dr; ds := scale; N := nops(ds); dstx := [seq(convert(ds[i], string), i = 1 .. N)]; ds2 := subs(dstx[N] = infinity, dstx); MaxAngle := Angle; f := focal; degr := -(-ds[1]+f)*Angle/(D-f)+rotation; g1 := degr/q; for j to N do deg[j] := subs(D = ds[j], degr) end do; for i to N do rdn[i] := evalf(deg[i]/q); xv[i] := R2*cos(rdn[i]); yv[i] := R2*sin(rdn[i]); wx[i] := R3*cos(rdn[i]); wy[i] := R3*sin(rdn[i]) end do; pk := {seq([ds[i], deg[i]], i = 1 .. N)}; rk := {seq([dir*xv[i], yv[i]], i = 1 .. N)}; txt := {seq([dir*wx[i], wy[i], ds2[i]], i = 1 .. N)}; p3 := pointplot(rk, caption = Caption2, captionfont = ["ROMAN", bold, 22], symbol = solidcircle, symbolsize = 15, color = red, axes = none); c1 := circle([0, 0], Rc, thickness = 8); p8 := textplot(txt, 'font' = ["times", "bold", 14]); display(p3, c1, p8, scaling = constrained) end proc;
Warning, `CaptionTail1` is implicitly declared local to procedure `LensDial`
Warning, `CaptionTail2` is implicitly declared local to procedure `LensDial`
Warning, `Caption1` is implicitly declared local to procedure `LensDial`
Warning, `Caption2` is implicitly declared local to procedure `LensDial`
Warning, `q` is implicitly declared local to procedure `LensDial`
Warning, `rotation` is implicitly declared local to procedure `LensDial`
Warning, `dir` is implicitly declared local to procedure `LensDial`
Warning, `ds` is implicitly declared local to procedure `LensDial`
Warning, `N` is implicitly declared local to procedure `LensDial`
Warning, `dstx` is implicitly declared local to procedure `LensDial`
Warning, `MaxAngle` is implicitly declared local to procedure `LensDial`
Warning, `f` is implicitly declared local to procedure `LensDial`
Warning, `degr` is implicitly declared local to procedure `LensDial`
Warning, `g1` is implicitly declared local to procedure `LensDial`
Warning, `j` is implicitly declared local to procedure `LensDial`
Warning, `deg` is implicitly declared local to procedure `LensDial`
Warning, `i` is implicitly declared local to procedure `LensDial`
Warning, `rdn` is implicitly declared local to procedure `LensDial`
Warning, `xv` is implicitly declared local to procedure `LensDial`
Warning, `yv` is implicitly declared local to procedure `LensDial`
Warning, `wx` is implicitly declared local to procedure `LensDial`
Warning, `wy` is implicitly declared local to procedure `LensDial`
Warning, `txt` is implicitly declared local to procedure `LensDial`
> ;
> NULL;
> LensDial("MEOPTA MICROMA  HELGOR 25mm", 0.25e-1, 350, MikromaDial, 1);

> LensDial("GOERZ MINICORD  25mm", 0.25e-1, 335, MinicordDial, 1);


> ;
> LensDial("MINOX LX MINOX 15mm", 0.15e-1, 270, MinoxLXDial, 1);

> LensDial("GAMI ESAMITAR 25mm", 0.25e-1, 290, GamiDial, 1);

infinity symbol looks like an  "8" lying down.

 

How to use Maple to plot  the  infinity( lay flat  "8") symbol at 12 o'clock position of a circle

 Hi, I got an error (the code below) when using subsop in procedure. But when I replace "NULL" with an integer, it would work.                             

> phephoi := proc (A, B)
local check, i, j, C, E;
C := A;
E := B;
for i from 1 to nops(C) do
   check := 0; 
   for j from 1 to nops(E) do
      if E[j] = C[i] then check := 1; break; end if;
   end do; 
   if check = 0 then C := subsop(i = NULL, eval(C)); end if;
end do;
return C;
end proc;


> A := [1, 2, 3, 5, 6, 7];
B := [2, 4, 7, 11, 8];
phephoi(A, B);

                             [1, 2, 3, 5, 6, 7]
                              [2, 4, 7, 11, 8]
Error, (in phephoi) invalid subscript selector
 

How to put number 1,2,3...12  around a circle, like a clock face using Maple code ?

Right now I can only do this manually by plotting a circle, then save the file and use Windos paint to

mannual put in the numbers

Hi all

I would like to plot a quadrilaterial (  spherical quadrilaterial)  on the sphere ( the vertices are known)

How can I do this

 

Many thanks

 

Let us consider 

with(Statistics);
U := RandomVariable(DiscreteUniform(-10, 10)):
V := RandomVariable(DiscreteUniform(-10, 10)):
Probability(U^2-V^2 <= 1/9, numeric);
  0.

, whereas a positive number greater than 1/21 is expected. 

 

First 1006 1007 1008 1009 1010 1011 1012 Last Page 1008 of 2224