mmcdara

7072 Reputation

18 Badges

8 years, 233 days

MaplePrimes Activity


These are answers submitted by mmcdara

@AHSAN 

RandColor := () -> ColorTools:-Color([seq(rand(0. .. 1.)(), i=1..3)]):

plot_list := [
  seq(
    plot(
      data_points[][i]
      , legend=typeset(''epsilon'' = `ε_values`[i])
      , color = RandColor()
     )
     , i = 1 .. nops(data_points)
    )
]:

plots:-display(
  plot_list
  , title="P_max vs. k"
  , labels=["k", "P_max"]
)

I used RandColor but you can also defime tge colors this way:

MyColors := [red, green, blue, ...]:

plot_list := [
  seq(
    plot(
      data_points[][i]
      , legend=typeset(''epsilon'' = `ε_values`[i])
      , color = MyColors[i]
     )
     , i = 1 .. nops(data_points)
    )
]:

plots:-display(
  plot_list
  , title="P_max vs. k"
  , labels=["k", "P_max"]
)

Note: I used a slightly different example as yours does not contain any first derivative of the y functions.

Worksheet fuxian1030_mmcdara.mw contains a step-by-step code to make you understand more easily the approach I used.
It is basically the assembling strategy @dharr talked about, excepted I did not use dcoeffs

A procedure which provides the same result the previous worksheet does is:

restart

eqmat := proc(eqs)
  local neq  := numelems(eqs):
  local U, f, Udeg, a, b, n, sub, M, S, SUB, d:

  uses LinearAlgebra:

  U     := convert( remove(has, indets(eqs, function), diff), list);
  f     := convert( indets(eqs, function), list);
  Udeg  := degree~(eval(eval(f, U =~ exp(K*t)), t=0), K);
  a, b  := (min, max)(Udeg);

  for n from 1 to neq do
    op||n := [op(lhs(eqs[n]))];
  end do;

  SUB := 0:
  for d from b to a+1 by -1 do
    sub  := [ seq( add( select(has, op||n, diff~(U, t$d)) ) = 0, n=1..neq) ];
    M, S := GenerateMatrix(sub,  diff~(U, t$d));
    SUB  := SUB + (M . ``(< diff~(U, t$d) >) = S);

    for n from 1 to neq do
      op||n := remove(has, op||n, diff~(U, t$d));
    end do:
  end do:

  sub  := [ seq( add( select(has, op||n, U) ) = 0, n=1..neq) ];
  M, S := GenerateMatrix(sub,  U);
  SUB  := SUB + (M . ``(< U >) = S);
  
  return SUB
end proc:

  


Illustration 1

eqn1 := m__1*(diff(y__1(t), `$`(t, 2)))+k__1*y__1(t)+k__2*(y__1(t)-y__2(t))-eta__1*(diff(y__1(t), t)) = 0;
eqn2 := m__2*(diff(y__2(t), `$`(t, 2)))+k__2*(y__2(t)-y__1(t))+eta__2*(diff(y__2(t), t)) = 0;
 

m__1*(diff(diff(y__1(t), t), t))+k__1*y__1(t)+k__2*(y__1(t)-y__2(t))-eta__1*(diff(y__1(t), t)) = 0

 

m__2*(diff(diff(y__2(t), t), t))+k__2*(y__2(t)-y__1(t))+eta__2*(diff(y__2(t), t)) = 0

(1)

eqmat([eqn1, eqn2])

