MaplePrimes Questions

I thought I'd try the latest version of the physics package. I am trying to look at a "simple" function with quantum operators, Taylor expand it, and write terms in normal order (i.e. Dagger(a) terms before a, and Dagger(b) before b), but am having no luck at all. Not sure if this is possible with the current version.

I am also having a couple of weird "interface issues" after loading the package:
1) See the printout from Setup() command - here Dagger(a) and Dagger(b) is sometimes displayed with a bar above the names, but other times (i.e. during other runs) with daggers.
2) Maple gets "stuck" on one of the lines - meaning I press enter, but it does not jump to the next execution block.

Both of these issues are outlined with "NOTE" in the worksheet.

Ultimately, the interface issues are of no concern to me, but I am pretty curious if the current version of the physics package can do what I need?

thanks

Worksheet:  commutator_stuff.mw

---------------------------------

 

 

I'm trying to solve a 2nd order system of pde's with couplded BC but it gives me the following error

Error, (in pdsolve/numeric) initial/boundary conditions must be defined at one or two points for each independent variable

Here is the code

> T01 := 273; T02 := 26; L1 := .1; L2 := .2; h1 := 100; h2 := 200; k1 := 1; k2 := 2; rho1 := 1000; rho2 := 2000; c1 := 0.1e6; c2 := 0.2e6; alpha1 := 1; alpha2 := 2

> PDE := {diff(T1(x, t), t) = (diff(T1(x, t), x, x))/alpha1, diff(T2(x, t), t) = (diff(T2(x, t), x, x))/alpha2}

> IBC:={k1*(D[1](T1))(L1, t) = k2*(D[1](T2))(L1, t), T1(L1, t) = T2(L1, t), T1(x, 0) = T02, T2(x, 0) = T02, (D[1](T1))(0, t) = -h1*(T1(0, t)-T01)/k1, (D[1](T2))(L1+L2, t) = h2*(T2(L1+L2, t)-T02)/k2}

> pds := pdsolve(PDE, IBC, numeric)

Its basically a 1D heat equation in a 2 layers plate with conduction BC on both sides

Coding in key generation of RSA Cryptosystem

message :=123456;

u := nextprime(RandomTools[Generate](integer(range = 10^100 .. 10^(110-1))));

v := nextprime(RandomTools[Generate](integer(range = 10^100 .. 10^(110-1))));

N := u*v;

phi := (u-1)*(v-1);

In RSA cryptosystem, the encryption or decryption of message only can be existed between range 1<=message<=N. This means that if the value of message bigger than N value then we can't get back the original value when performing decryption.Thus, wanna to ask that how can we create a coding so that the system will recognise the random integer u and v whether lie between range 1<=message<=N, means wanna crete a coding that if  N>=message then it will continue to the phi step whereas if message>=then the system need to regenerate the u and v until it satisfy the condition  1<=message<=N .Thus please help as i am a beginner in Maple.Thanks.

>M1:=146996733613391:

>M2:=1348471408813:

>teks:=numtheory[cfrac](M1/M2,'quotients');

tekssifer:=[109,101,115,115,97,103,101]

 

Hi, how should i rewrite my command to decrease the execution time?

Thank you~=]]

 For solving polynomial systems I used RootFinding[Isolate]. But after discussing the question http://www.mapleprimes.com/questions/211774-Roots-Of--Expz--1
I decided to compare Isolate and evalf(solve ([...], [...])). It seemed to me that solve some convenient. The only if in the equation there are integers as a real, they should be recorded with a decimal point. (For real solutions of this procedure should be used with (RealDomain).)  Examples:

SOLVE_ISOLATE.mw

I wonder why then the need Root Finding [Isolate]?

Hello evrey one , I need help for solve these equation with boundary conditions 

 

 Boundary Conditions


My COde + equation 

NULL

restart; with(plots); with(PDEtools)

NULL

NULL

eq := diff(g(Y), `$`(Y, 4))+diff(g(Y), `$`(Y, 2))+g(Y);

diff(diff(diff(diff(g(Y), Y), Y), Y), Y)+diff(diff(g(Y), Y), Y)+g(Y)

(1)

cis := g(1/4) = 0, (D(g))(1/4) = 0, g(0) = 0, (D[2](g))(0) = 0

Error, (in evalapply) too few variables for the derivative with respect to the 2nd variable

 

solut := dsolve([eq, cis], numeric)

Error, (in dsolve/numeric/process_input) system must be entered as a set/list of expressions/equations

 

