MaplePrimes Questions


The command L2(1,2) etc (statements 5 to 8) all are considered as valid and gives the complete list as the answer. Can anyone interpret the behaviour and logic behind the maple answers?

s := [1], [2]

[1], [2]

(1)

L2 := [s]

[[1], [2]]

(2)

type(L2, listlist)

true

(3)

L2__1

L2__1

(4)

"Following commands  give the list L2, which in my opinion is wrong."

L2(1)

[[1], [2]]

(5)

L2(1, 1)

[[1], [2]]

(6)

L2(1, 2)

[[1], [2]]

(7)

L2(2, 2)

[[1], [2]]

(8)

``

L2[2]

[2]

(9)

L2[1][2]

Error, invalid subscript selector

 

``


 

Download Doubt1.mw


 

restart; with(LinearAlgebra); with(plots)

M := 3:

for i while i <= 3 do t[i] := cos((2*i+1)*evalf(Pi)/(2^k*M)) end do;

-0.2051033808e-9

 

-.8660254038

 

-.8660254034

(1)

``

``

printlevel := 2:

-0.2051033808e-9

 

-1.000000000

 

-.8660254038

 

-2.732050808

 

-.8660254034

 

-2.732050807

 

-0.3076550712e-9*p[1](-0.2051033808e-9)-1/2

 

-1.732050808*p[1](-0.2051033808e-9)

 

-1.299038106*p[1](-.8660254038)-1/2

 

-4.732050809*p[1](-.8660254038)

 

-1.299038105*p[1](-.8660254034)-1/2

 

-4.732050808*p[1](-.8660254034)

 

-0.3418389680e-9*p[2](-0.2051033808e-9)-(2/3)*p[1](-0.2051033808e-9)

 

-2.236067977*p[2](-0.2051033808e-9)

 

-1.443375673*p[2](-.8660254038)-(2/3)*p[1](-.8660254038)

 

-6.109051323*p[2](-.8660254038)

 

-1.443375672*p[2](-.8660254034)-(2/3)*p[1](-.8660254034)

 

-6.109051321*p[2](-.8660254034)

 

-0.3589309164e-9*p[3](-0.2051033808e-9)-(3/4)*p[2](-0.2051033808e-9)

 

-2.645751310*p[3](-0.2051033808e-9)

 

-1.515544457*p[3](-.8660254038)-(3/4)*p[2](-.8660254038)

 

-7.228327004*p[3](-.8660254038)

 

-1.515544456*p[3](-.8660254034)-(3/4)*p[2](-.8660254034)

 

-7.228327002*p[3](-.8660254034)

(2)

y(t) := -1.204*phi[1, 0]+.754*phi[1, 1]+.647*phi[1, 2];

3.289389172-3.567966309*p[1](-.8660254034)-3.952556205*p[2](-.8660254034)

(3)

 

``

plot(y(t))

 plot called with arguments: 3.289389172-3.567966309*p[1](-.8660254034)-3.952556205*p[2](-.8660254034), axiscoordinates = (), coords = (), ispolarplot = false
 #(plot,7): error

Error, (in plot) cannot determine plotting variable

 

 locals defined as: cname = cname

 

``

``


 

Download us3.mw

Do not have a working activation code for Maple17.  Have these 2, but neither works.
Y3KKTP32PLF9PXFU 

ZJLL59SMMXQSE8MU

 

I am running Ubuntu 18 (linux).

Thanks

Tom Vawter

(John Vawter)

 

How can I quickly construct a lower triangular matrix?

I tried the following:

restart;

n := 4;

M1 := Matrix(Vector([seq(k, k = 1 .. n)]), shape = diagonal);

M2 := Matrix(Vector([seq(1, k = 1 .. n-1)]), shape = diagonal);

M := Matrix([M1, M2], shape = triangular[lower])

 

 

 

In this case the diagonal has value 1,2,3,4 while the line below 1,1,1.

 

edit: Actually I managed with

M := Matrix([[1], seq([seq(0, i = 1 .. k-2), 1, k], k = 2 .. n)], shape = triangular[lower])

 

 

 

but I was wondering if it is also possible to use Matrices to fill parts of a bigger matrix?

Hi, I cant explain these answers. Can you help me?

Is it possible to use the diff(f,x) operator together with @@ ??

So as in

((x*D)@@2)(f)(x)