Typesetting[delayDotProduct](Matrix(2, 2, {(1, 1) = `#msub(mi("m"),mi("1"))`, (1, 2) = 0, (2, 1) = 0, (2, 2) = `#msub(mi("m"),mi("2"))`}), `.`(Vector(2, {(1) = diff(`#msub(mi("y"),mi("1"))`(t), t, t), (2) = diff(`#msub(mi("y"),mi("2"))`(t), t, t)})), true)+Typesetting[delayDotProduct](Matrix(2, 2, {(1, 1) = -`#msub(mi("&eta;",fontstyle = "normal"),mi("1"))`, (1, 2) = 0, (2, 1) = 0, (2, 2) = `#msub(mi("&eta;",fontstyle = "normal"),mi("2"))`}), `.`(Vector(2, {(1) = diff(`#msub(mi("y"),mi("1"))`(t), t), (2) = diff(`#msub(mi("y"),mi("2"))`(t), t)})), true)+Typesetting[delayDotProduct](Matrix(2, 2, {(1, 1) = `#msub(mi("k"),mi("1"))`+`#msub(mi("k"),mi("2"))`, (1, 2) = -`#msub(mi("k"),mi("2"))`, (2, 1) = -`#msub(mi("k"),mi("2"))`, (2, 2) = `#msub(mi("k"),mi("2"))`}), `.`(Vector(2, {(1) = `#msub(mi("y"),mi("1"))`(t), (2) = `#msub(mi("y"),mi("2"))`(t)})), true) = (Vector(2, {(1) = 0, (2) = 0}))

(2)


In case the odes contain functions other than y__1(t) and y__2(t):

eqmat := proc(eqs, U)
  local neq  := numelems(eqs):
  local f, Udeg, a, b, n, sub, M, S, SUB, d:

  uses LinearAlgebra:

  f     := convert( indets(eqs, function), list);
  Udeg  := degree~(eval(eval(f, U =~ exp(K*t)), t=0), K);
  a, b  := (min, max)(Udeg);

  for n from 1 to neq do
    op||n := [op(lhs(eqs[n]))];
  end do;

  SUB := 0:
  for d from b to a+1 by -1 do
    sub  := [ seq( add( select(has, op||n, diff~(U, t$d)) ) = 0, n=1..neq) ];
    M, S := GenerateMatrix(sub,  diff~(U, t$d));
    SUB  := SUB + (M . ``(< diff~(U, t$d) >) = S);

    for n from 1 to neq do
      op||n := remove(has, op||n, diff~(U, t$d));
    end do:
  end do:

  sub  := [ seq( add( select(has, op||n, U) ) = 0, n=1..neq) ];
  M, S := GenerateMatrix(sub,  U);
  SUB  := SUB + (M . ``(< U >) = S);
  
  return SUB
end proc:

eqn1 := m__1*(diff(y__1(t), `$`(t, 2)))+k__1*y__1(t)+k__2*(y__1(t)-y__2(t))-eta__1(t)*(diff(y__1(t), t)) = 0;
eqn2 := m__2(t)*(diff(y__2(t), `$`(t, 2)))+k__2*(y__2(t)-y__1(t))+eta__2(t)*(diff(y__2(t), t)) = 0;
 

m__1*(diff(diff(y__1(t), t), t))+k__1*y__1(t)+k__2*(y__1(t)-y__2(t))-eta__1(t)*(diff(y__1(t), t)) = 0

 

m__2(t)*(diff(diff(y__2(t), t), t))+k__2*(y__2(t)-y__1(t))+eta__2(t)*(diff(y__2(t), t)) = 0

(3)

eqmat([eqn1, eqn2], [y__1(t), y__2(t)])

Typesetting[delayDotProduct](Matrix(2, 2, {(1, 1) = `#msub(mi("m"),mi("1"))`, (1, 2) = 0, (2, 1) = 0, (2, 2) = `#msub(mi("m"),mi("2"))`(t)}), `.`(Vector(2, {(1) = diff(`#msub(mi("y"),mi("1"))`(t), t, t), (2) = diff(`#msub(mi("y"),mi("2"))`(t), t, t)})), true)+Typesetting[delayDotProduct](Matrix(2, 2, {(1, 1) = -`#msub(mi("&eta;",fontstyle = "normal"),mi("1"))`(t), (1, 2) = 0, (2, 1) = 0, (2, 2) = `#msub(mi("&eta;",fontstyle = "normal"),mi("2"))`(t)}), `.`(Vector(2, {(1) = diff(`#msub(mi("y"),mi("1"))`(t), t), (2) = diff(`#msub(mi("y"),mi("2"))`(t), t)})), true)+Typesetting[delayDotProduct](Matrix(2, 2, {(1, 1) = `#msub(mi("k"),mi("1"))`+`#msub(mi("k"),mi("2"))`, (1, 2) = -`#msub(mi("k"),mi("2"))`, (2, 1) = -`#msub(mi("k"),mi("2"))`, (2, 2) = `#msub(mi("k"),mi("2"))`}), `.`(Vector(2, {(1) = `#msub(mi("y"),mi("1"))`(t), (2) = `#msub(mi("y"),mi("2"))`(t)})), true) = (Vector(2, {(1) = 0, (2) = 0}))

