[go: up one dir, main page]

Items tagged with list

Feed App Center
Also available: list

i have solution of ODE but again i want take derivative from solution function F then i want take reciprocal of derivative
if F'=G then i want 1/F'=1/G like that i want all solution by list and if possible don't give the parameter a sequence  it will be better

thanks for any help

K := diff(G(xi), xi $ 2) = -lambda*diff(G(xi), xi) - mu;
                 2                                    
                d                    / d        \     
          K := ----- G(xi) = -lambda |---- G(xi)| - mu
                   2                 \ dxi      /     
                dxi                                   

V:= [seq](-1..1, 1/2);
                          [    -1     1   ]
                     V := [-1, --, 0, -, 1]
                          [    2      2   ]

interface(rtablesize= nops(V)^3):
DataFrame(
    <seq(seq(<a | b | rhs(dsolve(eval(K, [lambda,mu]=~ [a,b])))>, a= V), b= V)>,
    columns= [lambda, mu, F]
);

loading

Error occurred during PDF generation. Please refresh the page and try again

 

Dear all, in the example below I create a matrix(3x2) and each element contains a vector. How can I avoid the double brackets of the matrix elements or eliminate the double brackets?

Thanks for help

I use convert~([points1], list) command but the outcome is not I want. The code of shortscreen is attached. I wanna change the outermost curly braces of the sequence "points1" into square brackets. Thank you all guys to answer!

The below is I want.

This is not I want cause the outermost has three square brackets! I just wanna two.

Have a list of four projective points. I need to check that they are colinear projectively. If one point is at infinity i.e. 0 in z position I can chech if combination of cross product and dot product is 0.
a)  What is a good way to find if one ot the four has zero in z position?

b) Having found that is there a neat way of piching the next two/three points by making the count wrap automatically. e.g 3  then 4,5,6 i.e. 3,4,1,2

restart

with(LinearAlgebra)

pt := [`<,>`(1, 1, 1), `<,>`(2, 1, 1), `<,>`(3, 1, 0), `<,>`(4, 1, 1)]

pt := [Vector(3, {(1) = 1, (2) = 1, (3) = 1}), Vector(3, {(1) = 2, (2) = 1, (3) = 1}), Vector(3, {(1) = 3, (2) = 1, (3) = 0}), Vector(3, {(1) = 4, (2) = 1, (3) = 1})]

(1)

ListTools(Occurences([anything, anything, 0], pt))

ListTools(Occurences([anything, anything, 0], [Vector(3, {(1) = 1, (2) = 1, (3) = 1}), Vector(3, {(1) = 2, (2) = 1, (3) = 1}), Vector(3, {(1) = 3, (2) = 1, (3) = 0}), Vector(3, {(1) = 4, (2) = 1, (3) = 1})]))

(2)

``

`&x`(pt[1]-pt[3], pt[1]-pt[3]).(pt[4]-pt[3])

0

(3)

NULL

Download 2024-06-18_Q_4_points_projective_colinear.mw

I need help trying to remove some null elements from a listlist, that i converted from an Array. 

Example: I have a list of coordinates r:=[[1,2],[1,3]], which i converted to an array, and nulled the first element.

r:=convert(r,Array): 
r[1]:=NULL:
r:=convert(r,listlist):

I now have r=[[],[1,3]] after converting it back to a listlist. How do i remove the first element, which is an empty entry, such that i end up with r=[[1,3]]

Thanks 

Hello

I have a list N with i elements, for example N:=[7,2,4] with i = 3. From another list L I know, that all the elements of N are also elements of L, but I don't know if they are in the same order. For example:

In L1=[2,6,5,7,3,2,9,4] the elements are in the same order, but they are not in L1=[2,1,4,2,6,7,3,9]. 

How to write a program that can say wether the elements are in the correct order or not?

Thanks for your help!

