Items tagged with table

Feed
Also available: table

I want write function get value a1, a2, ..., an to b1, b2, ..., bn.

Example get 1, 3, -9, 5 to a, b, c, d. This is my code

myfunc := proc(oldVars,newVars)

    local i;

    if nops(oldVars) = nops(newVars) then

        for i from 1 to nops(newVars) do

            newVars[i] := oldVars[i];

        end;

    fi;

end proc:

But not work! Can someone help me. Thank you very much

I'm sorry if this sounds like a noob question. I am trying to make a matrix from a table, something like Gauss-Jordan Elimination tutor.

For example

maplet1 := Maplet([BoxCell(Table([A, B], [[1, 2], [3, 4]]), 'as_needed'), Button("OK", Shutdown())]);

How do I turn it to 2x2 matrix?Any help appreciated

Hello! 

I want to generate a table in maple, but with generic content. For example, in Mathematica you can do this using 

table=Table[0,{n=10},{m=2}];
 

and this generates a table with 2 columns and 10 rows with zeros in all its elements. I want to do this exactly but in maple. 

Thanks for your time! 

Hi everybody

I have two tables, namely A and B, the entries of wich can also be tables ... and so on.
These two tables have the same structure in the following sense :

Viewing A or B as tree graphs GA and GB :

  1.  the set of the names of the vertices of GA is identical to the set of the names of the vertices of GB
  2. GA and GB have the same connectivities

For instance A and B below share the same structure
A := table([x=table([u=1]), y=table([v=table([p=2]), w=3]) )]
B := table([ x=table([u=4]), y=table([v=table([p=12]), w=3]) )]

But not do A and C
C := table([x=table([u=1]), y=table(v=2, w=3]) )]


Let p(s) some path in GA from its root to some terminal leaf s.
B being "structurally identical" to A, GB also contains p(s)
Returning to the original tables, p(s) corresponds to a multi-index [k1][k2]...[kn] and the "value" of s is then given by A [k1][k2]...[kn]) or, symbolically A[p(s)]

I adopt this definition for "A = B" :
A is said to be equal to B iif the entry of A[p(s)] equals B[p(s)] for all the terminal leaves s
(here equals is intended in the "classical" senses, ie 3=3, {1,2}={2,1}, ...)
 

How can I check if "A=B" in the following sense ?

Thanks in advance

PS : Keeping in mind the analogy between A and GA, I have written a recursive procedure to check if A=B. But it is rather lengthy and I wondered if there could exist some Maple function to do this test ?


 

Hi All,

I seem to have problems with the table formatting in Maple TA 2016, concretely changing the cell padding has no effect. Is this a general issue ? I don't have this problem in Maple TA 10 (I tried both versions using the same browser (Safari)).

 

Thanks!

Elisabeth

Hello,

In the creation of package wrapping some procedures, may you tell me the differences between using a table or a module so as to wrap the procedures ?

In my case, it seems to me that table is more convenient since I can create with table packages while keeping my program with a structure of section, subsection, ...

But, I'm a beginner in the use of packages. Consequently, I'm very interested in your opinions on this question.

Thanks a lot for your help

 

``

restart

``

``

(1)

``

interface(displayprecision = 4)

-1

(2)

(3)

NULL

``

Vert_Coef := Matrix(10, 5, {(1, 1) = 0.332e-1, (1, 2) = 0.187e-1, (1, 3) = 0.104e-1, (1, 4) = 0.52e-2, (1, 5) = 0.21e-2, (2, 1) = 0.509e-1, (2, 2) = 0.301e-1, (2, 3) = 0.166e-1, (2, 4) = 0.83e-2, (2, 5) = 0.31e-2, (3, 1) = 0.571e-1, (3, 2) = 0.364e-1, (3, 3) = 0.218e-1, (3, 4) = 0.104e-1, (3, 5) = 0.42e-2, (4, 1) = 0.582e-1, (4, 2) = 0.405e-1, (4, 3) = 0.260e-1, (4, 4) = 0.125e-1, (4, 5) = 0.42e-2, (5, 1) = 0.582e-1, (5, 2) = 0.416e-1, (5, 3) = 0.270e-1, (5, 4) = 0.135e-1, (5, 5) = 0.52e-2, (6, 1) = 0.582e-1, (6, 2) = 0.416e-1, (6, 3) = 0.281e-1, (6, 4) = 0.145e-1, (6, 5) = 0.52e-2, (7, 1) = 0.582e-1, (7, 2) = 0.416e-1, (7, 3) = 0.291e-1, (7, 4) = 0.166e-1, (7, 5) = 0.62e-2, (8, 1) = 0.582e-1, (8, 2) = 0.416e-1, (8, 3) = 0.301e-1, (8, 4) = 0.177e-1, (8, 5) = 0.62e-2, (9, 1) = 0.582e-1, (9, 2) = 0.416e-1, (9, 3) = 0.301e-1, (9, 4) = 0.187e-1, (9, 5) = 0.73e-2, (10, 1) = 0.582e-1, (10, 2) = 0.416e-1, (10, 3) = 0.301e-1, (10, 4) = 0.197e-1, (10, 5) = 0.83e-2})