(4)
 

 

Download fuxian1030_mmcdara_2.mw

I'm always puzzled by your questions: are you looking for the reasoning that leads to the solution, or for the way to get it with Maple, using only its built-in functions?
Whatever here are rsponses for those two situations:

restart:

0

(1)


Reasoning

#  Prob(Ben + Jamie) = 50
#  Prob(Ben + Jamie) = Prob(Ben = 5 and Jamie=45)
#                      +
#                      Prob(Ben = 10 and Jamie=40)
#                      +
#                      Prob(Ben = 20 and Jamie=30)
#  
#  Prob(Ben + Jamie) = 0 * 0
#                      +
#                      1/3 * 1/2
#                      +
#                      1/3 * 1/2
#  
#  Prob(Ben + Jamie) = 1/6
#                      +
#                      1/6
#  
#  Prob(Ben + Jamie) = 1/3


or using the heavy artillery

with(Statistics):

Ben  := RandomVariable(EmpiricalDistribution([5, 10, 20])):
Jamie := RandomVariable(EmpiricalDistribution([30, 40])):

Total := Ben + Jamie

_R+_R0

(2)

# Maple failure

Probability(Total = 50) # ????

0

(3)

# Workaround

eps := 10^(-6):  # any strictly positive value strictly lower than 5
Probability(Total <= 50+eps) - Probability(Total <= 50-eps)

1/3

(4)
 

 

Download Prob.mw

@Alfred_F 

@vv  idea:

 

restart

with(plots):
with(plottools):

R := 1

1

(1)

C := 2*Pi/3*R + h + 4*alpha*(R-h);
S := Pi/3*R^2;

(2/3)*Pi+h+4*alpha*(1-h)

 

(1/3)*Pi

(2)

dom := solve(
         {
           C = 2*Pi*R
           , S = Pi*R^2/3
           , h > 0
           , H > 0
           , h+H < R
           , alpha > 0
         }
         , {alpha, h, H}
       )
       assuming R > 0

{alpha = -(1/12)*(4*Pi-3*h)/(h-1), 0 < H, 0 < h, H < 1, h < 1-H}

(3)

# example 0 (the simplest one)

__h := 0:
hdom := eval(dom, h=__h);

solve(select(has, %, H));

__H := 1/6;

__alpha := eval(alpha, select(has, hdom, alpha));


pattern := (c1, c2) -> display(
  sector([0, 0], R-__h-__H.. R-__h, 0..__alpha, color=c1, style=polygon),
  sector([0, 0], 1, 0..2*Pi/3, color=c2, style=polygon),
  sector([0, 0], R-__h-__H.. R-__h, 0..2*Pi/3+__alpha, color=c2, style=polygon)
):

{alpha = (1/3)*Pi, 0 < 0, 0 < H, 0 < 1-H, H < 1}

 

{0 < H, H < 1}

 

1/6

 

(1/3)*Pi

(4)

cou := ["red", "green", "blue"]:

display(
  seq(rotate(pattern(cou[i], cou[4-i]), 2*Pi/3*(i-1)), i=1..3)
  , scaling=constrained
);

 

 

# example 1:

__h := 1/4:
hdom := eval(dom, h=__h);

solve(select(has, %, H));

__H := 1/2;

__alpha := eval(alpha, select(has, hdom, alpha));


pattern := (c1, c2) -> display(
  sector([0, 0], R-__h-__H.. R-__h, 0..__alpha, color=c1, style=polygon),
  sector([0, 0], 1, 0..2*Pi/3, color=c2, style=polygon),
  sector([0, 0], R-__h-__H.. R-__h, 0..2*Pi/3+__alpha, color=c2, style=polygon)
):

