tomleslie

13876 Reputation

20 Badges

15 years, 163 days

MaplePrimes Activity


These are answers submitted by tomleslie

well this sounds like you need the

plottools:-polygon()

command, followed by the

plottools:-rotate()

command, followed by the

plottools:-scale()

command.

Please specify which of these doesn't work for you

mu and lambda, as shown in the attached

  restart;
  assume(mu>0, lambda>0):
  interface(showassumed=0):
  int
  ( int
    ( lambda*mu*exp(-lambda*x-mu*y),
      y=x..infinity
    ),
    x=0..infinity
  );

lambda/(mu+lambda)

(1)

 

Download intass.mw

Chapter 16 of the Maple Programming Guide uses a Sieve-of-Eratosthenes procedure as a tutorial example in the use of Maple's debugger. The complete code is provided. Be careful! Because the object of this section is to use the debugger, the code provided at the start of section 16.2 contains an error. The corrected code is shown at the end of section 16 .2 (and in the attached)

Just for fun, he attached also shows another version of the Sieve, which I wrote many years ago when I was teaching myself to program in Maple. It runs about 5X faster than the implementation Chapter 16 of the Programming Guide

#
# Sieve of Eratosthenes from the Chapter 16 of the
# Maple Programming Guide where it is used as an example
# for using the Maple debugger - so Maple make no claim
# that it is partiularly "efficient"
#
  restart;
  sieve := proc(n::integer)
                local i, k, flags, count,twicei;
                count := 0;
                for i from 2 to n do
                    flags[i] := true
                end do;
                for i from 2 to n do
                    if flags[i] then
                       twicei := 2*i;
                       for k from twicei by i to n do
                           flags[k] := false;
                       end do;
                       count := count+1;
                    end if;
                end do;
                count;
           end proc:
   CodeTools:-Usage(sieve(1000000));

memory used=216.16MiB, alloc change=84.01MiB, cpu time=3.84s, real time=3.59s, gc time=670.80ms

 

78498

(1)

#
# Sieve of Eratosthenes I wrote many years ago. It was
# originally developed to return all the primes up to n
# - not just how many primes there are.
#
# But still about 5X faster than the above
#
  restart;
  sieve := proc( Nval::integer)
                 local vec, k;
                 description "The Sieve of Eratosthenes";
                 uses ArrayTools, LinearAlgebra:
               #
               # Initialise a vector with all ones
               #
                 vec:= Vector( row, Nval, 1 ):
               #
               # set the first entry in the vector to zero
               #        
                 vec[1]:= 0:
               #
               # Set all even entries with index >=4, to zero
               # (eliminates all the even indices which can't
               # be prime)
               #
                 Fill(0, vec, 3, 2);
               #
               # For each odd number, say k,  eliminate all
               # of its odd multiples (other than 1*k)
               #
                 seq( Fill
                      ( 0, vec, k^2-1, k ),
                      k=3..floor( sqrt(Nval) ), 2
                    ):
               #
               # return the indices for all non-zero values
               #
                 return Transpose
                        ( SearchArray
                          ( vec )
                        );
           end proc:
  CodeTools:-Usage(numelems(sieve(1000000)));

memory used=89.29MiB, alloc change=47.64MiB, cpu time=842.00ms, real time=852.00ms, gc time=78.00ms

 

78498

(2)

 

Download sieves.mw

To be fair, on the help page

?Plots with units

it does clearly state

Units cannot be used with plotting functions given in parametric form.

So my approach would be as in the attached. Note that removing the unit 'J'  from 'M' in the range definition, means that all occurrences of 'M' in the expressions, have to be given this unit.

  restart;
  P:= [ 7.291666667*10^10*sin(2.154234962*10^(-11)*M*Unit('J')/(Unit('Pa')*Unit('mm')^3))*Unit('Pa')*Unit('m')*Unit('mm')^3/(M*Unit(J)),
       -7.291666667*10^10*(-1 + cos(2.154234962*10^(-11)*M*Unit('J')/(Unit('Pa')*Unit('mm')^3)))*Unit('Pa')*Unit('m')*Unit('mm')^3/(M*Unit('J')),
        M = 0..72
      ];
  plot([map(convert, P[1..2], unit_free)[], P[3]]);

[0.7291666667e11*sin(0.2154234962e-10*M*Units:-Unit(J)/(Units:-Unit(Pa)*Units:-Unit(mm)^3))*Units:-Unit(Pa)*Units:-Unit(m)*Units:-Unit(mm)^3/(M*Units:-Unit(J)), -0.7291666667e11*(-1+cos(0.2154234962e-10*M*Units:-Unit(J)/(Units:-Unit(Pa)*Units:-Unit(mm)^3)))*Units:-Unit(Pa)*Units:-Unit(m)*Units:-Unit(mm)^3/(M*Units:-Unit(J)), M = 0 .. 72]

 

 