Matrix(10, 5, {(1, 1) = 0.332e-1, (1, 2) = 0.187e-1, (1, 3) = 0.104e-1, (1, 4) = 0.52e-2, (1, 5) = 0.21e-2, (2, 1) = 0.509e-1, (2, 2) = 0.301e-1, (2, 3) = 0.166e-1, (2, 4) = 0.83e-2, (2, 5) = 0.31e-2, (3, 1) = 0.571e-1, (3, 2) = 0.364e-1, (3, 3) = 0.218e-1, (3, 4) = 0.104e-1, (3, 5) = 0.42e-2, (4, 1) = 0.582e-1, (4, 2) = 0.405e-1, (4, 3) = 0.260e-1, (4, 4) = 0.125e-1, (4, 5) = 0.42e-2, (5, 1) = 0.582e-1, (5, 2) = 0.416e-1, (5, 3) = 0.270e-1, (5, 4) = 0.135e-1, (5, 5) = 0.52e-2, (6, 1) = 0.582e-1, (6, 2) = 0.416e-1, (6, 3) = 0.281e-1, (6, 4) = 0.145e-1, (6, 5) = 0.52e-2, (7, 1) = 0.582e-1, (7, 2) = 0.416e-1, (7, 3) = 0.291e-1, (7, 4) = 0.166e-1, (7, 5) = 0.62e-2, (8, 1) = 0.582e-1, (8, 2) = 0.416e-1, (8, 3) = 0.301e-1, (8, 4) = 0.177e-1, (8, 5) = 0.62e-2, (9, 1) = 0.582e-1, (9, 2) = 0.416e-1, (9, 3) = 0.301e-1, (9, 4) = 0.187e-1, (9, 5) = 0.73e-2, (10, 1) = 0.582e-1, (10, 2) = 0.416e-1, (10, 3) = 0.301e-1, (10, 4) = 0.197e-1, (10, 5) = 0.83e-2})

(4)

``

``

whattype(Vert_Coef)

Matrix

(5)

``

NULL

``

``

``

``

SR := Vector([10.8696, 21.7391, 32.6087, 43.4783, 46.7391, 54.3478, 65.2174, 76.0870, 86.9565, 100.0000], datatype = float)

Vector(10, {(1) = 10.8696, (2) = 21.7391, (3) = 32.6087, (4) = 43.4783, (5) = 46.7391, (6) = 54.3478, (7) = 65.2174, (8) = 76.0870, (9) = 86.9565, (10) = 100.0000})

(6)

E_G := Vector([250, 500, 1000, 2500, 10000], datatype = float)

Vector(5, {(1) = 250.0000, (2) = 500.0000, (3) = 1000.0000, (4) = 2500.0000, (5) = 10000.0000})

(7)

``

``NULL

NULL

``

NULL

``

B_interp := proc (SR, E_G) options operator, arrow; CurveFitting:-ArrayInterpolation([SR, E_G], Vert_Coef, Array(1 .. 1, 1 .. 1, 1 .. 2, [[[SR, E_G]]]), method = linear) end proc

proc (SR, E_G) options operator, arrow; CurveFitting:-ArrayInterpolation([SR, E_G], Vert_Coef, Array(1 .. 1, 1 .. 1, 1 .. 2, [[[SR, E_G]]]), method = linear) end proc

(8)

``

``

f[18*_1] := B_interp(25.0, 1500.0)

Error, (in CurveFitting:-ArrayInterpolation) invalid input: dimensions of independent data do not match the dimensions of dependent data

 

 

Download Matrix_Interpolation.mw

Hello Mapleprime Community,