{alpha = (4/9)*Pi-1/12, 0 < 1/4, 0 < H, 0 < 3/4-H, H < 1}

 

{0 < H, H < 3/4}

 

1/2

 

(4/9)*Pi-1/12

(5)

cou := ["red", "green", "blue"]:

display(
  seq(rotate(pattern(cou[i], cou[4-i]), 2*Pi/3*(i-1)), i=1..3)
  , scaling=constrained
);

 

# example 2:

__h := 1/6:
hdom := eval(dom, h=__h);

solve(select(has, %, H));

__H := 4/6;

__alpha := eval(alpha, select(has, hdom, alpha));


pattern := (c1, c2) -> display(
  sector([0, 0], R-__h-__H.. R-__h, 0..__alpha, color=c1, style=polygon),
  sector([0, 0], 1, 0..2*Pi/3, color=c2, style=polygon),
  sector([0, 0], R-__h-__H.. R-__h, 0..2*Pi/3+__alpha, color=c2, style=polygon)
):

{alpha = (2/5)*Pi-1/20, 0 < 1/6, 0 < H, 0 < 5/6-H, H < 1}

 

{0 < H, H < 5/6}

 

2/3

 

(2/5)*Pi-1/20

(6)

cou := ["red", "green", "blue"]:

display(
  seq(rotate(pattern(cou[i], cou[4-i]), 2*Pi/3*(i-1)), i=1..3)
  , scaling=constrained
);

 

 


 

Download trisection.mw


In the rectangle ABCB I set  A = (a, 3) and C = (5, b).
Then (anticlockwise sense)  B = (5, 3) and D = (a, b).

Implicit assumptions: a <> 5 and b <> 3  (see further on)
 

restart
local D
A := a, 3: 
C := 5, b:
B := C[1], A[2]:
D := A[1], C[2]:

# equation of the line BD joining B and D
slope     := ( D[2]-B[2] ) / ( D[1]-B[1] ):
intercept := B[2]:
shift     := B[1]:
BD        := -slope*(x-shift)+intercept:

solve(identity(BD = 2*x+c, x))      

                 {a = a, b = -2 a + 13, c = -7}


Here are the solutions we get using package geometry (which exhibits the conditions for the problem to have a solution) with_geometry.mw

With my Maple 2015 version display doesn't accept legends, so I modified approxPlot and ActualLine accordingly.
One way to fix the "log issue" is to set Digits to a high value (here 40).

slight_adjustments.mw

There is no need to convert such a simple comment into an answer, so I ask anyone who could be tempted to do this to think otherwise.
Thanks in advance.

@Stretto

A trick to force randomize() to generate a different seed for successive calls in the row:

restart
kernelopts(version)
Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895

randomize(rand()());
for i from 1 to 5 do
  randomize(rand()());
end do;
                          748886360495
                          654798511244
                          711907514675
                          83349168327
                          652437266289
                          514482612642

Informations about the delay time between successive calls of  randomize() for them to generate different seeds, and random generation of color sequences are given in the attached file

restart

kernelopts(version)

`Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895`

(1)

# Sleep time = 0.1 second.

StringTools:-FormatTime("%Y-%m-%d %H:%M:%S");

r := randomize();
for i from 1 to 5 do
  Threads:-Sleep(0.1):
  r := r, randomize():
end do:
[r][2..5] -~ [r][1..4]

"2024-10-13 20:58:37"

 

172884591703284

 

[0, 0, 0, 100000]

(2)

# Sleep time = 0.5 second.

StringTools:-FormatTime("%Y-%m-%d %H:%M:%S");

r := randomize();
for i from 1 to 5 do
  Threads:-Sleep(0.5):
  r := r, randomize():
end do:
[r][2..5] -~ [r][1..4]

"2024-10-13 20:58:38"

 

172884591803284

 

[0, 100000, 0, 100000]

(3)

# Sleep time = 1 second.

StringTools:-FormatTime("%Y-%m-%d %H:%M:%S");


r := randomize();
for i from 1 to 5 do
  Threads:-Sleep(1):
  r := r, randomize():
end do:

[r][2..5] -~ [r][1..4]

"2024-10-13 20:58:40"

 

172884592003284

 