-> (x*diff(f,x))@@2 which is of course wrong, but I guess you know what I mean.

In the first case maple evaluates ((x*D)@@1)(x) to x(x)*D(x), but of course x(x) is nonsense here, as x is the variable, so x(anything)=x and D(x) should also be reduced to 1. Is it not possible to tell D that x is the differentiation variable?

 

Probably I could make rules like

applyrule(x(a::anything)=x,expression)

but that seems rather cumbersome.

Much simpler would it be to tell maple in the first place how D and x precisely act.

Hi everyone

I'm stuck with a maple problem

I've got a text file with hundred thousnad of numbers in that form, correspond to point position:

1728
 generated by VMD
  C1        -6.932300       12.540000      -20.260000
  C1        -7.005000       13.914000      -18.431999
  C2        -8.143600       11.942000      -19.424000
  C2        -8.236300       12.972000      -18.327000
  C3        -5.110600       12.270000      -18.719000
  C4        -5.390700       14.318000      -20.143000
  C5        -4.419600       15.242000      -19.368999
  C6        -2.534000       15.407000      -20.941000
  C1        10.458000      -20.974001       -1.023700
  C1         9.977000      -19.162001        0.231220

My problems is, I need to extract specific position, for example, extract all of the position of C1, and put them in a matrix, such as C11(x,y,z),C12(x,y,z)...

in order to be able to extract positions, I currently programmed that:


fileToImport := "metoxyHFtest.txt";

numberreadline := 10;

for i to numberreadline do

lineread := readline(fileToImport);

C6 = sscanf(lineread, " C6%f %f%f")

end do;

Which extract well the position of C6 in that case, but I don't understand how to put these C6 sting in a matrix, even more that each time maple don't find C6, an empty string is produce.

Thanks a lot in advance for your help!

cheers

 

Why seq command dont arrange sequently?
 

``

Qnon[1] := 5.4763071242*10^(-13)*tau[1](t)-.20506349752*tau[4](t)+7.3355613350*10^(-13)*mu*(diff(tau[4](t), t))-1.5518674346*10^(-12)*mu*(diff(tau[3](t), t))-5.4168963155*10^(-11)*mu*(diff(tau[2](t), t))-8.9983661295*10^(-8)*mu*(diff(tau[1](t), t))+0.38286171190e-3*tau[3](t)-.50952212298*tau[2](t):

Qnon[2] := .50952212392*tau[1](t)-0.10721294912e-3*tau[4](t)+1.8909112516*10^(-10)*mu*(diff(tau[4](t), t))+4.7780699202*10^(-11)*mu*(diff(tau[3](t), t))-8.7982781415*10^(-8)*mu*(diff(tau[2](t), t))-5.4168963155*10^(-11)*mu*(diff(tau[1](t), t))-.92166949920*tau[3](t)-2.1814462038*10^(-9)*tau[2](t):

Qnon[3] := -0.38286183048e-3*tau[1](t)-1.3167782709*tau[4](t)+1.4850896418*10^(-11)*mu*(diff(tau[4](t), t))-8.9970916042*10^(-8)*mu*(diff(tau[3](t), t))+4.7780699202*10^(-11)*mu*(diff(tau[2](t), t))-1.5518674346*10^(-12)*mu*(diff(tau[1](t), t))+6.4450739945*10^(-11)*tau[3](t)+.92166950002*tau[2](t):

Qnon[4] := .20506350370*tau[1](t)+1.5790484882*10^(-8)*tau[4](t)-8.8717209465*10^(-8)*mu*(diff(tau[4](t), t))+1.4850896418*10^(-11)*mu*(diff(tau[3](t), t))+1.8909112516*10^(-10)*mu*(diff(tau[2](t), t))+7.3355613350*10^(-13)*mu*(diff(tau[1](t), t))+1.3167782342*tau[3](t)+0.10721719888e-3*tau[2](t):

EqMR := {seq(Qnon[i], i = 1 .. 4)}[4]

.50952212392*tau[1](t)-0.10721294912e-3*tau[4](t)+0.18909112516e-9*mu*(diff(tau[4](t), t))+0.47780699202e-10*mu*(diff(tau[3](t), t))-0.87982781415e-7*mu*(diff(tau[2](t), t))-0.54168963155e-10*mu*(diff(tau[1](t), t))-.92166949920*tau[3](t)-0.21814462038e-8*tau[2](t)