``

 

Download unitPlot.mw

the following worksheet "functions"

However it is up to you to ensure that x<=r: I can't see any way to impose this condition atomatically

 restart;
 with(plots):
 A := (x,r) -> 2*sqrt(-x^2 + r^2)*x:
 Explore
 ( display
   ( [ plot
       ( sqrt(r^2 - p^2),
         p=-r..r,
         color=blue,
         scaling=constrained
       ),
       plot
       ( [-x, -x, x, x, -x],
         [0 , sqrt(-x^2 + r^2), sqrt(-x^2 + r^2), 0, 0],
         title=typeset( "Opt x= %1, r=%2, Area = %2", x, r, A(x,r)),
         scaling=constrained
       )
     ]
   ),
   parameters=[   x= 0.0..4.0,
                  r=0.0..4.0
              ],
   initialvalues=[ x=1.0,
                   r=2.0                    
                 ]    
 );

Download exp2.mw

with the "toy" example shown below?

  restart;
  Explore( plot( [c*sin(a*x), d*cos(b*x)],
                  x=0..2*Pi
               ),
           parameters = [ a=1.0..2.0,
                          b=2.0..4.0, 
                          c=0.0..1.0,
                          d=0.0..1.0
                        ],
           initialvalues = [ a=1.5,
                             b=2.0,
                             c=0.25,
                             d=0.75
                           ]
       );

 

The Syrup Draw() command works for horizontal ladder networks.

It does not work for "generall" networks. The Syrup Draw() command will handle the case where the individual "elements" of a ladder network are series or parallel combination of basic components, but this does not mean that it will handle all networks. The netlist you provide cannot be sensibly represented as a "ladder" network whose elements are series/parallel combinations of basic components.

So stop trying!

Why is the ability to "draw" a network significant? Syrup will happily Solve() any such network - even if it can't be "drawn"

as in the attache
 

  a:=2:
  convert(a, string);
  convert('a', string);

"2"

 

"a"

(1)

 


 

Download quot.mw

d

 

 

There are a couple of syntax errors in your equation definitions, eg