[100000, 100000, 100000, 100000]

(4)

# Sleep time = 2 seconds

StringTools:-FormatTime("%Y-%m-%d %H:%M:%S");

r := randomize();
for i from 1 to 5 do
  Threads:-Sleep(2):
  r := r, randomize():
end do:

[r][2..5] -~ [r][1..4]

"2024-10-13 20:58:45"

 

172884592503284

 

[200000, 200000, 200000, 200000]

(5)

# A trick to force randomize() to generate a different seed almost instatenously

randomize(rand()());
for i from 1 to 5 do
  randomize(rand()());
end do;

470050003177

 

257848795012

 

381950329600

 

25592485277

 

162733964008

 

140513006590

(6)

# Random generations in a row of sequences of 4 colors

u := rand(0. .. 1.):
for i from 1 to 10 do
  randomize(rand()()):
  print( seq( ColorTools:-Color([u(), u(), u()]), j=1..4) )
end do:

_m4533002976, _m4533007200, _m4533011424, _m4533015648

 

_m4534440416, _m4534444640, _m4534448864, _m4534473568

 

_m4534579392, _m4534567232, _m4533772736, _m4533768768

 

_m4533505952, _m4533403680, _m4533399712, _m4533395744

 

_m4532108928, _m4532104960, _m4532100992, _m4532064256

 

_m4531649856, _m4531645888, _m4531641920, _m4531637952

 

_m4531592160, _m4531588192, _m4531584224, _m4531432800

 

_m4530772800, _m4530777504, _m4531994048, _m4532000032

 

_m4532087424, _m4532091776, _m4532223072, _m4532227488

 

_m4534440032, _m4534444448, _m4534448960, _m4534473856

(7)

# The a-priori-natural way to do this

u := rand(0. .. 1.):
for i from 1 to 10 do
  randomize():
  print( seq( ColorTools:-Color([u(), u(), u()]), j=1..4) )
end do:

_m4439707776, _m4439729440, _m4439736096, _m4439741824

 

_m4441450144, _m4441454368, _m4441458592, _m4441462816

 

_m4441518144, _m4441841856, _m4441846080, _m4441850304

 

_m4441909728, _m4441913952, _m4441918176, _m4441922400

 

_m4442424192, _m4442452992, _m4442457216, _m4442461440

 

_m4442725664, _m4442729888, _m4442824224, _m4442828448

 

_m4442863296, _m4442867520, _m4442871744, _m4443166784

 

_m4443231584, _m4443235808, _m4443240032, _m4443244256

 

_m4440702720, _m4440706944, _m4440776704, _m4440780928

 

_m4442171552, _m4442241312, _m4442245536, _m4442249760

(8)

# A little bit less safe (latency=0.001 second) than the randomize(rand()()) trick

for i from 1 to 10 do
  randomize(1000*parse(StringTools:-FormatTime("%y%m%d%H%M%S"))+round(time()*1000));
  print( seq( ColorTools:-Color([u(), u(), u()]), j=1..4) )
end do:

_m4521591648, _m4521587680, _m4521583712, _m4521579744

 

_m4521542624, _m4521538656, _m4521112800, _m4521108832

 

_m4521071744, _m4521067776, _m4521063808, _m4521059840

 

_m4520797440, _m4520793472, _m4520789504, _m4520785536

 

_m4520474048, _m4520470080, _m4520466112, _m4520462144

 

_m4520425024, _m4520421056, _m4520281920, _m4520277952

 

_m4520240864, _m4520236896, _m4520232928, _m4520228960

 

_m4519970656, _m4519966688, _m4519962720, _m4519958752

 

_m4519708704, _m4519704736, _m4519700768, _m4519696800

 

_m4519659680, _m4519655712, _m4519516576, _m4519512608

(9)
 

 

Download here.mw

@AHSAN 

Note that we could get a far better rendering giving up ColumnGraph and using directly PLOT or plottools
Whatever here is a Proposal.mw