(1)

``

``

``

``


 

Download seq.mw

arrow([u1, u2, u3], shape = cylindrical_arrow, length = sqrt(LinearAlgebra:-Transpose(f0).f0), color = [red, black, green]):

Why i get this error

Error: the number of colours in the COLOUR structure is not sufficient.Error: the number of colours in the COLOUR structure is not sufficient.Error: the number of colours in the COLOUR structure is not sufficient.Error: the number of colours in the COLOUR structure is not sufficient.Error: the number of colours in the COLOUR structure is not sufficient.Error: the number of colours in the COLOUR structure is not sufficient.

In this procedure I roll x dies and request a sum of the dies, n.
I then specify the third argument, o, to be exactly, minimum or maximum, so that it generates random rolls until the sum matches the conditions of my third argument.
It then returns the roll in a list and the number of rolls needed to match the conditions.

 

sim:=proc(x,n,o) uses RandomTools:

sim(3, 12, exactly)

[5, 2, 5], 1

(1)

````

optional_argument.mw
Can I somehow make the third argument optional, with exactly being the default, so that I can enter only sim(3,12) to get a roll that is exactly 12?
I've written through this maplesoft document, but don't quite seem to understand how to make an optional argument in  this regard: https://fr.maplesoft.com/support/help/maple/view.aspx?path=parameter_classes

Any help in understanding this is appreciatet :)

Dear Sir

There is error appears when we solve system of differential equations contains 13 equations ,

the form of error

Error, (in DEtools/convertsys) invalid terms in sum: -9*Y[8]+2 .. Y[3]+.3*Y[6]+.4*Y[7]+3.5*Y[11]+3.5*Y[13]

 

Hint we use dsolve, numerically

How to overcome on this error 

 

Thanks

Hello,

1 .

If A and B are non-commuting operators and I want to calculate

(A+B)^n for some integer n, how can I tell maple to not commute them?

 

2.

And if I have this operator construct A^3. How can I replace it with some defined function f, so A^3 becomes (f@@3)(...)

Why I maple dont send out 1????

I expcect Q be 1, but receive  .9261583073444211949, Why?


 

``

restart

