MaplePrimes Questions

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


 

 

Given the vector A = 4.00i^+7.00j^ , find the magnitude of the vector.

ithprime(n)  gives the unique prime whose index is n, thus ithprime(10) returns 29. Question: is there an inverse function in Maple, which given prime p would return n such that ithprime(n) = p?

Or if no such function exists can anyone suggest a way such a function could be coded?

Thanks in advance

David.

These are the timings for various algorithms, using different starting points deriving surfaces of dimension 5, 4, 3, 2, 1

times3:=[[], [.140], [1.344, .891], [1.578, 1.312, 1.375, 1.437, 1.922, 2.625, 6.406], [2.188, 2.312, 1.687, 2.110, 2.047, 1.578, 8.953, 1.891, 1.875, 9.344, 2.203, 55.969, 2.266, 2.531, 81.078, 2.172, 50.641, 2.500, 3.141, 61.656, 3.406, 3.375]]

times1:=[[.718], [.766, 4.703], [.750, .797, 7.594, 3.938], [6.594, 7.718, 11.969, 8.485, 11.391, 130.583, 548.284, 974.435], [7.281, 8.515, 65.569, 7.016, 8.312, 9.500, 8.562, 9.766, 10.641, 12.609, 13.281, 17.453, 18.640, 1763.860, 2659.990, 7812.89, 8189.139]]

So far i can get a boxplot of either:
Statistics:-BoxPlot(`~`[`~`[log10]](times3));
Statistics:-BoxPlot(`~`[`~`[log10]](times1));

but what I'd like is a boxplot like this but i can't work out how to do this.
 

A := (a^6)^(1/3)*(-b^3)^(1/3)/a^3

I Can't get this to simplify to -b/a. 

suppose i have afunction F(x) and i want to draw a sample for X from F(x)

Even and odd complement each other

how to find other sequence which complement each other?

such as 3 sequences divided integers or 5 sequences divided whole integers

is there monomials creation method such that solve result about coefficient and power are integers when right side columns are sequences?

 

i find even multiplication numbers are always solved into integers coefficient and power.

is there any more other sequences?

if I choose six multiplication table sequence, 

what is this complement of six multiplication table sequence?

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