tomleslie

13876 Reputation

20 Badges

15 years, 170 days

MaplePrimes Activity


These are answers submitted by tomleslie

the attached


 

data:=Import("C:/Users/TomLeslie/Desktop/bTest.csv", format="CSV", output=Matrix, source=file);

Vector[row](6, {(1) = 1, (2) = 2, (3) = 3, (4) = "x+y, algorithm=["123"]", (5) = "OK", (6) = 5})

(1)

 

Download icsv.mw

Although you do have to change the input file to

1,2,3,"x+y, algorithm=[""123""]","OK",5

 

 

 

If I type your code into Maple 2020 under Windows 7, then the bracket matching seems to work, see the 'still' below. Because I obtained the attached with the simple 'Snipping Tool', the cursor at the end of the line is not visible, becuase the cursor was need to define the 'snip

Notice that the opening parenthesis in the "offending" line is surrounded by a 'square highlight'

 

You state that you are using Document Mode, which your  Options->Interface menu entry would *seem* to confirm. However if you look at the help page "Documents vs. Worksheets: Which Should You Choose?", you will note that in Document Mode the following apply by default

  • Quick problem-solving and free-form, rich content composition
  • No prompt (>) displayed
  • Math is entered and displayed in 2-D math
  • Solve math problems with right-click menu on input and output

Rather obviously, the worksheet in your original post has command prompts, and 1-D Maple input, which looks like you are actually using Worksheet Mode

NB, it is possible to use Document Mode with 1D input, but I don't think(?) it is possible to specify Document Mode and then turn on command prompts!

So are you using some weird sort of 'hybrid' setting - like 'Document Mode' with 1D input and command prompts??

If so, how??, why??

 

 

 

 

as shown in the attached - although this won't work for integers, unless these are coerced to type 'float'


 

  restart;
#
# Set (display-only) precision to 1 digits
#
  interface(displayprecision=1):
  with(Units[Standard]):

#
# Floats will be rounded to 1  decimal place
#
  2400000.0*Unit('m')/Unit('s');
#
# but integers will not be rounded
#
  2400000*Unit('m')/Unit('s');
#
# unless they are coerced to type 'float'
  evalf(%);

2400000.0*Units:-Unit(m/s)

 

2400000*Units:-Unit(m/s)

 

2400000.*Units:-Unit(m/s)

(1)

 


 

Download dispPrec.mw

@adel-00 

The width, spacing and offset of the columns in a columngraph() are set by the values supplied to the options with these names

Maybe you want the values for these quantities to be based on the list 'yr'?????

I suggest you read the help carefully, but maybe one of the graphs in the attached meets your requirements.

NB the appearance of gridlines is a 'quirk' of this site: they won't appear in a Maple worksheet (unless you turn them on!)

  restart;
  yr:=[0.1, 0.2, 0.3]:
  sle:=[8, 12, 200]:
#
# Maple default column graph. Each "column" will
# have width 0.75, space between columns is 0.25
#
  Statistics:-ColumnGraph( sle
                         );
#
# Alternatively one can use 'yr' values as dataset
# labels, in which case there willl be no x-axis
# tickmarks.
#
# Width, spacing and offset of columns are all
# (still) on defaults
#
  Statistics:-ColumnGraph( sle,
                           datasetlabels=yr
                         );

 

 

#
# One can of course use the values in 'yr' to
# determine appropriate values for the options
# 'offset', 'width', and 'distance'
#
  Statistics:-ColumnGraph( sle,
                           offset=0.0875,
                           width=0.025,
                           distance=0.075
                         );
  Statistics:-ColumnGraph( sle,
                           offset=0.075,
                           width=0.05,
                           distance=0.05
                         );
  Statistics:-ColumnGraph( sle,
                           offset=0.0625,
                           width=0.075,
                           distance=0.025
                         );
  Statistics:-ColumnGraph( sle,
                           offset=0.05,
                           width=0.1,
                           distance=0.0
                         );

 

 

 

 

 

Download colGR2.mw

the attached

