tomleslie

4465 Reputation

10 Badges

9 years, 93 days

MaplePrimes Activity


These are answers submitted by tomleslie

as a very difficult way to compute fibonacci numbers, but maybe you could explain what is wrong with the attached

restart;

a[n] = Sum(binomial((n - (n mod x))/2 + q, n/2 - 2^(-(n mod x)) - q), q = 0 .. n/2 - 2^(-(n mod x)));
evalf(eval(%, [n=24, x=3]));

a[n] = Sum(binomial((1/2)*n-(1/2)*modp(n, x)+q, (1/2)*n-2^(-modp(n, x))-q), q = 0 .. (1/2)*n-2^(-modp(n, x)))

 

a[24] = 46368.

(1)

#
# Although isn't this easier
#
 combinat:-fibonacci(24);

46368

(2)

 

Download hardfib.mw

In my Maple 2018 installation, the command

Physics:-Version()

returns

"C:\Users\TomLeslie\maple\toolbox\2018\Physics Updates\lib\Physics Updates.maple", `2019, March 14, 23:22 hours, version in the MapleCloud: 326, version installed in this computer: 326.`

which means I'm up-to-date with the Physics package in Maple 2018

I have just installed Maple 2019. The command

Physics:-Version()

returns

"C:Program FilesMaple 2019libmaple.mla", `2019, March 9, 8:38 hours, version in the MapleCloud: 326, version installed in this computer: the "Physics Updates" is not installed.`

Attempting a download from the MapleCloud button in Maple 2019 (upper right corner icon) and selecting "Packages", then Physics Package Update from the pop-up window, the progress bar gets about halfway then reports Error! I can only assume that the Physics Updates does not work with Maple 2019.

I should point out that  had no problem with

configuring the DirectSearch package to work with Maple 2019

uodating my Matlab link so that I can access Maple 2019 from my Matlab installation

the only thing I can't get is Physics Updates

Wouldn't it be nice if the people at Maple could make sure that it was possible to install their software!!

In case it makes any difference I'm running 64-bit Wiindows 7 Home Premium

I think the attached supplies what you want

(Direct comparison with your pdf is a little awkward because of notational differences.)

restart;
A := q__x(x, y, z, t) = -k*(diff(T(x, y, z, t), x)):
B := q__y(x, y, z, t) = -k*(diff(T(x, y, z, t), y)):
C := q__z(x, y, z, t)+tau__q*(diff(q__z(x, y, z, t), t)) = -k*(diff(T(x, y, z, t), z))-k*tau__T*(diff(T(x, y, z, t), z, t)):

################################################
# According to pdf supplied by OP, We also have
# the equation
#
  expr1:= -(diff(q__x(x,y,z,t),x)+diff(q__y(x,y,z,t),y))+diff(q__z(x,y,z,t),z)+Q(t)=rho*c__p*diff(T(x,y,z,t),t);

################################################
# Now do some substitutions as per the
# OP-supplied pdf
#
  stage1:= algsubs
           ( diff(B, y),
             algsubs
             ( diff(A, x), expr1 )
           );
  stage2:= algsubs
          ( ZZ=diff(q__z(x, y, z, t), z),
            isolate
            ( algsubs
              ( diff(q__z(x, y, z, t), z)=ZZ,
                stage1
              ),
              ZZ
            )
          );
  stage3:= algsubs
          ( stage2, diff(C, z));

  expr2:= algsubs
          ( diff(stage2,t), stage3);

-(diff(q__x(x, y, z, t), x))-(diff(q__y(x, y, z, t), y))+diff(q__z(x, y, z, t), z)+Q(t) = rho*c__p*(diff(T(x, y, z, t), t))

 

k*(diff(diff(T(x, y, z, t), y), y))+k*(diff(diff(T(x, y, z, t), x), x))+diff(q__z(x, y, z, t), z)+Q(t) = rho*c__p*(diff(T(x, y, z, t), t))

 

diff(q__z(x, y, z, t), z) = rho*c__p*(diff(T(x, y, z, t), t))-k*(diff(diff(T(x, y, z, t), x), x))-k*(diff(diff(T(x, y, z, t), y), y))-Q(t)

 

rho*c__p*(diff(T(x, y, z, t), t))+tau__q*(diff(diff(q__z(x, y, z, t), t), z))-k*(diff(diff(T(x, y, z, t), y), y))-k*(diff(diff(T(x, y, z, t), x), x))-Q(t) = -k*(diff(diff(T(x, y, z, t), z), z))-k*tau__T*(diff(diff(diff(T(x, y, z, t), t), z), z))

 