``

NULL

NULL

NULL

``

 

Download mp.mw

 

Thank you 

 

 

ANALYSIS AND DESIGN OF MACHINE FOUNDATION

 


restart

Loading Optimization

 

Loading LinearAlgebra  

 

Loading plots  

with(ScientificConstants):

Loading DynamicSystems  

with(Units:-Standard)

with(Units:-Natural)

with(StringTools)

FormatTime("%m-%d-%Y, %H:%M")

FormatTime("%m-%d-%Y, %H:%M")

(1)

NULL

Introduction

 

This document deals with vibration analysis and design of machine foundations subjected to dynamic load.

NULL

NULL

NULL

NULL

GetConstant(g);

standard_acceleration_of_gravity, symbol = g, value = 9.80665, uncertainty = 0, units = m/s^2

(2)

g__SI := evalf(Constant(g, system = SI, units))

9.80665*Units:-Unit(('m')/('s')^2)

(3)

NULL

Richart and Lysmer's Model

 

Richart et al. (1970) idealised the foundation as a lumped mass supported on soil which is idealised as frequency independent springs which he described in term of soil parameter

dynamic shear modulus or shear wave velocity of the soil for circular footing when footings having equivalent circular radius. The Tables below shows the different values of spring and damping vlaues as per Richart and Lysmer.

NULL

In which, G = dynamic shar modulus of he soil and is given G = `&rho;__s`*V__s^2 ; ν = Piosson's ratio of the soil; ρs = mass density of the soil; Vs = shear wave velocity of the soil obtained

from soil testing; g = acceleration due to gravity; m = mass of the machine and foundation; J = mass moment of inertia of the machine and foundation about the appropriate axes; K = equivalent spring stiffness of the soil; C = damping value of the soil; B = interia factor contributing to the damping factor; D = damping ratio of the soil; r = equivalent radius of a circular foundation; L = length of foundation, and B = width of the foundation.

NULL

NULL

NULL

Sketch

 

NULL

NULL

NULL

NULL

nu := .25

Table : Values of soil springs as per Richart and Lysmer (1970) model

 

NULL

NULL

SI No.

Direction

Spring value

Equivalent radius

Remarks

1

Vertical

K__z = 4*G*r__z/(1-nu)"(->)"

r__z = sqrt(L*B/Pi)"(->)"

This is in vertical Z direction

2

Horizontal

K__x = (32*(1-nu))*G*r__x/(7-8*nu)
"(->)"

r__x = sqrt(L*B/Pi)"(->)"

This induce sliding in horizontal X

2.1

Horizontal

K__y = (32*(1-nu))*G*r__y/(7-8*nu)
"(->)"

r__y = sqrt(L*B/Pi)"(->)"

This induce sliding in horizontal Y

3

Rocking

`K__&phi;x` = 8*G*`r__&phi;x`^3/(3*(1-nu))"(->)"

`r__&phi;x` = (L*B^3/(3*Pi))^(1/4)"(->)"

This produces roxking about Y axis

3.1

Rocking

`K__&phi;y` = 8*G*`r__&phi;y`^3/(3*(1-nu))"(->)"

`r__&phi;y` = (L^3*B/(3*Pi))^(1/4)"(->)"

This produces roxking about X axis

4

Twisting

`K__&psi;` = 16*G*`r__&psi;`^3*(1/3)"(->)"

`r__&psi;` = ((B^3*L+B*L^3)/(6*Pi))^(1/4)
"(->)"

This produces twisting about vertical Z axis

 

NULL

NULL

NULL

NULL

NULL

Table : Values of soil damping as per Richart and Lysmer (1970) model

 

NULL

SI No.

Direction

Mass ratio (B)

Damping ratio and Damping values

Remarks

1

Vertical

B__z = .25*m__U*(1-nu)*g__SI/(`&rho;__s`*r__z^3)
"(->)"

`&zeta;__z` = .425/sqrt(B__z)"(->)"C__z = 2*`&zeta;__z`*sqrt(K__z*m__U)"(->)"

This damping value is in vertical Z direction

2

Horizontal

B__x = (7-8*nu)*m__U*g__SI/((32*(1-nu))*`&rho;__s`*r__x^3)
"(->)"

`&zeta;__x` = .288/sqrt(B__x)"(->)"

C__x = 2*`&zeta;__x`*sqrt(K__x*m__U)"(->)"

This damping value is in lateral X direction