yr:=[0.1,0.2,0.3];
sle:=[8,12,200];
Statistics:-ColumnGraph([yr,sle]);

[.1, .2, .3]

 

[8, 12, 200]

 

 

 

Download colGr.mw

MAp[le has a variety of ways of producing discrete foutier transforms, but in general the output is a 1-dimensional array, (whose entries are likely to be complex).

Plotting this array will depend on whether you want real/imaginary/magnitude/dBs etc etc, but something like

plots:-pointplot( Re~(A) )
plots:-pointplot( Im~(A) )

... and so on *ought* to work

If you are still having difficulty, I can only suggest you upload both the CSV file and your Maple worksheet to this site using the big green up-arrow in the Mapleprimes toolbar.

The attached Maple file will produce the attached Excel file.

I have skipped the last datapoint - becuase this causes variuos things to consume excess compute time for litlle benefit (and I don't know why it happens!)

Note that you will have to chencge the definition of 'fname' in the final execution group to something appropriate for your machine, in order for it to execute properly.

  restart:

  with(plots):
  with(plottools):
  with(ExcelTools):

  v:= 0.7:
  Disp:= 20:
  esp:= 1000000:
  k:= 0:

  E:= unapply
      ( Int
        ( exp( (-esp*w^4 + Disp*w^2 + k)*t)*cos(w*(x + v*t))/Pi,
          w = 0 .. infinity,
          epsilon = 0.1*10^(-6)
        ),
        x,t
      ):
  f:= x -> 15.5*exp(-1/3710000*(x - 12590)^2) + 14.55*exp(-1/3000000*(x - 16100)^2):
  u:= unapply
      ( Int
        ( E(x - xi, t)*f(xi),
          xi = 0 .. 20000.,
          epsilon = 0.00001
        ),
        x, t
      ):

  M:= Matrix
      ( [ seq
          ( [ i, evalf
                 ( Int
                   ( E(0 - xi, 39000 - i)*f(xi),
                     xi = 0..20000,
                     method = _NCrule,
                     epsilon = 10^(-6)
                   )
                 )
            ],
            i = 0 .. 39000, 300
          )
        ]
      ):

#
# Plot the data in the above matrix. Skip the final point
# because it increases the execution time beyond reason
#
  pointplot( M[1..-2,1..2],
             style=line
           );

 

#
# OP will have to change the following filename to
# something appropriate for his/her machine. The fname
# definition here is just for test purposes on my
# machine
#
  fname:="C:/Users/TomLeslie/Desktop/dataTest.xls":
#
# Output the data to an excel file (excluding the
# final point)
#
  Export( M[1..-2, 1..2], fname ):

 

 

Download genXLS.mw

dataTest.xls

Consider using the big green up-arrow in the Mapleprimes toolbar to upload a worksheet, which will (hopefully) clarify you dilemma

If I make a wild guess about what you are trying to achieve - which is to evaluate some integration constants occurring in the general solution of an ODE, so that they correspond to a particular combination of boundary/initial conditions, then you probably need something like the "toy" example shown in the attached

  restart:

#
# Set up a "toy" example of an ode with bcs
# and solve it
#
  parSol:= dsolve( [ diff(y(x),x,x) = 2*y(x) + 1,
                     y(0)=1,
                     D(y)(0)=0
                   ]
                 );

y(x) = (3/4)*exp(2^(1/2)*x)+(3/4)*exp(-2^(1/2)*x)-1/2

(1)

#
# Now solve the same ODE without boundary conditions,
# so that the returned "general" solution contains
# "integration constants"
#
  genSol:=dsolve( diff(y(x),x,x) = 2*y(x) + 1 );
#
# Use odetest() to test this general solution using
# the same boundary conditions as before. For a valid
# solution, all entries in the returned list should be
# zero
#
  otest:= odetest( genSol,
                   [ diff(y(x),x,x) = 2*y(x) + 1,
                     y(0)=1,
                     D(y)(0)=0
                   ]
                 );
#
# Determine the values of the integration constants
# which make all above list entries zero
#
  cVals:=solve(otest[-2..-1]);
#
# Now substitute the values of these constants in the
# general solution. Note that this is identical to
# that obtained in the first execution group above
#
  subs( cVals, genSol);

y(x) = exp(2^(1/2)*x)*_C2+exp(-2^(1/2)*x)*_C1-1/2

 

[0, 3/2-_C2-_C1, -2^(1/2)*_C2+2^(1/2)*_C1]

 

{_C1 = 3/4, _C2 = 3/4}

 

y(x) = (3/4)*exp(2^(1/2)*x)+(3/4)*exp(-2^(1/2)*x)-1/2

(2)

 

Download odecons.mw

 

assuming you are talking about a Matlab m-file - which is just plaintext - just change the file extension to 'txt'

  restart:

#
# A (probably) inaccurate way to time execution
#
  t1:=time():
  n:=10000:
  x:=Array(0..n+1):
  x[0]:=1:
  x[1]:=5:
  for n from 1 to 10000 do
      x[n+1]:=x[n] + x[n-1];
  end do:
  x[1..10];
  t2:=time()-t1;

Vector[row](10, {(1) = 5, (2) = 6, (3) = 11, (4) = 17, (5) = 28, (6) = 45, (7) = 73, (8) = 118, (9) = 191, (10) = 309})

 

.203

(1)

  doCalc:= proc(p)
                local n, x:=Array(0..p+1):
                x[0]:=1;
                x[1]:=5;
                for n from 1 to p do
                    x[n+1]:=x[n] + x[n-1];
                end do:
                return x;
           end proc:
#
# A (probably) accurate way to time the same
# calculation
#
  z:=CodeTools:-Usage(doCalc(n), iterations=100):
  z[1..10];
              

memory used=5.02MiB, alloc change=101.00MiB, cpu time=17.16ms, real time=15.53ms, gc time=5.30ms

 

Vector[row](10, {(1) = 5, (2) = 6, (3) = 11, (4) = 17, (5) = 28, (6) = 45, (7) = 73, (8) = 118, (9) = 191, (10) = 309})

(2)

 


 

Download timing.mw

I can think of (at least!) two interpretations of the requirement  "animate the cylinder width" - so you are going to have to get really specific.

To give some food for thought, which of the two animations in the attached is closer to your requirement?

NB the orientstion (aka view angle) on the second animation has gone a bit weird when uploading to this site (and I can't be bothered to figure out why) - so just download the attached and run the animation within Maple

  restart:
  with(plots):
  with(plottools):
  with(Student[Calculus1]):

  display( [ seq
             ( cylinder
               ( [2, 2, 2],
                 3+i,
                 i/10,
                 capped = false
               ),
               i = 1 .. 60
             )
           ],
           insequence
         );

 

  display( seq
           ( rotate
             ( SurfaceOfRevolution
               ( 2+sin(x),
                 x=0..j*Pi/60,
                 output=plot
               ),
               0, Pi/2, 0
             ),
             j=1..60
           ),
           insequence=true
          );

 

 

Download cylanmi.mw

You should use default solution methods with the output=Array() options as in the attached

It is inadvisable to use "classical" methods with a fixed step size for two reasons

First issue

From the Maple help at ?dsolve/numeric/classical

These methods use a fixed step size, provide no error estimation or correction, and are provided primarily for educational purposes. If practical numerical solution of ODE initial value problems (IVP) is required, it is suggested that any of the other methods mentioned in dsolve[numeric,IVP] help page be used instead.

Second issue

"Classical" methods do not necessarily handle all of the types of ODE systems which more "modern" methods cater for. The "toy" example in the attached, shows a case where a classical method 'Errors' because the ODE system contains a dependent function with no derivatives

  restart:
  interface(rtablesize=[11, 11]):
  dsys:= { diff(x(t),t,t) = -2*lambda(t)*x(t),
           diff(y(t),t,t) = -2*lambda(t)*y(t)-Pi^2,
           x(t)^2+y(t)^2 = 1,
           x(0)=0, D(x)(0)=1/10, y(0)=-1, D(y)(0)=0
         }:

#
# Solve ODE system and output results at values
# specified by the output=Array() option NB these
# values *may* be integers (but don't have to be)
#
  dsn1:= dsolve( dsys,
                 numeric,
                 output=Array( [$0.5..10.5] )
               );

Vector(2, {(1) = Vector[row](6, {(1) = t, (2) = lambda(t), (3) = x(t), (4) = diff(x(t), t), (5) = y(t), (6) = diff(y(t), t)}), (2) = Matrix(11, 6, {(1, 1) = .5, (1, 2) = 4.932302196056782, (1, 3) = 0.3182698249737477e-1, (1, 4) = 0.9951697559728038e-5, (1, 5) = -.9994933933766327, (1, 6) = 0.3154234218e-6, (2, 1) = 1.5, (2, 2) = 4.932302189662086, (2, 3) = -0.3182702670991888e-1, (2, 4) = -0.29857723290894838e-4, (2, 5) = -.9994933919377844, (2, 6) = 0.9476261016e-6, (3, 1) = 2.5, (3, 2) = 4.932302183687881, (3, 3) = 0.3182707031833182e-1, (3, 4) = 0.4977513571646319e-4, (3, 5) = -.9994933904933764, (3, 6) = 0.15849479574136706e-5, (4, 1) = 3.5, (4, 2) = 4.932302177898736, (4, 3) = -0.3182711274811893e-1, (4, 4) = -0.696770579180503e-4, (4, 5) = -.9994933892398543, (4, 6) = 0.2215856460216259e-5, (5, 1) = 4.5, (5, 2) = 4.9323021734786305, (5, 3) = 0.3182715317759925e-1, (5, 4) = 0.8959170697266246e-4, (5, 5) = -.9994933878623955, (5, 6) = 0.28515751805669464e-5, (6, 1) = 5.5, (6, 2) = 4.932302168956804, (6, 3) = -0.3182719330819825e-1, (6, 4) = -0.10950231434071253e-3, (6, 5) = -.9994933866411768, (6, 6) = 0.3486169030315882e-5, (7, 1) = 6.5, (7, 2) = 4.932302165316609, (7, 3) = 0.3182723143001108e-1, (7, 4) = 0.12940578295431946e-3, (7, 5) = -.9994933854398366, (7, 6) = 0.4117219892029525e-5, (8, 1) = 7.5, (8, 2) = 4.932302162689616, (8, 3) = -0.3182726854164948e-1, (8, 4) = -0.14932525880657606e-3, (8, 5) = -.9994933841591275, (8, 6) = 0.4755024120978823e-5, (9, 1) = 8.5, (9, 2) = 4.932302159630591, (9, 3) = 0.3182730485363442e-1, (9, 4) = 0.16922917901376552e-3, (9, 5) = -.9994933831224945, (9, 6) = 0.5386693393640039e-5, (10, 1) = 9.5, (10, 2) = 4.932302158139484, (10, 3) = -0.3182733886642533e-1, (10, 4) = -0.1891396320308865e-3, (10, 5) = -.9994933819771349, (10, 6) = 0.6020398209683824e-5, (11, 1) = 10.5, (11, 2) = 4.932302156740678, (11, 3) = 0.3182737253803936e-1, (11, 4) = 0.20905530224204973e-3, (11, 5) = -.9994933808999356, (11, 6) = 0.6656802807946455e-5})})

(1)

#
# It is inadvisable to use a classical method and
# set the stepsize because Maple will no longer
# adjust the stepsize to maintain error control.
#
# Also "classical" methods will not necessarily
# handle all the types of ODE systems. For example
# the following will fail
#
  dsn2:= dsolve( dsys,
                 numeric,
                 method=classical[rk4],
                 stepsize=1,
                 output=Array( [$0..10] )
               );

Error, (in DEtools/convertsys) the ODE system does not contain derivatives of the unknown function lambda

 

 

Download odeARR.mw

 

 

When you use the construct X__1, you are creating a variable which has an inert suffix as part of the variable name.

This is NOT an indexed variable

It is (of course) possible to add variables whose names contain inert suffixes, but it requires constructing the required names 'on-the-fly', which isn't really desirable - much better to use indexed names in the first place - as in the attached

#
# Using *inert* suffixes
#
  restart:
  X__1:=4.83;
  X__2:=4.33;
  X__3:=4.66;
  add(eval(cat(X__, i)), i = 1 .. 3);

4.83

 

4.33

 

4.66

 

13.82

(1)

#
# Using indexes
#
  restart:
  X[1]:=4.83;
  X[2]:=4.33;
  X[3]:=4.66;
  add(X[i], i = 1 .. 3);

4.83

 

4.33

 

4.66

 

13.82

(2)

#
# Of course even better would be something
# like
#
  restart;
  X:=[ 4.83, 4.33, 4.66 ];
  add(X);

[4.83, 4.33, 4.66]

 

13.82

(3)

 

Download suff2.mw

A quuick plot suggests that youe expression may have lots of roots, which seems to be confirmed in the attached. I wouldn't want to bet that the Roots() command is actually finding *all* zeros of the function, particularly when these are closely spaced

It is *interesting* that several of the reported roots seem to appear as closely-spaced pairs, eg

55.13887651,55.19203013,

140.6845904, 140.7182692

etc.

From this observation and the plot of the function, I wouldn't be surprised if there were two roots associated with every maximum in the function - becuase each maximum is just fractionally greate than zero. This conjecture might take significant further work to extablish.

restart

V0 := 1

1

(1)

a := 2

2

(2)

b := 1

1

(3)

assume(En > 0)

ks := sqrt(2*En)

2^(1/2)*En^(1/2)

(4)

qs := sqrt(2*(V0-En))

(2-2*En)^(1/2)

(5)

psi11 := proc (x) options operator, arrow; A1*exp(qs*x)+B1*exp(-qs*x) end proc

proc (x) options operator, arrow; A1*exp(qs*x)+B1*exp(-qs*x) end proc

(6)

psi21 := proc (x) options operator, arrow; A2*exp(I*ks*x)+B2*exp(-I*ks*x) end proc

proc (x) options operator, arrow; A2*exp(I*ks*x)+B2*exp(-I*ks*x) end proc

(7)

lp := a+b

3

(8)

psi12 := proc (x) options operator, arrow; exp(I*Kp*lp)*(A1*exp(qs*(x-lp))+B1*exp(-qs*(x-lp))) end proc

proc (x) options operator, arrow; exp(I*Kp*lp)*(A1*exp(qs*(x-lp))+B1*exp(-qs*(x-lp))) end proc

(9)

psi22 := proc (x) options operator, arrow; exp(I*Kp*lp)*(A2*exp(I*ks*(x-lp))+B2*exp(-I*ks*(x-lp))) end proc

proc (x) options operator, arrow; exp(I*Kp*lp)*(A2*exp(I*ks*(x-lp))+B2*exp(-I*ks*(x-lp))) end proc

(10)

eq1 := psi11(0) = psi21(0)

A1+B1 = A2+B2

(11)

eq2 := (D(psi11))(0)-(D(psi21))(0)

A1*(2-2*En)^(1/2)-B1*(2-2*En)^(1/2)-I*A2*2^(1/2)*En^(1/2)+I*B2*2^(1/2)*En^(1/2)

(12)

eq3 := expand(psi21(a)-psi12(a))

A2*(exp(I*2^(1/2)*En^(1/2)))^2+B2/(exp(I*2^(1/2)*En^(1/2)))^2-(exp(I*Kp))^3*A1/exp((2-2*En)^(1/2))-(exp(I*Kp))^3*B1*exp((2-2*En)^(1/2))

(13)

eq4 := expand((D(psi21))(a)-(D(psi12))(a))

I*A2*2^(1/2)*En^(1/2)*(exp(I*2^(1/2)*En^(1/2)))^2-I*B2*2^(1/2)*En^(1/2)/(exp(I*2^(1/2)*En^(1/2)))^2-(exp(I*Kp))^3*A1*(2-2*En)^(1/2)/exp((2-2*En)^(1/2))+(exp(I*Kp))^3*B1*(2-2*En)^(1/2)*exp((2-2*En)^(1/2))

(14)

with(linalg)

row1 := vector([1, 1, -1, -1])

array( 1 .. 4, [( 1 ) = (1), ( 2 ) = (1), ( 3 ) = (-1), ( 4 ) = (-1)  ] )

(15)

row2 := vector([coeff(eq2, A1), coeff(eq2, B1), coeff(eq2, A2), coeff(eq2, B2)])

array( 1 .. 4, [( 1 ) = ((2-2*En)^(1/2)), ( 2 ) = (-(2-2*En)^(1/2)), ( 3 ) = (-I*2^(1/2)*En^(1/2)), ( 4 ) = (I*2^(1/2)*En^(1/2))  ] )

(16)

row3 := vector([coeff(eq3, A1), coeff(eq3, B1), coeff(eq3, A2), coeff(eq3, B2)])

array( 1 .. 4, [( 1 ) = (-(exp(I*Kp))^3/exp((2-2*En)^(1/2))), ( 2 ) = (-(exp(I*Kp))^3*exp((2-2*En)^(1/2))), ( 3 ) = ((exp(I*2^(1/2)*En^(1/2)))^2), ( 4 ) = (1/(exp(I*2^(1/2)*En^(1/2)))^2)  ] )

(17)

row4 := vector([coeff(eq4, A1), coeff(eq4, B1), coeff(eq4, A2), coeff(eq4, B2)])

array( 1 .. 4, [( 1 ) = (-(exp(I*Kp))^3*(2-2*En)^(1/2)/exp((2-2*En)^(1/2))), ( 2 ) = ((exp(I*Kp))^3*(2-2*En)^(1/2)*exp((2-2*En)^(1/2))), ( 3 ) = (I*2^(1/2)*En^(1/2)*(exp(I*2^(1/2)*En^(1/2)))^2), ( 4 ) = (-I*2^(1/2)*En^(1/2)/(exp(I*2^(1/2)*En^(1/2)))^2)  ] )

(18)

C := matrix(4, 4, 0)

array( 1 .. 4, 1 .. 4, [( 1, 4 ) = (0), ( 4, 2 ) = (0), ( 4, 1 ) = (0), ( 2, 2 ) = (0), ( 3, 4 ) = (0), ( 1, 1 ) = (0), ( 1, 3 ) = (0), ( 2, 1 ) = (0), ( 4, 4 ) = (0), ( 2, 4 ) = (0), ( 3, 2 ) = (0), ( 4, 3 ) = (0), ( 3, 1 ) = (0), ( 1, 2 ) = (0), ( 2, 3 ) = (0), ( 3, 3 ) = (0)  ] )

(19)

for i to 4 do C[1, i] := row1[i]; C[2, i] := row2[i]; C[3, i] := row3[i]; C[4, i] := row4[i] end do

evalm(C)

array( 1 .. 4, 1 .. 4, [( 1, 4 ) = (-1), ( 4, 2 ) = ((exp(I*Kp))^3*(2-2*En)^(1/2)*exp((2-2*En)^(1/2))), ( 4, 1 ) = (-(exp(I*Kp))^3*(2-2*En)^(1/2)/exp((2-2*En)^(1/2))), ( 2, 2 ) = (-(2-2*En)^(1/2)), ( 3, 4 ) = (1/(exp(I*2^(1/2)*En^(1/2)))^2), ( 1, 1 ) = (1), ( 1, 3 ) = (-1), ( 2, 1 ) = ((2-2*En)^(1/2)), ( 4, 4 ) = (-I*2^(1/2)*En^(1/2)/(exp(I*2^(1/2)*En^(1/2)))^2), ( 2, 4 ) = (I*2^(1/2)*En^(1/2)), ( 3, 2 ) = (-(exp(I*Kp))^3*exp((2-2*En)^(1/2))), ( 4, 3 ) = (I*2^(1/2)*En^(1/2)*(exp(I*2^(1/2)*En^(1/2)))^2), ( 3, 1 ) = (-(exp(I*Kp))^3/exp((2-2*En)^(1/2))), ( 1, 2 ) = (1), ( 2, 3 ) = (-I*2^(1/2)*En^(1/2)), ( 3, 3 ) = ((exp(I*2^(1/2)*En^(1/2)))^2)  ] )

(20)

chareq := det(C)

2*((2*I)*(2-2*En)^(1/2)*(exp(I*Kp))^6*exp((2-2*En)^(1/2))*2^(1/2)*En^(1/2)*(exp(I*2^(1/2)*En^(1/2)))^2-I*(2-2*En)^(1/2)*(exp(I*Kp))^3*(exp((2-2*En)^(1/2)))^2*2^(1/2)*En^(1/2)*(exp(I*2^(1/2)*En^(1/2)))^4-I*(2-2*En)^(1/2)*(exp(I*Kp))^3*2^(1/2)*En^(1/2)*(exp(I*2^(1/2)*En^(1/2)))^4+2*En*(exp(I*Kp))^3*(exp((2-2*En)^(1/2)))^2*(exp(I*2^(1/2)*En^(1/2)))^4-I*(2-2*En)^(1/2)*(exp(I*Kp))^3*(exp((2-2*En)^(1/2)))^2*2^(1/2)*En^(1/2)-(exp(I*Kp))^3*(exp((2-2*En)^(1/2)))^2*(exp(I*2^(1/2)*En^(1/2)))^4-2*En*(exp(I*Kp))^3*(exp(I*2^(1/2)*En^(1/2)))^4-I*(2-2*En)^(1/2)*(exp(I*Kp))^3*2^(1/2)*En^(1/2)+(2*I)*(2-2*En)^(1/2)*exp((2-2*En)^(1/2))*2^(1/2)*En^(1/2)*(exp(I*2^(1/2)*En^(1/2)))^2+(exp(I*Kp))^3*(exp(I*2^(1/2)*En^(1/2)))^4-2*En*(exp(I*Kp))^3*(exp((2-2*En)^(1/2)))^2+(exp(I*Kp))^3*(exp((2-2*En)^(1/2)))^2+2*En*(exp(I*Kp))^3-(exp(I*Kp))^3)/(exp((2-2*En)^(1/2))*(exp(I*2^(1/2)*En^(1/2)))^2)

(21)

sol := fsolve(subs(Kp = 0, chareq), En)

0.

(22)

  plot( eval(chareq, Kp=0), En =0..1000 );

 

Student[Calculus1]:-Roots( eval(chareq, Kp=0), En =0..1000 );

Warning, some roots are returned as numeric approximations

 

[0., 2.712788471, 35.39075512, 35.46296298, 55.13887651, 55.19203013, 79.28946408, 107.7826627, 140.6845904, 140.7182692, 177.9858997, 219.6721712, 265.7285598, 316.1604982, 371.0027146, 430.1998472, 493.8134408, 493.8138913, 634.1893683, 792.1023264, 967.5545072, 967.5547370]

(23)

 


 

Download lotsOfRoots2.mw

 

The default display of data structures such as rtables (matrices, vectors, and arrays) as well as data frames and data series has been changed. Previously a summary would be shown for the data structure, but now the display shows the header of the data (by default the first 10 rows and 10 columns) and the size of the data structure.

So for structures less than the default rtablesize (ie 10*10) nothing has actually changed. Anything "bigger" than 10*10, you probably don't want to display anyway - although this is "the change"

Can you set up a command which will display more-or -less the same info? Yes, but (AFAIK) not as a default.

Consider the attached

  restart;
  dispA:=x-> Vector(6, [op([0..2], x), op([4..-1], x)]):
  A:=Array(1..20,1..20,rand(1..10)):
  dispA(A);

Vector(6, {(1) = Array, (2) = 1 .. 20, (3) = 1 .. 20, (4) = datatype = anything, (5) = storage = rectangular, (6) = order = Fortran_order})

(1)

 


 

Download arrDisp.mw

 

 

First 81 82 83 84 85 86 87 Last Page 83 of 207