I was about to deliver my reply when I saw acer has been faster.
Whatever here is a vay to construct rapidly the curve Y1=f(X1) (I hope I didn't make any mistake)
Proc_Error_mmcdara.mw

restart;

# At this point no there is no assigned names as the following command confirms
anames(user);  # nothing displayed

read "C:\\Program Files (x86)\\Maple 11\\test3.m";

# Run again anames(user) to see what are the names which where saved in the m file
anames(user);  # now a sequence of names is displayed, unless the m file is empty

# Let us assume A is one of the names
# To display its content type eval(A).
# You may also check it's type using whattype(A).


Example:  read.mw

Here is a procedure named Echo which reads a m file and displays its content Echo.mw, more or less what you expected from interface(echo=(integer > 2)) to do.

First one

0.6 instead of 0, 6

Second one

-1 instead of --1

Once corrected:

eq := u = 0.6*sqrt(t)-1+exp(-t)

u = .6*t^(1/2)-1+exp(-t)

(1)

# solve eq wrt u (obvious result)

solve(eq, u)

.6000000000*t^(1/2)-1.+exp(-1.*t)

(2)

# solve eq wrt t

solve(eq, t);

2.777777778*(u*exp(RootOf(-25*(exp(_Z))^2*u^2+9*_Z*(exp(_Z))^2-50*(exp(_Z))^2*u-25*(exp(_Z))^2+50*u*exp(_Z)+50*exp(_Z)-25))+exp(RootOf(-25*(exp(_Z))^2*u^2+9*_Z*(exp(_Z))^2-50*(exp(_Z))^2*u-25*(exp(_Z))^2+50*u*exp(_Z)+50*exp(_Z)-25))-1.)^2/(exp(RootOf(-25*(exp(_Z))^2*u^2+9*_Z*(exp(_Z))^2-50*(exp(_Z))^2*u-25*(exp(_Z))^2+50*u*exp(_Z)+50*exp(_Z)-25)))^2

(3)

# To go further you have to give u some value, for instance 1:

[solve(eval(eq, u=1), t)]; # t is useless as eval(eq, u=1) only depends on t
number_of_solutions := numelems(%);

[11.11094502, -.6795452073-.2578617583*I, -.6795452073+.2578617583*I, -.6675848351-20.36043710*I, -.6675848351+20.36043710*I, -.5133022487-13.86497050*I, -.5133022487+13.86497050*I, -.3856082244-7.202703595*I, -.3856082244+7.202703595*I]

 

9

(4)

fsolve(eval(eq, u=1))

11.11094502

(5)

fsolve(eval(eq, u=1), complex)

-.6795452073+.2578617583*I

(6)

# Note that
# fsolve(eval(eq, u=1), {t}, complex, maxsols=number_of_solutions)
# returns only the previous solution in Maple 2015


Download fsolve.mw

@Christian Wolinski 

if T is the table tou saved using save T, f: where f is some file, the simplest way to change some entry e in T is to do

restart:
read f:
anames(user); # to get the name of the table m file f contains (if you don't remember it)
T[e] := something;
save T, f:  # which overwrites the initial file f

@salim-barzani 

Here is an extremely simple Maplet application (this could probably be done using embedded components but I have more practice in Maplets). which enables selecting intereactively different functions and plotting them on the same figure, possibly after having defined some common transformation for each function).

I believe it could be quite close to what you have in mind... for what it's worth

restart

with(Maplets):
with(Maplets[Elements]):


N random degree 2 polynomials with {x, y} indeterminates and complex coefficients

a := 1:
r := () -> rand(-a..a)() +I*rand(-a..a)():
r()

-1+I

(1)

P := () -> randpoly([x, y], coeffs=proc() r() end proc, degree=2)

proc () options operator, arrow; randpoly([x, y], coeffs = proc () r() end proc, degree = 2) end proc

(2)

N := 5:
F := [seq(P(), n=1..5)]

[1-x+I*y-I*x^2+(1-I)*x*y-y^2, 1+I*x+(1-I)*y-I*x^2-x*y+I*y^2, 1-I*x+(-1+I)*y-x^2-x*y+(1+I)*y^2, 1+(-1+I)*x+(1+I)*y+(-1+I)*x^2+x*y+(1-I)*y^2, (-1+I)+(-1-I)*x+I*x^2+I*x*y-I*y^2]

(3)