I have a list as follows:
lst := [`A=70`, `B=17`, `C=27`, `D=37`, `E=74`, `F=57`, `G=67`, `H=08`, `I=81`, `J=28`, `K=38`, `L=48`, `M=58`, `N=68`, `O=90`, `P=19`, `Q=29`, `R=39`, `S=49`, `T=59`, `U=96`, `V=010`, `W=110`, `X=210`, `Y=310`, `Z=410`, "SPACE=105", "DOT=106"]

however using tt:=convert(lst, table) gives

tt:=table([1 = `A=70`, 2 = `B=17`, 3 = `C=27`, 4 = `D=37`, 5 = `E=74`, 6 = `F=57`, 7 = `G=67`, 9 = `I=81`, 8 = `H=08`, 11 = `K=38`, 10 = `J=28`, 13 = `M=58`, 12 = `L=48`, 15 = `O=90`, 14 = `N=68`, 18 = `R=39`, 19 = `S=49`, 16 = `P=19`, 17 = `Q=29`, 22 = `V=010`, 23 = `W=110`, 20 = `T=59`, 21 = `U=96`, 27 = "SPACE=105", 26 = `Z=410`, 25 = `Y=310`, 24 = `X=210`, 28 = "DOT=106"])

I want this to be such that I can retrieve the numerical value assigned to each alphabet e.g.
tt[A] should produce 70.


Hello everyone, I am working on a Maple code where I am dealing with a matrix X and performing several operations, so I can subsitute a set of lists. However, I feel Im doing some redundant things and I wonder if there are ways to make it more concise and efficient. More specifically,

  1. 'vals' and 'ecs' :
    'vals' gives me a set of lists with the values I'll use in matrix X , e.g., vals := {[-1, 1, 0], [0, -1, -1], [0, -1, 1]}.
    'ecs' creates a set of lists of equations that I can use in 'eval' (or 'subs') function, e.g., ecs := {[[X3_4 = -1, X3_3 = 1, X2_3 = 0]], [[X3_4 = 0, X3_3 = -1, X2_3 = -1]], [[X3_4 = 0, X3_3 = -1, X2_3 = 1]]}.
    But clearly, I'm getting an extra pair of brackets for each list so I will need to use double index in the eval command. Is there a way to avoid this?
  2. In the subsitution step, I've tried with both 'eval' and 'subs' and many modifications to avoid what I did in step 1 but without success. Also I need this extra 'Nelem' to get a list of indices so I can substitute all possible lists of values in 'ecs'.
  3. Finally, I'm wondering if what I'm getting from 'BoolEigs' is actually what I want. My final goal is to check if the eigenvalues of all possible solution matrices I got in 'Xs'  are nonnegative. So I need to avoid numerical computations and perform this step exactly. Is my code correct for this?
     
X := Matrix([[1, -X3_3/2 - 1/2, 0, -X2_3], [-X3_3/2 - 1/2, -2*X3_4 - 1, X2_3, 0], [0, X2_3, X3_3, X3_4], [-X2_3, 0, X3_4, 1]]);
vars := [X3_4, X3_3, X2_3];

w := A^3 - A;
rootz := RootOf(w, A);
Pols := [(-A^2 + 1)/(3*A^2 - 1), (-A^2 - 1)/(3*A^2 - 1), A*(3*A^2 - 1)*1/(3*A^2 - 1)];

vals := {allvalues(eval(Pols, A = rootz))};
ecs := map(x -> convert(vars = x, listofequations), vals);

Nelem := [seq(k, k = 1 .. numelems(vals))];
Xs := map(x -> eval(X, ecs[x][1]), Nelem);#double index for eval
Xz := map(x -> subs(ecs[x][1], X), Nelem);#same for subs

with(LinearAlgebra);
Eigs := map(x -> Eigenvalues(x), Xs);
BoolEigs := map(x -> map(y -> is(Im(y) = 0) and is(0 <= Re(evalf(y))), x), Eigs);
evalf(Eigs);

Hello

I could not come up with a better title, so I apologize for that.  Let me explain what I am trying to implement using an example. 

Consider the following list of monomials (a 3D model,  4 monomials altogether):