2.1

Horizontal

B__y = (7-8*nu)*m__U*g__SI/((32*(1-nu))*`&rho;__s`*r__y^3)
"(->)"

`&zeta;__y` = .288/sqrt(B__y)"(->)"

`&zeta;__y` = .288/((2.145204688-2.451662500*nu)*m__U*Units:-Unit(('m')/('s')^2)/((1-nu)*`&rho;__s`*(L*B/Pi)^(3/2)))^(1/2)

(5.1)

NULLError, invalid left hand side in assignmentError, invalid left hand side in assignment

`&zeta;__&psi;` = .5/(1+117.6798000*`J__&psi;`*Units:-Unit(('m')/('s')^2)*6^(1/4)/(`&rho;__s`*((B^3*L+B*L^3)/Pi)^(5/4)))

(5.2)

C__y = 2*`&zeta;__y`*sqrt(K__y*m__U)"(->)"

This damping value is in lateral Y direction

3

Rocking

`B__&phi;x` = (.375*(1-nu))*`J__&phi;x`*g__SI/(`&rho;__s`*`r__&phi;x`^5)
"(->)"

`&zeta;__&phi;x` = .15/((1+`B__&phi;x`)*sqrt(`B__&phi;x`))
"(->)"

`&zeta;__&phi;x` = .15/((1+11.03248125*(1-nu)*`J__&phi;x`*Units:-Unit(('m')/('s')^2)*3^(1/4)/(`&rho;__s`*(L*B^3/Pi)^(5/4)))*((11.03248125-11.03248125*nu)*`J__&phi;x`*Units:-Unit(('m')/('s')^2)*3^(1/4)/(`&rho;__s`*(L*B^3/Pi)^(5/4)))^(1/2))

(5.3)

Error, invalid left hand side in assignmentError, invalid left hand side in assignmentNULLError, invalid left hand side in assignment

.15/((1+11.03248125*(1-nu)*`J__&phi;x`*Units:-Unit(('m')/('s')^2)*3^(1/4)/(`&rho;__s`*(L*B^3/Pi)^(5/4)))*((11.03248125-11.03248125*nu)*`J__&phi;x`*Units:-Unit(('m')/('s')^2)*3^(1/4)/(`&rho;__s`*(L*B^3/Pi)^(5/4)))^(1/2)) = .15/((1+11.03248125*(1-nu)*`J__&phi;x`*Units:-Unit(('m')/('s')^2)*3^(1/4)/(`&rho;__s`*(L*B^3/Pi)^(5/4)))*((11.03248125-11.03248125*nu)*`J__&phi;x`*Units:-Unit(('m')/('s')^2)*3^(1/4)/(`&rho;__s`*(L*B^3/Pi)^(5/4)))^(1/2))

(5.4)

`C__&phi;x` = 2*`&zeta;__&phi;x`*sqrt(`K__&phi;x`*`J__&phi;x`)"(->)"

NULL

This damping value is for rocking about Y direction

3.1

Rocking

`B__&phi;y` = (.375*(1-nu))*`J__&phi;y`*g__SI/(`&rho;__s`*`r__&phi;y`^5)
"(->)"

NULL

`&zeta;__&phi;y` = .15/((1+`B__&phi;y`)*sqrt(`B__&phi;y`))
"(->)"

.15/((1+`B__&phi;y`)*`B__&phi;y`^(1/2)) = .15/((1+`B__&phi;y`)*`B__&phi;y`^(1/2))

(5.5)

`C__&phi;y` = 2*`&zeta;__&phi;y`*sqrt(`K__&phi;y`*`J__&phi;y`)"(->)"

NULL

This damping value is for rocking about X direction

4

Twisting

`B__&psi;` = `J__&psi;`*g__SI/(`&rho;__s`*`r__&psi;`^5)"(->)"

`&zeta;__&psi;` = .5/(1+2*`B__&psi;`)"(->)"NULLError, invalid left hand side in assignmentError, invalid left hand side in assignmentNULLError, invalid left hand side in assignmentNULLError, invalid left hand side in assignment

.5/(1+117.6798000*`J__&psi;`*Units:-Unit(('m')/('s')^2)*6^(1/4)/(`&rho;__s`*((B^3*L+B*L^3)/Pi)^(5/4))) = .5/(1+117.6798000*`J__&psi;`*Units:-Unit(('m')/('s')^2)*6^(1/4)/(`&rho;__s`*((B^3*L+B*L^3)/Pi)^(5/4)))