A Maplet to select which function(s) to plot and the transformation to use

Select a single function to plot by clickingon it, or select several functions by using CTRL+click or CAPS+click (CTRL+A to select all)

A very simple example

disp := proc(pols)
  local res:
  
  local ToPlot := proc(f, p)
                    local np  := _npassed:
                    local r   := rand(0. .. 1.):
                    local c   := () -> ColorTools:-Color([r(), r(), r()]):
                    local col := [seq(c(), n=1.._npassed-1)]:
                    local p1, p2:

                    uses plots, plottools:

                    p1 := display(
                            [
                              seq(
                                plot3d(
                                  f(_passed[n]), x = 0..1, y=0..1,
                                  style=surface, color=col[n-1]
                                )
                                , n=2..np
                              )
                            ]
                          ):

                    p2 := display(
                            [
                              seq(rectangle([0, 20*n], [100, 10+20*n], color=col[n-1]), n=2..np),
                              seq(textplot ([50, 15+20*n, _passed[n]]), n=2..np)
                            ]
                            , axes=none
                            , scaling=constrained
                          ):
                    Maplets:-Tools:-Set(('PL1')('value')= p1):
                    Maplets:-Tools:-Set(('PL2')('value')= p2):
                  end proc:

  local maplet2d := Maplet(
          [
            [
              "Select what function to plot    " , ListBox['DDB1'](pols)
            ]
            ,
            [
              "Select the transformation to use" , DropDownBox['DDB2']([Re, Im, abs])
            ]
            ,
            [
              Plotter['PL1']( plot3d() ),
              Plotter['PL2']( plot() )
            ]
            ,
            [
              Button(
                "Plot",
                Evaluate(
                  'target'='PL1',
                  'function'=ToPlot,
                  Argument('DDB2'),
                  Argument('DDB1')
                )
              )
              ,
              Button("END", Shutdown(['DDB2','DDB1']))
            ]
          ]
        );
  Maplets[Display](maplet2d):
end proc:

disp(F):

 

 

Download Maplet_1.mw

Question 1:
I'm not sure there is a limitation of the number of plots you can display in a single plot3d command. For instance

N := 100:  # try 1000 if you want
F := [seq(i, i=1..N)]:
r := rand(0. .. 1.):
c := () -> ColorTools:-Color([r(), r(), r()]):
plot3d(F, x=0..1, y=0..1, color=[seq(c(), n=1..N)])

I would say the limitation is more related to human capabilities than to software's. Are you capable to visually separate let's say, 10 surfaces drawn together, or to undersand what they represent ?
Personally I begin having problems with 3 surfaces.

Question 2:
I suggest you to run one of these commands and see what kind of graphics Maple can do

plots[interactive]();

# or 
plots[interactive](abs(solnum));


There is an obvious difference at line 5: in aa1.mw Num:=100 whilie Bum:=200 in aa2.mw

Other differences:
Open aa1.mw, from the menubar: File > Export As > Maple Text (produces a file bamed aa1.txt).
Do the same for aa2.mw

Use some online file or text comparator if you don't have one, for instance Compare (in this case open the txt file and drag-and-drop the texts in the appropriate regions)
The differences are blue highlighted (aa1 is on the left)



So, contrary to what you write, these two programs are NOT identical

Maybe "identical programs" mean for you "the two programs, while different, should give the same result" ? 
But this is another question. 

So check he parts of the codes where differences occur and make yourself sure that those parts give the same results.
For instance are you sure these definitions of T11 have similar effects, see aa.mw

Here is a revised version of your aa2 code where I switch from aa1 code to aa2 code for T11, ..., T16 
This is why you get different results : aa2_mmcdara.mw
It is obvious that T11 (at least) has different expressions in the two codes (look after the plot):

# "T11 from aa1" = "T11 from aa2" iif k0 = -I, which is never the case:

k0 := (.5*Pi+(2*(N-1))*Pi/(Num-1))/(l1+2*l2+2*l3+2*l4)

            0.29089 + 0.00186 (N - 1) Pi


So, contrary to what you write, these two processes are NOT similar

 

1 2 3 4 5 6 7 Last Page 3 of 60