(diff(diff(T(x, y, z, t), t), t))*c__p*rho*tau__q-(diff(diff(diff(T(x, y, z, t), t), x), x))*k*tau__q-(diff(diff(diff(T(x, y, z, t), t), y), y))*k*tau__q+rho*c__p*(diff(T(x, y, z, t), t))-(diff(Q(t), t))*tau__q-k*(diff(diff(T(x, y, z, t), y), y))-k*(diff(diff(T(x, y, z, t), x), x))-Q(t) = -k*(diff(diff(T(x, y, z, t), z), z))-k*tau__T*(diff(diff(diff(T(x, y, z, t), t), z), z))

(1)

 

NULL

Download simpProb.mw

that I understand what you want, but the attached may be a possibility

Sol[1] := [72.011122301, [t[4] = -.500000000000000, t[13] = .500000000000000, x[1, 4] = 1, x[1, 13] = 0, x[4, 1] = 0, x[4, 13] = 1, x[13, 1] = 1, x[13, 4] = 0]]:
Sol[2] := [53.128387340, [t[6] = -2.00000000000000, t[7] = 0., t[8] = -.999999999999999, x[1, 6] = 1, x[1, 7] = 0, x[1, 8] = 0, x[6, 1] = 0, x[6, 7] = 0, x[6, 8] = 1, x[7, 1] = 1, x[7, 6] = 0, x[7, 8] = 0, x[8, 1] = 0, x[8, 6] = 0, x[8, 7] = 1]]:
ans:=[convert(select( i->has(i,x),[Sol[1][2][],Sol[2][2][]] ),set)[]];

[x[1, 4] = 1, x[1, 6] = 1, x[1, 7] = 0, x[1, 8] = 0, x[1, 13] = 0, x[4, 1] = 0, x[4, 13] = 1, x[6, 1] = 0, x[6, 7] = 0, x[6, 8] = 1, x[7, 1] = 1, x[7, 6] = 0, x[7, 8] = 0, x[8, 1] = 0, x[8, 6] = 0, x[8, 7] = 1, x[13, 1] = 1, x[13, 4] = 0]

(1)

 

Download sortStuff.mw

 

because the variable x__i is 'x' with an inert subscript 'i': thus x__i is a single 'name' which is completely independent of the summation index 'i' . You might as well write this as the name 'xi'. I'm guessing that is not what you meant.

On the other hand, if you did mean that the summands should contain 'x__i' then you can prevent these sums evaluating by using the inert sun command (ie Sum() rather than sum() )

The attached worksheet does it both ways, although the answers are competely different (after simplification). Only you actually know what you intent is!!
 

  restart;
#
# Using sum and x[i]
#
  f := N+k*(sum(ln(x[i]-B), i = 1..N))-N*k*(sum((x[i]-B)^k*ln(x[i]-B), i = 1..N))/(sum((x[i]-B)^k, i = 1..N));
  d1:= diff(f,k);
  simplify(d1);

N+k*(sum(ln(x[i]-B), i = 1 .. N))-N*k*(sum((x[i]-B)^k*ln(x[i]-B), i = 1 .. N))/(sum((x[i]-B)^k, i = 1 .. N))

 

sum(ln(x[i]-B), i = 1 .. N)-N*(sum((x[i]-B)^k*ln(x[i]-B), i = 1 .. N))/(sum((x[i]-B)^k, i = 1 .. N))-N*k*(sum((x[i]-B)^k*ln(x[i]-B)^2, i = 1 .. N))/(sum((x[i]-B)^k, i = 1 .. N))+N*k*(sum((x[i]-B)^k*ln(x[i]-B), i = 1 .. N))^2/(sum((x[i]-B)^k, i = 1 .. N))^2

 

sum(ln(x[i]-B), i = 1 .. N)-N*(sum((x[i]-B)^k*ln(x[i]-B), i = 1 .. N))/(sum((x[i]-B)^k, i = 1 .. N))-N*k*(sum((x[i]-B)^k*ln(x[i]-B)^2, i = 1 .. N))/(sum((x[i]-B)^k, i = 1 .. N))+N*k*(sum((x[i]-B)^k*ln(x[i]-B), i = 1 .. N))^2/(sum((x[i]-B)^k, i = 1 .. N))^2