w(y, z)(diff(v(y, z), z)  - should be w(y, z)*(diff(v(y, z), z) ??
w(y, z)(diff(w(y, z), z) - should be w(y, z)*(diff(w(y, z), z)

If I make these changes, and there is no obvous reason why the missing arithmetic operator should be '*' (I'm guessing!), then the worksheet attached below at least executes

restart;
with(PDEtools):
with(DEtools):
declare(u(y, z));

declare(v(y, z));

declare(w(y, z));

declare(p(y, z));

declare(R(z));

Conti := diff(u(y, z), y) + u(y, z)/(y - R(z)) + diff(w(y, z), z) + diff(R(z), z)*diff(w(y, z), y) = 0;
NSU := v(y, z)^2/(y - R(z)) - diff(p(y, z), y) = 0;
NSV := ((u(y, z)*diff(v(y, z), y) + u(y, z)*v(y, z)/(y - R(z)) + w(y, z)*(diff(v(y, z), z) + diff(R(z), z)*diff(v(y, z), y))) + (-diff(v(y, z), y)/(y - R(z)) - diff(v(y, z), y, y) + v(y, z)/(y - R(z))^2)) + diff(R(z), z)*diff(w(y, z), y) = 0;
NSW := u(y, z)*diff(w(y, z), z) + w(y, z)*(diff(w(y, z), z) + diff(R(z), z)*diff(w(y, z), y)) + diff(p(y, z), z) + diff(R(z), z)*diff(p(y, z), y) - diff(w(y, z), y)/(y - R(z)) - diff(w(y, z), y, y) - diff(R(z), z)*diff(w(y, z), y) = 0;
sys := [Conti, NSU, NSV, NSW];
deteqs := Infinitesimals(sys);

u(y, z)*`will now be displayed as`*u

 

v(y, z)*`will now be displayed as`*v

 

w(y, z)*`will now be displayed as`*w

 

p(y, z)*`will now be displayed as`*p

 

R(z)*`will now be displayed as`*R

 

diff(u(y, z), y)+u(y, z)/(y-R(z))+diff(w(y, z), z)+(diff(R(z), z))*(diff(w(y, z), y)) = 0

 

v(y, z)^2/(y-R(z))-(diff(p(y, z), y)) = 0

 

u(y, z)*(diff(v(y, z), y))+u(y, z)*v(y, z)/(y-R(z))+w(y, z)*(diff(v(y, z), z)+(diff(R(z), z))*(diff(v(y, z), y)))-(diff(v(y, z), y))/(y-R(z))-(diff(diff(v(y, z), y), y))+v(y, z)/(y-R(z))^2+(diff(R(z), z))*(diff(w(y, z), y)) = 0

 

u(y, z)*(diff(w(y, z), z))+w(y, z)*(diff(w(y, z), z)+(diff(R(z), z))*(diff(w(y, z), y)))+diff(p(y, z), z)+(diff(R(z), z))*(diff(p(y, z), y))-(diff(w(y, z), y))/(y-R(z))-(diff(diff(w(y, z), y), y))-(diff(R(z), z))*(diff(w(y, z), y)) = 0

 

[diff(u(y, z), y)+u(y, z)/(y-R(z))+diff(w(y, z), z)+(diff(R(z), z))*(diff(w(y, z), y)) = 0, v(y, z)^2/(y-R(z))-(diff(p(y, z), y)) = 0, u(y, z)*(diff(v(y, z), y))+u(y, z)*v(y, z)/(y-R(z))+w(y, z)*(diff(v(y, z), z)+(diff(R(z), z))*(diff(v(y, z), y)))-(diff(v(y, z), y))/(y-R(z))-(diff(diff(v(y, z), y), y))+v(y, z)/(y-R(z))^2+(diff(R(z), z))*(diff(w(y, z), y)) = 0, u(y, z)*(diff(w(y, z), z))+w(y, z)*(diff(w(y, z), z)+(diff(R(z), z))*(diff(w(y, z), y)))+diff(p(y, z), z)+(diff(R(z), z))*(diff(p(y, z), y))-(diff(w(y, z), y))/(y-R(z))-(diff(diff(w(y, z), y), y))-(diff(R(z), z))*(diff(w(y, z), y)) = 0]

 

[_xi[z](z, y, R, p, u, v, w) = 1, _xi[y](z, y, R, p, u, v, w) = 0, _eta[R](z, y, R, p, u, v, w) = 0, _eta[p](z, y, R, p, u, v, w) = 0, _eta[u](z, y, R, p, u, v, w) = 0, _eta[v](z, y, R, p, u, v, w) = 0, _eta[w](z, y, R, p, u, v, w) = 0], [_xi[z](z, y, R, p, u, v, w) = 0, _xi[y](z, y, R, p, u, v, w) = 0, _eta[R](z, y, R, p, u, v, w) = 0, _eta[p](z, y, R, p, u, v, w) = 1, _eta[u](z, y, R, p, u, v, w) = 0, _eta[v](z, y, R, p, u, v, w) = 0, _eta[w](z, y, R, p, u, v, w) = 0], [_xi[z](z, y, R, p, u, v, w) = 0, _xi[y](z, y, R, p, u, v, w) = 1, _eta[R](z, y, R, p, u, v, w) = 1, _eta[p](z, y, R, p, u, v, w) = 0, _eta[u](z, y, R, p, u, v, w) = 0, _eta[v](z, y, R, p, u, v, w) = 0, _eta[w](z, y, R, p, u, v, w) = 0]

(1)

 

Download jets.mw

Your "trough" only depends on the four points

 [0, l*cos(theta) ]
[ x, 0 ]
[ x+w, 0 ]
[ x+w+x, l*cos(theta) ]

so just plot these!

The area is equally simole to compute as (w+x)*l*cos(theta)

See the attached. NB the desired output from the "Explore" command does not appear on this site - but it does in the worksheet - honest!

  restart:
  Explore
  ( plot
    ( [0, x, x+w, x+w+x],
      [l*cos(theta), 0, 0, l*cos(theta)],
      title=typeset( "Area=", (w+x)*l*cos(theta)),
      scaling=constrained
    ),
    parameters=[ x=1..10,
                 w=1..10,
                 l=1..10,
                 theta=0..Pi/2
               ],
    initialvalues=[ x=5,
                    w=5,
                    l=5,
                    theta=Pi/4
                  ]
  );

NULL

Download expl2.mw

just because alternatives are good

  restart:
  with(plots):
  with(plottools):
  with(Student[Calculus1]):
  display( arc( [0,0], 2, 0..Pi), scaling=constrained, color=red);
  VolumeOfRevolution( sqrt(4-x^2), x=-2..2);

 

(32/3)*Pi

(1)

 

Download vol.mw
 

that there is (usually) more than one way to do it

  restart;
  fig:= proc( alpha )
              uses geometry, plots:
              local R:=2, xv:
              _EnvHorizontalName:= x:
              _EnvVerticalName:= y:
            #
            # Origin and centre circle
            #
              point(C, R*cos(alpha), R*sin(alpha));
              circle(c, [ point(orig, 0,0), R ]  ):
              segment(s0, [orig, C]):
            #
            # Construction lines
            #
              segment(s1, [ point(ps1, R, -R), point(ps2, -5*R, 5*R) ]):
              segment(s2, [ point(ps3, -R, -R), point(ps4, 5*R, 5*R) ]):
            #
            # Connecting rods
            #
              xv:= rhs
                   ( solve
                     ( [ x<0,
                         sqrt((x-coordinates(C)[1])^2+(-x-coordinates(C)[2])^2)=4*R
                       ],
                       x
                     )[]
                   ):
              point(A, xv, -xv):
              xv:= rhs
                   ( solve
                     ( [ x>0,
                         sqrt((x-coordinates(C)[1])^2+(x-coordinates(C)[2])^2)=4*R
                       ],
                       x
                     )[]
                   ):
              point(B, xv, xv):
              segment(s3, [A, C]):
              segment(s4, [B, C]):
            #
            # Cylinder walls
            #
              segment(s5, [point(ps5, 2*R, R), point(ps6, 5*R, 4*R)] ):
              reflection(s6, s5, line(l1, y=x)):
              reflection(s7, s5, line(l2, x=0)):
              reflection(s8, s6, l2):
            #
            # Draw everything
            #
              display
              ( [ draw( [ A(color=orange, symbol=solidcircle, symbolsize=24),
                          B(color=orange, symbol=solidcircle, symbolsize=24),
                          C(color=orange, symbol=solidcircle, symbolsize=24),
                          orig(color=orange, symbol=solidcircle, symbolsize=24),
                          c(color=red, linestyle=dash),
                          s0(color=green, thickness=4),
                          s1(color=blue, linestyle=dash),
                          s2(color=blue, linestyle=dash),
                          s3(color=green, thickness=4),
                          s4(color=green, thickness=4),
                          s5(color=black, thickness=8),
                          s6(color=black, thickness=8),
                          s7(color=black, thickness=8),
                          s8(color=black, thickness=8)
                        ]
                      ),
                 textplot
                 ( [ coordinates(A)[], "A"],
                   align=[above, left],
                   font=[times, bold, 16]
                 ),
                 textplot
                 ( [ coordinates(B)[], "B"],
                   align=[above,right],
                   font=[times, bold, 16]
                 ),
                 textplot
                 ( [ coordinates(C)[], "C"],
                   align=above,
                   font=[times, bold, 16]
                 )
                ],
                axes=none
             ):
      end proc:
#
# Produce animation
#
  plots:-display
         ( [ seq
             ( fig(j),
               j=0..evalf(2*Pi), evalf(Pi/20)
             )
           ],
           insequence=true
         );

 

 

Download mc.mw

typing

Newtons law of cooling

in the search box of the Maple help page - then reading the results?

for 'local' declaration is

local D;

not

local(D)

With this simple change I get the attached

restart;
with(plots):
with(plottools):
AB := 39;
BC := 140;
BD := 140;
local D; #not local(D)!
Vdot := proc(U, V) local i; add(U[i]*V[i], i = 1 .. 2); end proc;
dist := proc(M, N) sqrt(Vdot(expand(M - N), expand(M - N))); end proc;

Fig := proc(alpha)
local cir, R, BC, BD, AC, AD, lAC, A, lBC, lAB, lBD, beta, B, C, Cc, Dd, D, Aa, Bb, F1, F2, d, k, h, i, Pb, Ph, pb1, ph1, Qb, Qh, qh1, qb1, p1, P1, p2, P2, p3, P3, p4, P4, q1, Q1, q2, Q2, q3, Q3, q4, Q4, cy1, cy2, cy3, cy4, tA, tB, tC, tD;
A := [0, 0]; R := 39; d := 83; BC := 140; BD := 140;
B := [R*cos(alpha), R*sin(alpha)];
k := BC/R; h := 1/2*sqrt(2);
Ph := [h*(R + BC), h*(R + BC)];
Pb := [h*(-R + BC), h*(-R + BC)];
Qh := [-h*(R + BC), h*(R + BC)];
Qb := [-h*(-R + BC), h*(-R + BC)];
P1 := [Ph[1] - 1/2*d*h, Ph[2] + 1/2*d*h];
P2 := [Ph[1] + 1/2*d*h, Ph[2] - 1/2*d*h];
P3 := [Pb[1] - 1/2*d*h, Pb[2] + 1/2*d*h];
P4 := [Pb[1] + 1/2*d*h, Pb[2] - 1/2*d*h];
Q1 := [Qh[1] + 1/2*d*h, Qh[2] + 1/2*d*h];
Q2 := [Qh[1] - 1/2*d*h, Qh[2] - 1/2*d*h];
Q3 := [Qb[1] + 1/2*d*h, Qb[2] + 1/2*d*h];
Q4 := [Qb[1] - 1/2*d*h, Qb[2] - 1/2*d*h];
cir := circle(A, R, color = black, linestyle = longdash);
F1 := plot(x, x = -R .. R + BC, color = black, linestyle = longdash);
F2 := plot(-x, x = -R - BC .. R, color = black, linestyle = longdash);
AC := R*(cos(alpha) + sqrt(k^2 - sin(alpha)^2));
C := [h . AC, h . AC];
AD := R*(cos(Pi - alpha) + sqrt(k^2 - sin(Pi - alpha)^2));
D := [-h*AD, h*AD]; lBC := plot([B, C], color = red, thickness = 4);
lAB := plot([A, B], color = red, thickness = 4); print(evalf(dist(B, C)), evalf(dist(B, D)));
lBD := plot([B, D], color = red, thickness = 4);
pb1 := pointplot(Pb, symbol = solidcircle, symbolsize = 5, color = black);
ph1 := pointplot(Ph, symbol = solidcircle, symbolsize = 5, color = black);
qb1 := pointplot(Qb, symbol = solidcircle, symbolsize = 5, color = black);
qh1 := pointplot(Qh, symbol = solidcircle, symbolsize = 5, color = black);
p1 := pointplot(P1, symbol = solidcircle, symbolsize = 10, color = black);
p2 := pointplot(P2, symbol = solidcircle, symbolsize = 10, color = black);
p3 := pointplot(P3, symbol = solidcircle, symbolsize = 10, color = black);
p4 := pointplot(P4, symbol = solidcircle, symbolsize = 10, color = black);
q1 := pointplot(Q1, symbol = solidcircle, symbolsize = 10, color = black);
q2 := pointplot(Q2, symbol = solidcircle, symbolsize = 10, color = black);
q3 := pointplot(Q3, symbol = solidcircle, symbolsize = 10, color = black);
q4 := pointplot(Q4, symbol = solidcircle, symbolsize = 10, color = black);
Aa := pointplot(A, symbol = solidcircle, symbolsize = 12, color = blue);
Bb := pointplot(B, symbol = solidcircle, symbolsize = 12, color = blue);
Cc := pointplot(C, symbol = solidcircle, symbolsize = 12, color = blue);
Dd := pointplot(D, symbol = solidcircle, symbolsize = 12, color = blue);
cy1 := plot([P1, P3], color = black, thickness = 8); cy2 := plot([P2, P4], color = black, thickness = 8);
cy3 := plot([Q1, Q3], color = black, thickness = 8); cy4 := plot([Q2, Q4], color = black, thickness = 8);
tA := textplot([0, 0, "A"], 'align' = {'above', 'right'});
tB := textplot([B[1], B[2], "B"], 'align' = {'above', 'right'});
tC := textplot([C[1], C[2], "C"], 'align' = {'above', 'right'});
tD := textplot([D[1], D[2], "D"], 'align' = {'above', 'right'});
display([cir, F1, F2, pb1, ph1, qb1, qh1, p1, p2, p3, p4, q1, q2, q3, q4, Aa, Bb, Cc, Dd, lAB, lBC, lBD, cy1, cy2, cy3, cy4, tA, tB, tC, tD], scaling = constrained);
end proc;

Fig(Pi/3);

[animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, display, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, inequal, interactive, interactiveparams, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, logplot, matrixplot, multiple, odeplot, pareto, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedra_supported, polyhedraplot, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, shadebetween, spacecurve, sparsematrixplot, surfdata, textplot, textplot3d, tubeplot]

 

[annulus, arc, arrow, circle, cone, cuboid, curve, cutin, cutout, cylinder, disk, dodecahedron, ellipse, ellipticArc, exportplot, extrude, getdata, hemisphere, hexahedron, homothety, hyperbola, icosahedron, importplot, line, octahedron, parallelepiped, pieslice, point, polygon, polygonbyname, prism, project, rectangle, reflect, rotate, scale, sector, semitorus, sphere, stellate, tetrahedron, torus, transform, translate, triangulate]

 

39

 

140

 

140

 

Warning, A new binding for the name `D` has been created. The global instance of this name is still accessible using the :- prefix, :-`D`.  See ?protect for details.

 

D

 

proc (U, V) local i; add(U[i]*V[i], i = 1 .. 2) end proc

 

proc (M, N) sqrt(Vdot(expand(M-N), expand(M-N))) end proc

 

proc (alpha) local cir, R, BC, BD, AC, AD, lAC, A, lBC, lAB, lBD, beta, B, C, Cc, Dd, D, Aa, Bb, F1, F2, d, k, h, i, Pb, Ph, pb1, ph1, Qb, Qh, qh1, qb1, p1, P1, p2, P2, p3, P3, p4, P4, q1, Q1, q2, Q2, q3, Q3, q4, Q4, cy1, cy2, cy3, cy4, tA, tB, tC, tD; A := [0, 0]; R := 39; d := 83; BC := 140; BD := 140; B := [R*cos(alpha), R*sin(alpha)]; k := BC/R; h := (1/2)*sqrt(2); Ph := [h*(R+BC), h*(R+BC)]; Pb := [h*(-R+BC), h*(-R+BC)]; Qh := [-h*(R+BC), h*(R+BC)]; Qb := [-h*(-R+BC), h*(-R+BC)]; P1 := [Ph[1]-(1/2)*d*h, Ph[2]+(1/2)*d*h]; P2 := [Ph[1]+(1/2)*d*h, Ph[2]-(1/2)*d*h]; P3 := [Pb[1]-(1/2)*d*h, Pb[2]+(1/2)*d*h]; P4 := [Pb[1]+(1/2)*d*h, Pb[2]-(1/2)*d*h]; Q1 := [Qh[1]+(1/2)*d*h, Qh[2]+(1/2)*d*h]; Q2 := [Qh[1]-(1/2)*d*h, Qh[2]-(1/2)*d*h]; Q3 := [Qb[1]+(1/2)*d*h, Qb[2]+(1/2)*d*h]; Q4 := [Qb[1]-(1/2)*d*h, Qb[2]-(1/2)*d*h]; cir := plottools:-circle(A, R, color = black, linestyle = longdash); F1 := plot(x, x = -R .. R+BC, color = black, linestyle = longdash); F2 := plot(-x, x = -R-BC .. R, color = black, linestyle = longdash); AC := R*(cos(alpha)+sqrt(k^2-sin(alpha)^2)); C := [h.AC, h.AC]; AD := R*(cos(Pi-alpha)+sqrt(k^2-sin(Pi-alpha)^2)); D := [-h*AD, h*AD]; lBC := plot([B, C], color = red, thickness = 4); lAB := plot([A, B], color = red, thickness = 4); print(evalf(dist(B, C)), evalf(dist(B, D))); lBD := plot([B, D], color = red, thickness = 4); pb1 := plots:-pointplot(Pb, symbol = solidcircle, symbolsize = 5, color = black); ph1 := plots:-pointplot(Ph, symbol = solidcircle, symbolsize = 5, color = black); qb1 := plots:-pointplot(Qb, symbol = solidcircle, symbolsize = 5, color = black); qh1 := plots:-pointplot(Qh, symbol = solidcircle, symbolsize = 5, color = black); p1 := plots:-pointplot(P1, symbol = solidcircle, symbolsize = 10, color = black); p2 := plots:-pointplot(P2, symbol = solidcircle, symbolsize = 10, color = black); p3 := plots:-pointplot(P3, symbol = solidcircle, symbolsize = 10, color = black); p4 := plots:-pointplot(P4, symbol = solidcircle, symbolsize = 10, color = black); q1 := plots:-pointplot(Q1, symbol = solidcircle, symbolsize = 10, color = black); q2 := plots:-pointplot(Q2, symbol = solidcircle, symbolsize = 10, color = black); q3 := plots:-pointplot(Q3, symbol = solidcircle, symbolsize = 10, color = black); q4 := plots:-pointplot(Q4, symbol = solidcircle, symbolsize = 10, color = black); Aa := plots:-pointplot(A, symbol = solidcircle, symbolsize = 12, color = blue); Bb := plots:-pointplot(B, symbol = solidcircle, symbolsize = 12, color = blue); Cc := plots:-pointplot(C, symbol = solidcircle, symbolsize = 12, color = blue); Dd := plots:-pointplot(D, symbol = solidcircle, symbolsize = 12, color = blue); cy1 := plot([P1, P3], color = black, thickness = 8); cy2 := plot([P2, P4], color = black, thickness = 8); cy3 := plot([Q1, Q3], color = black, thickness = 8); cy4 := plot([Q2, Q4], color = black, thickness = 8); tA := plots:-textplot([0, 0, "A"], 'align' = {'above', 'right'}); tB := plots:-textplot([B[1], B[2], "B"], 'align' = {'above', 'right'}); tC := plots:-textplot([C[1], C[2], "C"], 'align' = {'above', 'right'}); tD := plots:-textplot([D[1], D[2], "D"], 'align' = {'above', 'right'}); plots:-display([cir, F1, F2, pb1, ph1, qb1, qh1, p1, p2, p3, p4, q1, q2, q3, q4, Aa, Bb, Cc, Dd, lAB, lBC, lBD, cy1, cy2, cy3, cy4, tA, tB, tC, tD], scaling = constrained) end proc

 

118.1257733, 112.7502204

 

 

display([seq(Fig((2*alpha*Pi)/50), alpha = 0 .. 50)], insequence = true, axes = none);

153.9135313, 131.5012822

 

149.7116299, 128.8643890

 

145.2327172, 126.2848701

 

140.5865889, 123.7773632

 

135.8943419, 121.3614351

 

131.2841433, 119.0630192

 

126.8858338, 116.9157897

 

122.8244287, 114.9622888

 

119.2128376, 113.2545304

 

116.1444769, 111.8536935

 

113.6868073, 110.8284609

 

111.8769986, 110.2516013

 

110.7207427, 110.1946225

 

110.1946225, 110.7207427

 

110.2516013, 111.8769986

 

110.8284609, 113.6868073

 

111.8536935, 116.1444769

 

113.2545304, 119.2128376

 

114.9622888, 122.8244287

 

116.9157897, 126.8858338

 

119.0630192, 131.2841433

 

121.3614351, 135.8943419

 

123.7773632, 140.5865889

 

126.2848701, 145.2327172

 

128.8643890, 149.7116299

 

131.5012822, 153.9135313

 

134.1844318, 157.7430708

 

136.9048958, 161.1215277

 

139.6546304, 163.9881598

 

142.4252623, 166.3008121

 

145.2068962, 168.0358515

 

147.9869494, 169.1874662

 

150.7490274, 169.7663643

 

153.4718839, 169.7979128

 

156.1285379, 169.3197804

 

158.6856483, 168.3791901

 

161.1032655, 167.0299227

 

163.3350807, 165.3292622

 

165.3292622, 163.3350807

 

167.0299227, 161.1032655

 

168.3791901, 158.6856483

 

169.3197804, 156.1285379

 

169.7979128, 153.4718839

 

169.7663643, 150.7490274

 

169.1874662, 147.9869494

 

168.0358515, 145.2068962

 

166.3008121, 142.4252623

 

163.9881598, 139.6546304

 

161.1215277, 136.9048958

 

157.7430708, 134.1844318

 

153.9135313, 131.5012822

 

 

 


 

Download anim.mw

your intent, then I can come up with the attached.

I have replaced all instances of '.' with '*' and there are a few place wehre a mathemtical operator is implied, but does not exist - as an example, you use

2 *c (a[2] . (x

which I guessed should be

2*c*(a[2]*(x

There are numerous such instances!

 restart;
 ans:=6 *a[0]+2 *k^2 *b[1]*x^2 *y+k^2 *b[1] *y *lambda+6* k^2 *b[2]* x^3 *y-c *b[1] *x* y-2* c* b[2] *x^2 *y-c *b[2] *y *lambda+(6 *b[2]^2 *x^4 *lambda)/(lambda^2 *sigma+mu^2)+(6 *b[2]^2 *x^2 *lambda^2)/(lambda^2 *sigma+mu^2)+(6 *b[1]^2 *lambda* x^2)/(lambda^2 *sigma+mu^2)-12 *a[0] *b[2] *x *y-12* (a[1] * x)* b[2] *x* y-12* (a[2] * (x^2)) *b[2] *x* y+(6 *b[1]^2 *lambda^2)/(lambda^2 *sigma+mu^2)+k^2 *(a[1] * (-2 *x* (mu* y-x^2-lambda)-mu *x* y))+2 *k^2* (a[2] * ((mu* y-x^2-lambda)^2+x* (-2 *x* (mu* y-x^2-lambda)-mu *x* y)))+c *(a[1] * (mu *y-x^2-lambda))+2 *c* (a[2] * (x *(mu *y-x^2-lambda)))+5* k^2 *b[2] *x *y *lambda-(c *b[2] *lambda^2 *mu)/(lambda^2 *sigma+mu^2)+(12 *b[1] *lambda *b[2] *x^3)/(lambda^2 *sigma+mu^2)+(12 *b[1] *lambda^2 *b[2] *x)/(lambda^2 *sigma+mu^2)-(12 *b[1]^2 *lambda *mu* y)/(lambda^2 *sigma+mu^2)+(k^2 *b[1] *lambda^2 *mu)/(lambda^2* sigma+mu^2)-12 *a[0] *b[1] *y-12* (a[1] * x) *b[1] *y-12* (a[2] * (x^2))* b[1] *y-6 *a[0]^2-12 *a[0] *(a[1] * x)-12 *a[0]* (a[2] * (x^2))-6* (a[1] * x)^2-12* (a[1] * x) *(a[2] * (x^2))-6* (a[2] * (x^2))^2-(2 *k^(2)* b[1] *lambda* mu^2 *y)/(lambda^2 *sigma+mu^2)+(k^2 *b[1] *lambda *mu *x^2)/(lambda^2 *sigma+mu^2)+(6* k^2 *b[2] *lambda *mu *x^3)/(lambda^2 *sigma+mu^2)+(6* k^2 *b[2] *lambda^2 *mu *x)/(lambda^2 *sigma+mu^2)+(2* c *b[2] *lambda *mu^2* y)/(lambda^2 *sigma+mu^2)-(c *b[2] *lambda* mu* x^2)/(lambda^2 *sigma+mu^2)-(12 *b[2]^2 *x^2 *lambda* mu* y)/(lambda^2 *sigma+mu^2)-(12* k^2 *b[2] *lambda* mu^2 *x *y)/(lambda^2 *sigma+mu^2)-(24 *b[1] *lambda *b[2] *x *mu* y)/(lambda^2 *sigma+mu^2)+6* (a[1] * x)+6* (a[2] * (x^2))+6 *b[2] *x *y+6 *b[1] *y;

-c*b[2]*lambda^2*mu/(lambda^2*sigma+mu^2)+k^2*b[1]*lambda^2*mu/(lambda^2*sigma+mu^2)+k^2*b[1]*lambda*mu*x^2/(lambda^2*sigma+mu^2)-c*b[2]*lambda*mu*x^2/(lambda^2*sigma+mu^2)-2*k^2*b[1]*lambda*mu^2*y/(lambda^2*sigma+mu^2)+6*k^2*b[2]*lambda*mu*x^3/(lambda^2*sigma+mu^2)+6*k^2*b[2]*lambda^2*mu*x/(lambda^2*sigma+mu^2)+2*c*b[2]*lambda*mu^2*y/(lambda^2*sigma+mu^2)-12*b[2]^2*x^2*lambda*mu*y/(lambda^2*sigma+mu^2)-12*k^2*b[2]*lambda*mu^2*x*y/(lambda^2*sigma+mu^2)-24*b[1]*lambda*b[2]*x*mu*y/(lambda^2*sigma+mu^2)+2*k^2*a[2]*((mu*y-x^2-lambda)^2+x*(-2*x*(mu*y-x^2-lambda)-mu*x*y))-12*a[0]*b[1]*y+6*b[1]^2*lambda^2/(lambda^2*sigma+mu^2)+6*b[2]*x*y-12*a[1]*x^3*a[2]-12*a[0]*a[1]*x+c*a[1]*(mu*y-x^2-lambda)-12*a[0]*a[2]*x^2+k^2*a[1]*(-2*x*(mu*y-x^2-lambda)-mu*x*y)+6*a[1]*x+6*a[2]*x^2-6*a[1]^2*x^2-6*a[2]^2*x^4+6*b[1]*y+5*k^2*b[2]*x*y*lambda+12*b[1]*lambda*b[2]*x^3/(lambda^2*sigma+mu^2)+12*b[1]*lambda^2*b[2]*x/(lambda^2*sigma+mu^2)-12*b[1]^2*lambda*mu*y/(lambda^2*sigma+mu^2)+6*a[0]-6*a[0]^2+k^2*b[1]*y*lambda-c*b[2]*y*lambda-c*b[1]*x*y+2*k^2*b[1]*x^2*y+6*k^2*b[2]*x^3*y-2*c*b[2]*x^2*y+6*b[2]^2*x^4*lambda/(lambda^2*sigma+mu^2)+6*b[2]^2*x^2*lambda^2/(lambda^2*sigma+mu^2)+6*b[1]^2*lambda*x^2/(lambda^2*sigma+mu^2)-12*a[0]*b[2]*x*y-12*a[1]*x^2*b[2]*y-12*a[2]*x^3*b[2]*y+2*c*a[2]*x*(mu*y-x^2-lambda)-12*a[1]*x*b[1]*y-12*a[2]*x^2*b[1]*y

(1)

P1 := coeff(coeff(ans, x, 4), y, 0);

6*k^2*a[2]-6*a[2]^2+6*b[2]^2*lambda/(lambda^2*sigma+mu^2)

(2)

 

Download coeffs.mw

First 37 38 39 40 41 42 43 Last Page 39 of 207