(5.6)

`C__&psi;` = 2*`&zeta;__&psi;`*sqrt(`K__&psi;`*`J__&psi;`)"(->)"NULL

``

NULL

This damping value is valid for twisting about vertical Z axis

 

NULL

NULL

NULLNULL

(4)

``

NULL

Vertical Motion Considering damping of the Soil

 

For vertical direction the equation becomes that of a lumped mass having single degree of freedom when

deq := m__U*(diff(z(t), t, t))+'C__z'*(diff(z(t), t))+'K__z'*`#mi("z")` = P__0*sin(`&omega;__m`*t)

m__U*(diff(diff(z(t), t), t))+C__z*(diff(z(t), t))+K__z*`#mi("z")` = P__0*sin(`&omega;__m`*t)

(6.1)

NULL

t1 := subs(P__0*sin(`&omega;__m`*t)/m__U = F, expand(deq/m__U));

diff(diff(z(t), t), t)+1.085721853*(G*(L*B/Pi)^(1/2)*m__U/(1-nu))^(1/2)*(diff(z(t), t))/(m__U*(m__U*Units:-Unit(('m')/('s')^2)/(`&rho;__s`*(L*B/Pi)^(3/2))-m__U*Units:-Unit(('m')/('s')^2)*nu/(`&rho;__s`*(L*B/Pi)^(3/2)))^(1/2))+4*G*(L*B/Pi)^(1/2)*`#mi("z")`/(m__U*(1-nu)) = F

(6.2)

NULL

(6.3)

By algebraically manipulating the expression, the form traditionally used by engineers is derived:

t2 := algsubs('C__z'/m__U = 2*zeta*omega, t1)

diff(diff(z(t), t), t)-(-1.085721853*(-G*(L*B/Pi)^(1/2)*m__U/(nu-1))^(1/2)*(diff(z(t), t))*nu+1.085721853*(-G*(L*B/Pi)^(1/2)*m__U/(nu-1))^(1/2)*(diff(z(t), t))+4.*G*(L*B/Pi)^(1/2)*`#mi("z")`*(-Units:-Unit(('m')/('s')^2)*(nu-1)*m__U/(`&rho;__s`*(L*B/Pi)^(3/2)))^(1/2))/((nu-1.)*(-Units:-Unit(('m')/('s')^2)*(nu-1)*m__U/(`&rho;__s`*(L*B/Pi)^(3/2)))^(1/2)*m__U) = F

(6.4)

NULL

t3 := algsubs('K__z'/m__U = omega^2, t2)

diff(diff(z(t), t), t)-(-1.085721853*(-G*(L*B/Pi)^(1/2)*m__U/(nu-1))^(1/2)*(diff(z(t), t))*nu+1.085721853*(-G*(L*B/Pi)^(1/2)*m__U/(nu-1))^(1/2)*(diff(z(t), t))+4.*G*(L*B/Pi)^(1/2)*`#mi("z")`*(-Units:-Unit(('m')/('s')^2)*(nu-1)*m__U/(`&rho;__s`*(L*B/Pi)^(3/2)))^(1/2))/((nu-1.)*(-Units:-Unit(('m')/('s')^2)*(nu-1)*m__U/(`&rho;__s`*(L*B/Pi)^(3/2)))^(1/2)*m__U) = F

(6.5)

This form includes the damping ratio , the natural frequency , and the external forcing term .  Consider only free vibration by setting

gen3 := subs(F = 0, t3)

diff(diff(z(t), t), t)-(-1.085721853*(-G*(L*B/Pi)^(1/2)*m__U/(nu-1))^(1/2)*(diff(z(t), t))*nu+1.085721853*(-G*(L*B/Pi)^(1/2)*m__U/(nu-1))^(1/2)*(diff(z(t), t))+4.*G*(L*B/Pi)^(1/2)*`#mi("z")`*(-Units:-Unit(('m')/('s')^2)*(nu-1)*m__U/(`&rho;__s`*(L*B/Pi)^(3/2)))^(1/2))/((nu-1.)*(-Units:-Unit(('m')/('s')^2)*(nu-1)*m__U/(`&rho;__s`*(L*B/Pi)^(3/2)))^(1/2)*m__U) = 0

(6.6)

NULL

sol1 := dsolve({gen3, z(0) = P, (D(z))(0) = V}, z(t))