A := Matrix(10, 10, {(1, 1) = 0.358665012985547e-3, (1, 2) = -0.164628637225196e-2, (1, 3) = 0.808705603350256e-3, (1, 4) = 0.131914692392149e-2, (1, 5) = -0.120745384995453e-2, (1, 6) = -0.127685186328850e-3, (1, 7) = -0.368262140727460e-3, (1, 8) = 0.722934152182773e-3, (1, 9) = 0.406838157326509e-3, (1, 10) = -0.270949354604275e-3, (2, 1) = -1.04811784877605, (2, 2) = -0.227246433636184e-2, (2, 3) = 1.12987295590946, (2, 4) = 0.320910227706809e-2, (2, 5) = -0.837137925723646e-1, (2, 6) = -0.590494756927829e-3, (2, 7) = 0.141893953127997e-2, (2, 8) = -0.431705701475750e-3, (2, 9) = 0.529611988652095e-3, (2, 10) = 0.876913927974057e-4, (3, 1) = -0.186537779517955e-2, (3, 2) = 0.731113455007046e-3, (3, 3) = -0.916700660778503e-2, (3, 4) = -0.429742144388156e-2, (3, 5) = 0.171402262358938e-1, (3, 6) = 0.147242552352914e-2, (3, 7) = -0.837021118160759e-2, (3, 8) = 0.348174114649671e-2, (3, 9) = 0.225687533471807e-2, (3, 10) = -0.139775301206369e-2, (4, 1) = -1.52107139964422, (4, 2) = 0.808077875491177e-2, (4, 3) = 1.64372029140351, (4, 4) = -0.847286100516818e-2, (4, 5) = -.127335986762229, (4, 6) = 0.118070315638635e-2, (4, 7) = 0.424032693235149e-2, (4, 8) = -0.111038208252920e-2, (4, 9) = 0.434602411991222e-3, (4, 10) = 0.318930385884084e-3, (5, 1) = 0.289424730370674e-2, (5, 2) = -0.172887794344293e-2, (5, 3) = 0.157061251396572e-1, (5, 4) = -0.363778806608431e-2, (5, 5) = -0.221497403961738e-1, (5, 6) = 0.205810013144210e-2, (5, 7) = 0.290388608347142e-2, (5, 8) = 0.554530769943721e-2, (5, 9) = 0.645600822073613e-3, (5, 10) = -0.223995662113480e-2, (6, 1) = 4.05367823691209, (6, 2) = -0.669541776787987e-2, (6, 3) = -4.37687402333541, (6, 4) = 0.100071882622313e-1, (6, 5) = .331612307231483, (6, 6) = -0.222866442868341e-2, (6, 7) = -0.854247230826875e-2, (6, 8) = -0.198825849939076e-2, (6, 9) = 0.144764377225621e-3, (6, 10) = 0.887581546748840e-3, (7, 1) = 0.437884803847533e-3, (7, 2) = -0.468560550990847e-2, (7, 3) = -0.274035269283456e-2, (7, 4) = 0.132221205985872e-2, (7, 5) = 0.587286710360397e-2, (7, 6) = 0.141670610986008e-2, (7, 7) = -0.324890905770655e-2, (7, 8) = 0.346314407352620e-2, (7, 9) = -0.313507643096885e-3, (7, 10) = -0.150449109852917e-2, (8, 1) = -1.74365543905306, (8, 2) = 0.329936253329467e-2, (8, 3) = 1.88180005384087, (8, 4) = -0.307966351872919e-2, (8, 5) = -.141724173079475, (8, 6) = 0.461487956516473e-3, (8, 7) = 0.455622531837965e-2, (8, 8) = -0.147959204065083e-2, (8, 9) = -0.964311997155483e-3, (8, 10) = 0.776900663643289e-3, (9, 1) = -0.182153308681337e-2, (9, 2) = 0.731579627122705e-2, (9, 3) = -0.459671306590223e-2, (9, 4) = 0.528628529817773e-2, (9, 5) = 0.340926625224384e-3, (9, 6) = -0.480044705401815e-2, (9, 7) = 0.906564729308528e-2, (9, 8) = -0.131891681339107e-1, (9, 9) = -0.298963526401197e-2, (9, 10) = 0.539189475787896e-2, (10, 1) = .259153153490112, (10, 2) = -0.239896326933024e-2, (10, 3) = -.278509331317189, (10, 4) = -0.165332320182602e-2, (10, 5) = 0.211686310866469e-1, (10, 6) = 0.115660284907533e-2, (10, 7) = -0.165524436062079e-2, (10, 8) = 0.496708050164578e-2, (10, 9) = -0.161592001287913e-3, (10, 10) = -0.203232293033617e-2})

Q := A/max(abs(A)):

max(Q)

.926158307610656317

(1)

``


 

Download suuual.mw

 

 

Hi,

WARNING: This is a pretty silly question. I know it, but I've been on this for hours already...
I have this function rather simple but which depends on a natural number n. When I try a Fourier transform on it, it cannot evaluate the result for any n.

I have to define another function, and evaluate n=2, in order to get an explicit result.

h := piecewise(abs(t) < 2*Pi*n, cos(t), 0)
                    piecewise(abs(t) < 2*Pi*n, cos(t), 0)
   F.T.               
---------->         fourier(piecewise(abs(t) < 2*Pi*n, cos(t), 0), t, w)         # doesn't work for any n



h2 := eval(h, n = 2)
                      piecewise(abs(t) < 4*Pi, cos(t), 0)

   F.T.               2 w sin(4 Pi w)
---------->          ------------------                                          # works with fixed n=2
                      (w - 1) (w + 1)


How can I have an explicit result for any natural n ?

Thanks for your time

after i tryrring to instell another vergion of maple and it failed when i reinstell the older vergion of maple i get this error 
what is missing and i did wronge 

l := (n+m+sum(a[i], i = 1 .. n)+sum(b[j], j = 1 .. m))*ln(alpha)+n*ln(lambda[1])+m*ln(lambda[2])+lambda[1]*(sum(x[i], i = 1 .. n))+lambda[2]*(sum(y[j], j = 1 .. m))-(sum((2+a[i])*ln(exp(lambda[1]*x[i])-1+alpha), i = 1 .. n))-(sum((2+b[j])*ln(exp(lambda[2]*y[j])-1+alpha), j = 1 .. m));

Error, (in property/ConvertProperty) invalid input: PropRange uses a 2nd argument, b, which is missing


 

 

First 778 779 780 781 782 783 784 Last Page 780 of 2428