model := [x^2*y*alpha[1, 11], x*z^2*alpha[2, 15], y^2*z*alpha[3, 17] + y*z*alpha[3, 8]]

The idea is to generate the set of all models by adding a non-repetitive monomial from the following list to model.

[alpha[i, 0], alpha[i, 1]*x, alpha[i, 2]*y, alpha[i, 3]*z, alpha[i, 4]*x^2, alpha[i, 5]*y*x, alpha[i, 6]*z*x, alpha[i, 7]*y^2, alpha[i, 8]*z*y, alpha[i, 9]*z^2, alpha[i, 10]*x^3, alpha[i, 11]*y*x^2, alpha[i, 12]*z*x^2, alpha[i, 13]*y^2*x, alpha[i, 14]*z*y*x, alpha[i, 15]*z^2*x, alpha[i, 16]*y^3, alpha[i, 17]*z*y^2, alpha[i, 18]*z^2*y, alpha[i, 19]*z^3]

where i indicates the coordinate where the monomial will be included.  Example: if alpha[i, 2]*y is to be added to the second coordinate of model it goes as alpha[2,2]*y. Note that alpha[i, 15]*z^2*x cannot be added to coordinate 2 since it is already there.  

The result will be a list of 56 models with 5 monomials. 

How can I do that efficiently?  

Many thanks

Ed.

PS. I have implemented something similar to the problem above, but I have used too many 'for' loops. 

I have a very simple question:

How do I find the index of an list element.

For example to find 96 in the following list which is the 25th element.

R := [1, 2, 4, 8, 16, 32, 64, 31, 62, 27, 54, 11, 22, 44, 88, 79, 61, 25, 50, 3, 6, 12, 24, 48, 96, 95, 93, 89, 81, 65, 33, 66, 35, 70, 43, 86, 75, 53, 9, 18, 36, 72, 47, 94, 91, 85, 73, 49];
max(R);
                               96

So how to find 25 ?

Hi Maple friends,

Im new to Maple and Im struggeling with a problem.

I have the numbers of a bode plot (abs and phase) and I want to fit it in an equivalent circuit.

My problem is: I firstly want to calculate the real and imaginary part of the measured impedance of the bode plot (This works so far after a few hours of trying) and then I want wo calculate the values for each equivalent circuit component. For that I need the values of the impedance calculation to further process them.

The problem is: The impedance calculation returns the values as a list (I think). So Im wondering how can I get the values out of the list? My code so far is attached below.

Thanks in advance!

PS: Im sorry for the layout of the code. Im not sure how I can format the code right.

I am trying to give an input to an R program from an output the edge set of maple code 

Now how to Build a function which takes a list of edge sets as inputs and returns a list on the below format

Show I want for one edge set of the list

Now I have edge set of a Graph G say {{1,2},{2,3},{3,4},{4,5}}

Now want to pick the first values of each index make one set 

from<-c(1,2,3,4)

Similiarly first values of each index make one more set 

to<-c(2,3,4,5)

Then I want to form a list [from<-c(1,2,3,4),to<-c(2,3,4,5),ft <- cbind(from, to),Graph1<-ftM2graphNEL(ft)]

Now it will take second graph in the Edge list say {{1, 2}, {1, 7}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {6, 7}}

It will append to the previous list like

[from<-c(1,2,3,4),to<-c(2,3,4,5),ft <- cbind(from, to),Graph1<-ftM2graphNEL(ft),from<-c(1,1,2,3,4,5,6),to<-c(2,7,3,4,5,6,7),ft <- cbind(from, to),Graph2<-ftM2graphNEL(ft)]

This time Graph1 is changed to Graph2 to be observed.

Like that it will need  increase graph number based on the number of edge sets in the list of edges.

To be done all edge sets in list

As then I can copy the entire contents in the list and paste in R so that i can run 

As I can have 100 or more graphs done in maple doing for each of them manually typing may be difficult.

Kind help please

Your help will be surely Acknowledged 

Kind help

A toy code i simply tried for graph attached

But I have errors some come with double quotes can something be done if possible please guide