(1)

#
# Using Sum and x__i
#
  f := N+k*(Sum(ln(x__i-B), i = 1..N))-N*k*(Sum((x__i-B)^k*ln(x__i-B), i = 1..N))/(Sum((x__i-B)^k, i = 1..N));
  d2:=diff(f,k);
  simplify(d2);

N+k*(Sum(ln(x__i-B), i = 1 .. N))-N*k*(Sum((x__i-B)^k*ln(x__i-B), i = 1 .. N))/(Sum((x__i-B)^k, i = 1 .. N))

 

Sum(ln(x__i-B), i = 1 .. N)-N*(Sum((x__i-B)^k*ln(x__i-B), i = 1 .. N))/(Sum((x__i-B)^k, i = 1 .. N))-N*k*(Sum((x__i-B)^k*ln(x__i-B)^2, i = 1 .. N))/(Sum((x__i-B)^k, i = 1 .. N))+N*k*(Sum((x__i-B)^k*ln(x__i-B), i = 1 .. N))^2/(Sum((x__i-B)^k, i = 1 .. N))^2

 

-ln(x__i-B)*(N-(Sum(1, i = 1 .. N)))

(2)

 

 


 

Download aSum.mw

that shown in that attached? Seems like a contender for using the rotate() and translate() commands from the plottools() package, although there are many other ways to do this!

  restart;
  with(plots):
  with(plottools):
  colors:= [ red, orange, yellow, green,
             turquoise, blue, purple, black
           ]:
#
# Define a "multicolored" circle
#
  p1:= display
       ( [ seq
           ( arc
             ( [0, 0],
               1,
               (j-1)*Pi/4..j*Pi/4,
               color=colors[j],
               thickness=5
             ),
             j=1..8
           )
         ]
       ):
#
# Anuimate the rotation/translation of the
# above circle
#
  nFrames:=100:
  display
  ( [ seq
      ( translate
        ( rotate
          ( p1,
            -n*Pi/(nFrames/2)
          ),
          2*n*Pi/(nFrames/2),
          0
        ),
        n=0..nFrames
      )
    ],
    insequence=true,
    scaling=constrained,
    axes=none,
    size=[1000, 500]
  );

 

 

Download rotCirc.mw

In your other question

https://www.mapleprimes.com/questions/226632-How-To-Use-Eulers-Method-With-A-Step

I provided an exct solution and a simple implementation for an equally trivial ODE problem, and managed to plot both on the same graph. I am sure that you will be able to modify that solution for this problem!

 

But you knew that - didn't you??