z(t) = -(1000000000/1178791942081753609)*Pi*m__U*exp(-(1085721853/1000000000)*Units:-Unit(('s')/('m')^(1/2))*t/(Pi*((nu-1)^2/(`&rho;__s`*L^2*B^2*G))^(1/2)*m__U))*(1085721853*V*Units:-Unit(('s')/('m')^(1/2))*((nu-1)^2/(`&rho;__s`*L^2*B^2*G))^(1/2)*`&rho;__s`*L^2*B^2-4000000000*(L*B/Pi)^(1/2)*Pi*nu*`#mi("z")`+4000000000*`#mi("z")`*Pi*(L*B/Pi)^(1/2))/(Units:-Unit(('s')/('m')^(1/2))^2*B^2*L^2*`&rho;__s`)+(4000000000/1085721853)*`#mi("z")`*G*Pi*(L*B/Pi)^(1/2)*((nu-1)^2/(`&rho;__s`*L^2*B^2*G))^(1/2)*t/((nu-1)*Units:-Unit(('s')/('m')^(1/2)))+(1/1178791942081753609)*(1085721853000000000*V*Units:-Unit(('s')/('m')^(1/2))*Pi*((nu-1)^2/(`&rho;__s`*L^2*B^2*G))^(1/2)*m__U*`&rho;__s`*L^2*B^2+1178791942081753609*Units:-Unit(('s')/('m')^(1/2))^2*P*`&rho;__s`*L^2*B^2-4000000000000000000*(L*B/Pi)^(1/2)*Pi^2*m__U*nu*`#mi("z")`+4000000000000000000*`#mi("z")`*Pi^2*(L*B/Pi)^(1/2)*m__U)/(B^2*L^2*`&rho;__s`*Units:-Unit(('s')/('m')^(1/2))^2)

(6.7)

NULL

NULL

 

Download Analysis_and_Design_of_Machine_Foundations_1.mw

Good Morning Mapleprime Community,

Would anybody please help in the attached worksheet. I'm trying to use the new function in Maple that is the clicable method, but I was having problem in some of my output such as zeta_y and zeta_phi as this two equations are generating an error message.

 

Regards,

Moses

Like there is key shortcut ctrl+T for text mode in Maple, is there any key shortcut for math mode ???

Regards

H, how i need to write my command to get n times of the sentences i insert.

For example, 

>teksbiasa:= `Hello Bob`;

Hello Bob

So, if i want 5 times of `Hello Bob` like 

Hello Bob Hello Bob Hello Bob Hello Bob Hello Bob 

What should i write?

Thank you ~=]]

I would like to add threads to this code that compiles cleanly:

RECTmatrixSEQ :=  (FD,m, n, xw, yw, tr, k, rho, dmax) ->
 
   [seq
     (seq
        # A return of 0 means there is no choice - no digit possible
        # result of a 4 means there is a choice of (-1 or 0)
        (add(RECTpred(m, n, i, j, iter1, k, rho)*(2*abs(iter1)+1), iter1 = -dmax .. dmax)
        + (2*dmax+1)*(RECTpredR(m, n, i, j, dmax, k, rho)+
        RECTpredL(m, n, i, j, -dmax, k, rho))+
        .5*RECTpredOR(m, n, i, j, dmax, k, rho)+
        .5*RECTpredOL(m, n, i, j, -dmax, k, rho),
      i = -ceil(2*dmax+2*rho)*2^m .. ceil(2*dmax+2*rho)*2^m-1),
    j = 0 .. 2^(n-yw)-1)]:

I've added thead calls like this, still no syntax errors:

RECTmatrixSEQ :=  (FD,m, n, xw, yw, tr, k, rho, dmax) ->

   CodeTools:-Usage( Threads:-Wait(
   [seq (Threads:-Create
     (seq
        # A return of 0 means there is no choice - no digit possible
        # result of a 4 means there is a choice of (-1 or 0)
        (add(RECTpred(m, n, i, j, iter1, k, rho)*(2*abs(iter1)+1), iter1 = -dmax .. dmax)
        + (2*dmax+1)*(RECTpredR(m, n, i, j, dmax, k, rho) +
        RECTpredL(m, n, i, j, -dmax, k, rho))+
        .5*RECTpredOR(m, n, i, j, dmax, k, rho)+
        .5*RECTpredOL(m, n, i, j, -dmax, k, rho),
      i = -ceil(2*dmax+2*rho)*2^m .. ceil(2*dmax+2*rho)*2^m-1),
    j = 0 .. 2^(n-yw)-1)) ] )
    ):

 