Kind help

As with 100 of lines it will easy to copy paste 

If the contents of the list can be written to txt file it would be helful 

please help

toy_try.mw

I have tried something to my knoewledge please help

Is it possible to use the ~ when using Matrix multiplications, where the second part of the operand are list elements?

The first part of the matrix multiplication remains unchanged, while the second one should be each element of the list.

The result should be a list of vectors / matrices again.

with(Units:-Simple)

alpha := 20*Unit('arcdeg')

20*Units:-Unit(arcdeg)

(1)

TransMatrix := Matrix([[cos(alpha), sin(alpha)], [-sin(alpha), cos(alpha)]])

Matrix(%id = 36893490153509525972)

(2)

pt := Vector(2, {(1) = -25.0, (2) = 0.})

Vector[column](%id = 36893490153504789076)

(3)

ptlist := [Vector(2, {(1) = -25.0, (2) = 0.}), Vector(2, {(1) = 25.0, (2) = 0.})]

[Vector[column](%id = 36893490153504761724), Vector[column](%id = 36893490153504761844)]

(4)

pt_trans := evalf(TransMatrix.pt)

Vector[column](%id = 36893490153514236012)

(5)

pl_translist := evalf(TransMatrix.ptlist)

Matrix(%id = 36893490153509525972).[Vector[column](%id = 36893490153504761724), Vector[column](%id = 36893490153504761844)]

(6)

TransMatrix.ptlist

Error, number of dimensions must be the same for all container objects in an elementwise operation

 

NULL

Download MatrixMultiplicate.mw

Is it correct that element wise operators just work on the first element, and not in nested elements?

Do I need to manually go through the nested lists, or are there any other tricks to simplify this operation?

fasteners := [Vector(2, {(1) = -25.0*Units:-Unit(mm), (2) = 0.}), Vector(2, {(1) = 25.0*Units:-Unit(mm), (2) = 0.})]

[Vector[column](%id = 36893490765018711092), Vector[column](%id = 36893490765018711212)]

(1)

`~`[convert](fasteners, unit_free)

[Vector[column](%id = 36893490764941411500), Vector[column](%id = 36893490764941411620)]

(2)

x := Vector(2, {(1) = -25.0*Units:-Unit(mm), (2) = 0.})

Vector[column](%id = 36893490765009212828)

(3)

`~`[convert](x, unit_free)

Vector[column](%id = 36893490764944766844)

(4)

NULL

Download elementwise.mw

Let L be a list like

L:=[[3, 2], [2, 1], [1, 2], [1, 2], [2, 3], [2, 1], [1, 2], [1, 1], [2, 1], [1, 2], [1, 1], [2, 1], [1, 1], [1, 3], [1, 2], [2, 1], [1, 3], [1, 3], [1, 3], [1, 2], [2, 2], [2, 3]]

Now we consider [3,1] and [1,3] as same 

First we form a list gives us 

Lk:=[[[1,3],4],[[1.2],11],[[2,3],3],[[2,2],1],[[1,1],3]]

That is [1,3] appears 4 times in L

[1,2] appears 11 times in L

[2,3] appears 3 times in L

[1,1] appears.3 times in L

[2,2] appears 1 times in L

now we do addtion in [1,3] which is 1+3=4 therefore [[1,3],4] become [4,4]

[2,2] becomes 2+2=4 therefore [[2,2],1] is [4,1]

[[1,2],11] become [3,11]

[[2,3],3] becomes [5,3]

[[1,1],3] becomes [2,3]

So new list is [[4,4],[3,11],[5,3],[2,3],[4,1]]

so answer is from [4,4] we get 4 *4 , from [3,11] we get 3*11 , from [5,3] we get 5*3 and from [2,3] we get 2*3 from [4,1] we get 4*1

final required answer is (4*4)*(3*11)*(5*3)*(2*3)*(4*1)  =190080

Any list L like above if given kind help with a function which can do the above operation and give the final answer that is in above case 190080

1 2 3 4 5 6 7 Last Page 1 of 9