Would you be kind to help me with the attached Maple worksheet. My goal is to do a 2D interpolation given the value of SR (slenderness ratio) and E_G (Young's modulus / Shear modulus ratio) in the Matrix table Vert_Coeff with header as vector E_G and the other as vector SR. I’m confused as to how to do the interpolation. Please help.

 

Regards,

 

Moses

I would like to extrapolate some values from a table:

What I have now is something like this: 

table [
(1,100)=1,
(1,200)=12,
(2,300)=33,
(3,100)=1,
(1,300)=43,
(3,200)=52,
(2,100)=31,
(2,200)=22,
(3,300)=3,
(4,...)=...]

I would like to have a table with the same value in the first position with changing the second value, for example:

table[
(2,100)=31,
(2,200)=22,
(2,300)=33,
(2,...)=..]


How can I do it?

Hello,

I try to simplify a system of 6 trigonometric equations and then to extract the 3 first equations.

When I conduct my calculations, It seems that that I have some troubles with some index.

There is a term with "table" which is not evaluated.

Do you have ideas why the last equations in my code have a table inside and consequently can not be evaluated?

I attached my code

example.mw

Thank you for your help.

 

 

Hi,

I'm not sure that I mean datatable component corectly.

I also consider that I was done somthing wrong

Thank you for advanced for any help.

restart

with(DocumentTools):

Oryginaly DataTable was inserted as a 3 x 3. I will traing to push maple to obtain 4 x 4 with specific row and column name.

``

SetProperty("DataTable0", visibleRows, 4);

DocumentTools:-SetProperty("DataTable0", visibleColumns, 4);

DocumentTools:-SetProperty("DataTable0", columnWidths, [20, 40, 80, 80]);

DocumentTools:-SetProperty("DataTable0", rowNames, [r1, r2, r3, r4]);

DocumentTools:-SetProperty("DataTable0", columnNames, [c1, c2, c3, c4]);

DocumentTools:-SetProperty("DataTable0", update)

``

``

``


wzel

Download datatable_problem.mw

I have use a ''for cycle'' in order to get a series of points. I would like to save those points in a vector in order to use it for the ''PolynomialFit'' comand. The problem is that the points that I save are sort randomly. How can I take the value of the vector A in the right sequence? in the underline string you can plot the walue of A over t (which is not sorted). I can not use the sort command as I used for t even for A because the points are not increasing.

This is my code:

restart;

Atot := 0:

for ii from 0 by 0.01 to 2 do

PtotFkt := ii->  ii^2 :

Ptot := PtotFkt(ii):

Atot := Atot+0.01*Ptot:

A[ii] := Atot: #Save points in a Table

t[ii] := ii: #Save point in a table

end do;

AV := convert(A, list): #conversion from table to list
nops(AV);  #number of points

timme := convert(t, list): #conversion from table to list
nops(timme); #number of points

 

with(Statistics); #PolynomialFit

X := Vector(AV, datatype = float);

Y := Vector(sort(timme), datatype = float);

plot(Y, X, style = point, symbol = asterisk, color = blue);

regress := PolynomialFit(10, X, Y, time);

curve1 := plot(regress, time = 0 .. 2);

As an exercise, I'm trying to replicate the table shown at the end of section 10.3 (Creating Embedded Components) of the Maple User Manual, the table on page 308 of the PDF, reproduced here:

I create a 6 x 3 table, and merge cells of columns 1 and 2 in each of rows 1, 2, 5 and 6, and proceed to enter the text and components from the Embedded Components example 2 to look as above. In column 3, I merge the cells in rows 2, 3, 4, 5 in order to place the plot component as shown. The new cell seems to be considered as in the same row as its top merged cell, in this case, row 2.

I can't control vertical positioning in the plot cell in column 3. If I select the vertical alignment for the plot cell (which sets the same vertical alignment for all of row 2), to Centre or Bottom or Baseline, the alignment is to the centre or bottom or baseline of row 2, not of the plot cell. So when I paste the plot into the cell it extends up from the Centre or Bottom or Baseline of row 2, to well above the table's top border.

If instead I set the vertical alignment to Top, then the pasted plot fits into the cell since the top of the plot now aligns with the top of row 2. But that can be an annoying restriction. Also, I am no longer allowed to set the vertical alignment in rows 3, 4 or 5 because of the merged cell in column 3.

Maple document tables need to have two improvements:

  1. The ability to adjust vertical centring in a single cell (merged or not), instead of just across a row.
  2. The ability to resize row height. Currently it looks like document tables only allow resizing column width.

I guess my question is mainly, is there a better way to go about setting up a document table in order to control fairly precisely how it appears? And to get around some of these formatting restrictions?

 

Hi everyone,

I would like to create an eBook with the pakage "eBookTools", but I have got several errors if in my mw document there is a table. The same error came out if I try to compile a book with the sample documents ("GettingStartedWithMaple.mw"). Anyone knows a solution?

Thank you for your time

 

Giorgio

VIM.3.mwHi,How do I make a graph and error table for exact and by using this method i.e VIM 

I would like to get some sort of table (maybe also a plot) that shows me the effect on the function if I change a variable.

For example, I have f(x,y,z)=x+yz

Now I would like to get a list with the results for f if I run z from, say, -10 to +10.

Is it also possible to do this with all variables at the same time?

1 2 3 4 5 Page 1 of 5