I do get a runtime error:

                 "PROC:feasibilitycheckproONCE

                   "
Error, (in CodeTools:-Usage) invalid input: too many and/or wrong type of arguments passed to Threads:-Create; first unused argument is j = 0 .. 3

Any help spotting this problem would be appreciated. Thanks in advance.

Bonnie

 

Hi, here is the code I used to try to generate all invertible 4x4 matrices over the finite field F_2 = {0.1}. However, when I look at the elements of GROUP (see below) all the elements are 4x4 matrices with a 2 in each entry. I don't know why this is?

Also, I need help converting all of the invertible 4x4 matrices in the following way: I want the 4x4 matrices to each be written as a string of length 16 with no spaces, commas or brackets. So for example the matrix

a b c d

e f g h

i j k l

m n o p

becomes abcdefghijklmnop

restart:
with(LinearAlgebra):
PRIME := 2;
2

# the group of invertible 4 x 4 matrices over the field F_p

GROUP := []:
M := Matrix([[a,b,c,d],[x,f,g,h],[y,j,k,l],[m,n,o,p]]):
for a from 0 to PRIME-1 do
for b from 0 to PRIME-1 do
for c from 0 to PRIME-1 do
for d from 0 to PRIME-1 do
for x from 0 to PRIME-1 do
for f from 0 to PRIME-1 do
for g from 0 to PRIME-1 do
for h from 0 to PRIME-1 do
for y from 0 to PRIME-1 do
for j from 0 to PRIME-1 do
for k from 0 to PRIME-1 do
for l from 0 to PRIME-1 do
for m from 0 to PRIME-1 do
for n from 0 to PRIME-1 do
for o from 0 to PRIME-1 do
for p from 0 to PRIME-1 do
if Determinant(M) mod PRIME <> 0 then
GROUP := [ op(GROUP), M ]
fi
od od od od od od od od od od od od od od od od:


nops(GROUP);
20160

GROUP;

Is it possible to subscript within a plot?

for example I have

this in principle is what I want but, the N is cursive while is O is not (and it's a bit shifted to the right, not right next to the [2] !???

Also I didnt find the meanings of mi(),mn(),mo(),mfenced()... in the help documentation which I stumbled across while googling.

for example in this case:

 

what do I need them for since without the mi it doesnt work?!

Is it possible to use latex notation within the plot options for more convenience?

BTW: When plotting a .ps or .eps the plotting device takes over all the features (like the examples above) but when using png instead it just prints the code behind it ( for example the `#mover(mi("x"),mi("~"))` ) and not would it should lead to

How long will MAPLE 16 and future versions of MAPLE will support running on Windows 7? 

MRB

(I hope to defer transferring to Windows 10 until MS stop supporting for Windows 7.)

Hello,

 

I am unable to use subs() command when using subscript : I'd like to replace YP__1 with dGx in the equation :

"Eq:= YP__1 = Y__2" (Eq:= YP1=Y2)

 

 so I have tried : subs({YP__1=dGx},Eq)

 

But it doesn't work... It give me : YP__1 = Y__2 and I would like to have dGx = Y__2

 

I have tried also with subs({YP[1]=dGx},Eq) but doesn't work too.

 

If I am not using subscript, for exemple : Eq:= YP1 = Y2

 

And do : subs({YP1=dGx},Eq)

 

That works great...

 

But I must use subscript __ because Eq is a result from ODEtools (convertsys).

 

Can you help me please ?

 

Thanks you very much.

 

Regards.

Consider the list [x,y,z], say. Does there in Maple exist some fundamental function for querying the position in the list of x,y, and z, respectively? I am unable to locate any such. Such a function can, of course, be constructed, an example being the following:

listPos := (l::list) -> table(zip(`=`,l,[$(1..nops(l))])):
pos := listPos([x,y,z]);
pos[x],
pos[y],
pos[z];

But that seems unsatisfactory. The same question concerning Vectors: Consider Vector([x,y,z]), say. Here, the following code, say, will perform the task:

VectorPos := (V::Vector) -> table([map(rhs = lhs,op(2,V))[]]):
pos := VectorPos(Vector([x,y,z]));
pos[x],
pos[y],
pos[z];

PS: Of course, list and Vectors can be converted into one another, so any one of the codes above can in practice be used to perform both tasks.

First 1132 1133 1134 1135 1136 1137 1138 Last Page 1134 of 2434