The attached solves it exactly, and then numerically using an explicit Euler method (rather than the in-bulit version available from dsolve/numeric

  restart;
  with(plots):
################################################
# Solve the simple RC problem exactly, simply
# because it can be done!
#
  V:= z-> 2*cos(3*z):
  R:= 4:
  C:= 0.5:
  ode:= diff( V__c(t),t)= (V(t)-V__c(t))/(R*C):
  sol:= dsolve( {ode, V__c(0)=2}):
#
# Plot this exact solution
#
  p1:= plot( rhs(sol),
             t=0..10,
             color=red,
             title="Exact solution",
             titlefont=[times, bold, 24],
             thickness=5,
             labelfont= [times, bold, 20],
             size=[1000, 500]
           );
####################################################
# Solve the system numerically using Euler's method
# with a step size of 0.1
#
  V__c:=Array(0..100):
  V__c[0]:=2:
  t__step:=0.1:
  for i from 1 by 1 to 100 do
      V__c[i]:=V__c[i-1]+t__step*(V((i-1)*t__step)-V__c[i-1])/(R*C)
  od:
#
# Plot this numerical solution
#
  p2:=pointplot( [seq( [ t__step*i, V__c[i]], i=0..100)],
                 symbol=solidcircle,
                 symbolsize=10,
                 color=blue,
                 title="Numerical solution",
                 titlefont=[times, bold, 20],
                 size=[1000, 500]
               );
#####################################################
# Display the "exact" and the "numerical" solution
# on the same graph - pretty good agreement!
#
  display( [p1, p2],
           title="Exact and Numerical Solutions",
           titlefont=[times, bold, 20],
           size=[1000, 500]
         )

 

 

 

 

 


Download RCProb.mw

Is it something like the attached?
 

  r:=2:
#
# OP uses Gamma which is protected. Override
# protection for now
#
  local Gamma:
  myDel:=(x::integer, y::integer)-> `if`(x=y,1,0):
  M:= Matrix( r,
              r,
              (i, j)-> myDel(i,j)+2*Gamma*sin(i*Pi*v__0*tau)*sin(j*Pi*v__0*tau)
            );
  C:= Matrix( r,
              r,
              (i ,j)-> 4*Gamma*Pi*v__0*j*sin(i*Pi*v__0*tau)*cos(j*Pi*v__0*tau)
            );
  K:= Matrix( r,
              r,
              (i, j)-> myDel(i,j)*i^4*Pi^2-2*Gamma(j*Pi*v__0)^2*sin(i*Pi*v__0*tau)*sin(j*Pi*v__0*tau)
            );
#
# What is tau__f?! Is 'f' meant to be defined in a
# piecewise manner?
#
  f:= Vector( r,
              i-> piecewise
                  ( tau>=0 and tau<tau__f,
                    Gamma*Pi^3*sin(i*Pi*v__0*tau),
                    0
                  )
            );
#
# What is 'p'? Use 2 for now
#
# 'D' is protected as the differetnial operator
# (which I'm guessing we might need later) so use
# 'DD' instead
#
  p:=2:
  DD:=Matrix( r,
              p,
              (i,j)-> sin(i*Pi*eta[p])
            );

  Mphi:=Vector(r, i->phi[i](tau));
  Mphi1:= diff( Mphi, tau);
  Mphi2:= diff( Mphi1, tau);

Matrix(2, 2, {(1, 1) = 1+2*GAMMA*sin(Pi*`#msub(mi("v"),mi("0"))`*tau)^2, (1, 2) = 2*GAMMA*sin(Pi*`#msub(mi("v"),mi("0"))`*tau)*sin(2*Pi*`#msub(mi("v"),mi("0"))`*tau), (2, 1) = 2*GAMMA*sin(Pi*`#msub(mi("v"),mi("0"))`*tau)*sin(2*Pi*`#msub(mi("v"),mi("0"))`*tau), (2, 2) = 1+2*GAMMA*sin(2*Pi*`#msub(mi("v"),mi("0"))`*tau)^2})

 

Matrix(2, 2, {(1, 1) = 4*Pi*GAMMA*`#msub(mi("v"),mi("0"))`*sin(Pi*`#msub(mi("v"),mi("0"))`*tau)*cos(Pi*`#msub(mi("v"),mi("0"))`*tau), (1, 2) = 8*Pi*GAMMA*`#msub(mi("v"),mi("0"))`*sin(Pi*`#msub(mi("v"),mi("0"))`*tau)*cos(2*Pi*`#msub(mi("v"),mi("0"))`*tau), (2, 1) = 4*Pi*GAMMA*`#msub(mi("v"),mi("0"))`*sin(2*Pi*`#msub(mi("v"),mi("0"))`*tau)*cos(Pi*`#msub(mi("v"),mi("0"))`*tau), (2, 2) = 8*Pi*GAMMA*`#msub(mi("v"),mi("0"))`*sin(2*Pi*`#msub(mi("v"),mi("0"))`*tau)*cos(2*Pi*`#msub(mi("v"),mi("0"))`*tau)})

 

Matrix(2, 2, {(1, 1) = Pi^2-2*GAMMA(Pi*`#msub(mi("v"),mi("0"))`)^2*sin(Pi*`#msub(mi("v"),mi("0"))`*tau)^2, (1, 2) = -2*GAMMA(2*Pi*`#msub(mi("v"),mi("0"))`)^2*sin(Pi*`#msub(mi("v"),mi("0"))`*tau)*sin(2*Pi*`#msub(mi("v"),mi("0"))`*tau), (2, 1) = -2*GAMMA(Pi*`#msub(mi("v"),mi("0"))`)^2*sin(2*Pi*`#msub(mi("v"),mi("0"))`*tau)*sin(Pi*`#msub(mi("v"),mi("0"))`*tau), (2, 2) = 16*Pi^2-2*GAMMA(2*Pi*`#msub(mi("v"),mi("0"))`)^2*sin(2*Pi*`#msub(mi("v"),mi("0"))`*tau)^2})

 

Vector(2, {(1) = piecewise(0 <= tau and tau < `#msub(mi("&tau;",fontstyle = "normal"),mi("f"))`, Pi^3*GAMMA*sin(Pi*`#msub(mi("v"),mi("0"))`*tau), 0), (2) = piecewise(0 <= tau and tau < `#msub(mi("&tau;",fontstyle = "normal"),mi("f"))`, Pi^3*GAMMA*sin(2*Pi*`#msub(mi("v"),mi("0"))`*tau), 0)})

 

Matrix(2, 2, {(1, 1) = sin(Pi*eta[2]), (1, 2) = sin(Pi*eta[2]), (2, 1) = sin(2*Pi*eta[2]), (2, 2) = sin(2*Pi*eta[2])})

 

Vector(2, {(1) = phi[1](tau), (2) = phi[2](tau)})

 

Vector(2, {(1) = diff(phi[1](tau), tau), (2) = diff(phi[2](tau), tau)})

 

Vector[column](%id = 18446744074589194710)

(1)

 


 

Download setup.mw

 

ought to cover your requirement.

Treating your original matrix as an "Adjacency Matrix" for the starting graph implies that the latter is directed. The adjacency matrix of an undirected graph has to be symmetric ( ie M[i, j] = M[j, i] ), and the matrix you supply is not.

Edge "direction" is inferred from the row entries. For example row2 of your matrix has

[0, 0, 1, 1, 0, 1, 0, 0, 0, 1]

which implies the directed edges [2, 3], [2, 4], [2, 6],  [2, 10].

restart;
with(GraphTheory):

#
# Construct a graph from the adjacency matrix. Note that this
# has to be square.
#
# Draw the result
#
  G1:= Graph
       ( Matrix
         ( [ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [0, 0, 1, 1, 0, 1, 0, 0, 0, 1],
             [1, 1, 0, 0, 1, 0, 1, 1, 1, 0],
             [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
           ]
         )
       ):
  DrawGraph(G1, style=spring);
 

 

 

#
# Construct the subgraph consisting of all edges connected
# to the vertex given by supplied argument
#
# Draw the original graph with the subgraph highlighted
#
  hSub:= spV -> HighlightSubgraph
                ( G1,
                  Subgraph
                  ( G1,
                    select
                    ( i-> i[1]=spV,
                      Edges(G1)
                    )
                  ),
                  inplace=false
                 ):
  DrawGraph(hSub(2), style=spring);
  DrawGraph(hSub(3), style=spring);

 

 

#
# Extract the graphs connected to the supplied
# vertex number and draw these
#
  hSel:= spV-> Graph
               ( select
                 ( i-> i[1]=spV,
                   Edges(G1)
                 )
               ):
  DrawGraph( hSel(2), style=spring);
  DrawGraph( hSel(3), style=spring);

 

 

 

Download dgraph.mw

as in the attached

restart;
A:=Array(1..3, 1..3,1..3):
A[2,1,3]:=Vector([2,1,3,5,6]):
A[1,2,1]:=true:
A[2,2,3]:=123.456:
A[3,2,2]:=17:
A[1,2,2]:="astring":
A[3,2,1]:=Vector([true, false, true, true, true, false]):
A[1,2,3]:=Matrix(7,7, symbol=x):
A[3,3,3]:=plot(x^2, x=0..5):
op([1..-1], A);

"1..3,1..3,1..3,{(1,2,1)=true,(1,2,2)="astring",(1,2,3)=[[[x[1,1],x[1,2],x[1,3],x[1,4],x[1,5],x[1,6],x[1,7]],[x[2,1],x[2,2],x[2,3],x[2,4],x[2,5],x[2,6],x[2,7]],[x[3,1],x[3,2],x[3,3],x[3,4],x[3,5],x[3,6],x[3,7]],[x[4,1],x[4,2],x[4,3],x[4,4],x[4,5],x[4,6],x[4,7]],[x[5,1],x[5,2],x[5,3],x[5,4],x[5,5],x[5,6],x[5,7]],[x[6,1],x[6,2],x[6,3],x[6,4],x[6,5],x[6,6],x[6,7]],[x[7,1],x[7,2],x[7,3],x[7,4],x[7,5],x[7,6],x[7,7]]]],(2,1,3)=[[[2],[1],[3],[5],[6]]],(2,2,3)=123.456,(3,2,1)=[[[true],[false],[true],[true],[true],[false]]],(3,2,2)=17,(3,3,3)=?},datatype=anything,storage=rectangular,order=Fortran_order"

(1)

 


 

Download useArr.mw

In the attached, I have addressed your problem of "playing the banker", but (hopefully!) doing everything "within the spirit" of the Statistics() package.


The version attached was executed for two dice with 10 faces, but you can get the boring version for standard dice, just by setting nFaces:=6

  restart;
  with(Statistics):
  with(plots):
  nTrials:=100000:
  nFaces:=10:
#
# "Starting random variables"
#
  X:= RandomVariable(DiscreteUniform(1, nFaces)):
  Y:= RandomVariable(DiscreteUniform(1, nFaces)):
#
# Create "new" random variable based on the above
#
  B:= RandomVariable
      ( EmpiricalDistribution
        ( [ seq
            ( seq
              ( `if`( `or`(i=1, j=1),
                      -4,
                       abs(i-j)
                    ),
                i = Support(X, output=range)
              ),
              j = Support(Y, output=range)
            )
          ]
        )
      ):
#
# Output some "statistical" properties of the
# new Random Variable B
#
  B__probs:= seq( [j, ProbabilityFunction(B,j)], j=-4..nFaces-2);
  B__mean:= Mean(B);
  B__Variance:= Variance(B);
  B__PDF:= PDF(B,t);
  B__CDF:= seq( [j, CDF(B,j)], j=-4..nFaces-2);
#
# Plot the PDF, CDF and a histogram for the "new"
# random variable B all on the same graph
#
  p1:= pointplot
       ( [seq( [j, ProbabilityFunction(B,j)], j=-4..nFaces-2)],
         symbol=solidcircle,
         symbolsize=14,
         color=red,
         size=[1000, 500]
       ):
  p2:= pointplot
       ( [seq( [j, CDF(B,j)], j=-4..nFaces-2)],
         symbol=solidcircle,
         symbolsize=14,
         color=blue,
         size=[1000, 500]
       ):
  p3:= Histogram( Sample(B, nTrials), binbounds=[seq( j+1/2, j=-5..nFaces-1)]):
  display([p1,p2,p3]);

[-4, 19/100], [-3, 0], [-2, 0], [-1, 0], [0, 9/100], [1, 4/25], [2, 7/50], [3, 3/25], [4, 1/10], [5, 2/25], [6, 3/50], [7, 1/25], [8, 1/50]

 

41/25

 

6969/625

 

(19/100)*Dirac(t+4)+(9/100)*Dirac(t)+(4/25)*Dirac(t-1)+(7/50)*Dirac(t-2)+(3/25)*Dirac(t-3)+(1/10)*Dirac(t-4)+(2/25)*Dirac(t-5)+(3/50)*Dirac(t-6)+(1/25)*Dirac(t-7)+(1/50)*Dirac(t-8)

 

[-4, 19/100], [-3, 19/100], [-2, 19/100], [-1, 19/100], [0, 7/25], [1, 11/25], [2, 29/50], [3, 7/10], [4, 4/5], [5, 22/25], [6, 47/50], [7, 49/50], [8, 1]

 

 

 

Download diceProb5.mw

if you posted (using the big green up-arrow in the MaplePrimes toolbar) a worksheet containing the "Array" containing the data and the "plot" commands you are using to produce the individual frames.

If I make a guess about exactly what you might be doing, then f(or more or less random data), something like the attached might be what you want

restart;
with(plots):
a:= rand(1..10):
Arr:= Array([seq( [seq( [i,a()], j=1..10)], i=1..10)]):
display([seq( pointplot(Arr[1..10,j,1..2], style=line), j=1..10)], insequence=true);:

 

 


 

Download animArr.mw

As others have said here, don't use sets if you wish to preserve the order of elements

As "something completely different", how about

restart;
with(ListTools):
A:= [20,15,10,30,46,78]:
A[1..SelectFirst( j->j>50,PartialSums(A),output=indices)-1];
                         
[20, 15, 10]

 

but the attached works.

I added the "ClearPlot" button just for testing purposes
 

restart; with(plots)

inequal(`or`(`and`(`and`(3 <= y, x < 2*y+8), 2*y-6 < x), `and`(`and`(`and`(-5/3 < y, y < 3), x < 2*y+8), -y+3 < x)), x = -2 .. 15, y = -4 .. 11, optionsfeasible = [[color = "black"], [color = "red"]])

 

 

      

NULL

 

 

NULL

NULL


 

Download compPlots.mw

5 6 7 8 9 10 11 Last Page 7 of 103