Items tagged with matrix matrix Tagged Items Feed

restart;
with(ArrayTools):
M1 := Matrix([[0, 0, b], [0, e, f]], order = Fortran_order);
row, col, var := SearchArray(M1);
M2 := Matrix([[0, 0, b], [0, e, f]], order = C_order);
row2, col2, var2 := SearchArray(M2);

I guess that's a bug.

Hi....how can i multiply the 9*4 matrix on the left side of this table to the 9*1 vector on the right side of it (last column) with a kind of product of cells that results a 9*4 matrix made up of cells like this one's [(a,b,c,d)⊗(e,f,g,h)=(ae,bf,cg,dh)]

can anyone help me please?

 

SO

ST

WO

WT

Weight

C1

(0.55,0.67,0.78,0.89)

(0.7,0.8,0.8,0.9)

(0.767,0.867,0.93,0.967)

(0.72,0.83,0.83,0.93)

(0.7,0.8,0.8,0.9)

C2

(0.67,0.78,0.89,0.97)

(0.8,0.9,1,1)

(0.73,0.83,0.867,0.93)

(0.66,0.76,0.79,0.90)

(0.8,0.9,1,1)

C3

(0.78,0.89,0.89,1)

(0.8,0.9,1,1)

(7.67,8.67,9.3,9.67)

(0.55,0.66,0.69,0.79)

(0.767,0.867,0.93,0.967)

C4

(0.78,0.89,0.89,1)

(0.06,0.13,0.167.0.267)

(0.8,0.9,1,1)

(0.76,0.86,0.90,0.97)

(0.43,0.53,0.567,0.667)

C5

(0.78,0.89,0.89,1)

(0.8,0.9,1,1)

(0.06,0.13,0.167.0.267)

(0.76,0.86,0.90,0.97)

(0.73,0.83,0.867,0.93)

C6

(0.74,0.85,0.93,1)

(0.67,0.767,0.83,0.9)

(0.73,0.83,0.867,0.93)

(0.62,0.72,0.83,0.90)

(0.8,0.9,1,1)

C7

(0.59,0.70,0.74,0.85)

(0.567,0.667,0.73,0.83)

(0.667,0.767,0.83,0.9)

(0.69,0.79,0.86,0.93)

(0.067,0.1,0.2,0.3)

C8

(0.74,0.85,0.93,1)

(0.7,0.8,0.9,0.93)

(0.567,0.667,0.73,0.83)

(0.79,0.90,0.97,1)

(0.73,0.83,0.867,0.93)

C9

(0.70,0.81,0.85,0.96)

(0.7,0.8,0.9,0.93)

(0.7,0.8,0.8,0.9)

(0.59,69,0.76,0.86)

(0.53,0.63,0.667,0.767)

what means the command that `linsolve` and 

when

a:=matrix([[a1,a2],[b1,b2]])

b:=vector([c1,c2])

c:=transpose(a)

linsolve(c&*a,c&*b)

&* <<--- what is it

 

 

My problem is the following; Let's say that I want to make a simple program of designing of a steel beam. In order to do so, there is a respectable number of parameters that have to be taken into account - forces, geometrical characteristics etc -. So for example, I have an excel file that has the following rows

1) A row of variables  :                          LENGTH   MOMENT_OF_INERTIA   AXIAL_FORCE    HEIGHT_OF_SECTION
 
2)A row of a value for each one variable :      5                556                       130                       300


the traditional approach in maple to intoduce these values to the program would be:

LENGTH:=5
MOMENT_OF_INERTIA:=556
AXIAL_FORCE:=130                etc etc

and then when for example we write

MOMENT_OF_INERTIA/LENGTH       we get

556/5=111.2

..but for problems like this the variables may be 50 in number, even more.. and it would be very timeconsuming to define all these parameters one by one..
so what I have been looking for so much these days is a predefined maple procedure - if there is one.. - that takes a matrix which we have created in advance and that includes all the names of the variables that we want to have in the problem - let's name it VARIABLES - takes as well a matrix that we also have created in advance and includes the value that we want each of our variables to get in the problem - let's name it VALUES - and make the correspondense automatically, so as to when we introduce an epression in maple thereafter, like     MOMENT_OF_INERTIA/LENGTH, when we press enter to get  556/5=111.2  (and not just a reproducing of what we already wrote , MOMENT_OF_INERTIA/LENGTH ..).. Do you think that there is an easy way to do so??

many thanks in advance!

 

Hello,

 

I would like to kow how I can remove the u2,1 and u3,1 from this matrix. I originally had it as a set of just  u2,1 and u3,1, but I converted it to a list, added the 1, because I needed it as the first value, and then converted it to a matrix. I now want to use the matrix for further calculations, but I dont know how to assign a name to it, and exlude the variable names within it.

I have attached the entire maple sheet, if you need some context. Also, if you see anything else that you think could be neater (I think I did a lot of things in a round-about way, because I haven't really used maple before), please let me know!

Earthquake_2.mw

Thanks in advance!

Raquel

 

 

Hi EveryOne!

In the the answer of the question "How to find roót of polynomial in finite field and extension finite field (at URL: http://www.mapleprimes.com/questions/203977-How-To-Find-Roots-Of-Polynomial-In-Finite#answer215097). Carl Love helped compute eigenvalues (x1,x2,...,xn)and eigenvectors of the given matrix M over GF(28)/(y^8+y^4+y^3+y+1).

I need to do:

1. Get matrix D from these eigenvalues (x1,x2,...,xn), with D[i,i] = xi and D[i,j≠i] = 0 (D will be diagonalizable matrix. Some xi may be in extension finite field  GF((28)2))

2. Get matrix P from eigenvectors corresponding to the above eigenvalues, compute P-1

3. Compute matrix B = P x D1/4 x P-1 in  extension finite field  GF((28)2).

Please help me!!! 

Hello,

I'm trying to define a matrix that will have all the possible game results in a 9 team competition in one round. The results are a column in the form [game 1 home team, game 1 away team, game 2 home team, ... , game 9 away team]

This should give me a matrix with 18 rows, and 512 columns, where each column is a possible game result.

In essense, to continue the pattern of this matrix on for all 512 columns.

I've fiddled with for statements, but it ends up getting very messy given the number of nests that are required.

Thoughts? Any help would be much appreciated,

Thanks, Alex, Australia.

 

 

 

 

 

 

Hey,

I've been trying to divide an equation into matrixes, with not a lot of luck.

Simple example:

A=2b remade into [A]=[2]*[b]

This is a basic overview of the problem, i need it to work with bigger matrixes.

Thank you in advance.

I’ve been having some issues working with large datasets / matrixes in maple 17.02 and 2015. My data consists of a 10^7 x 14 csv file with several lines of header information. Attached is a small sample. The ImportData assistant hangs while importing said file. The javaw process stops responding for a period of time then stops consuming cpu time. I’ve have successfully imported a file of the same format but reduced in size (10^6 x 14) with this same function. So I don’t believe it’s a formatting issue but rather its size.

Are there size limitations to the ImportData function?

The attached maple file has a test case in which the data set (sans header info) is created and exported as a csv file. The export time took longer than I expected (~2 hrs). I then attempted to import the file using two different functions. The ImportMatrix function successfully imported the test case file in approximately 20 minutes, however the ImportData functions seems to fail in the same way as it does importing my actual dataset. I haven’t successfully used the ImportMatrix function on my actual dataset; I’m assuming the header information is the source of the problem.

Are there other methods to import this data?

As stated above, I’m tried both maple 17 and 2015 both 64 bit versions running on an Intel i7 M620 @ 2.67Ghz, 8 GB ram (~ 6 GB avail), sata 2 ssd.

Thank you,

Ron

importtest.mw  Sample.txt

 

Dear friends! Hope you will be fine. I want to generate a general form of the matrix (of order 2M+1 by 2M+1) shown below in Maple

 

[[[0,0,&ctdot;,0,-1/(M Pi),0,&ctdot;,0,1/(M Pi)],[0,0,&ctdot;,0,-1/((M-1) Pi),0,&ctdot;,1/((M-1) Pi),0],[&vellip;,&vellip;,&dtdot;,&vellip;,&vellip;,&vellip;, &utdot;,&vellip;,&vellip;],[0,0,&ctdot;,0,-1/(Pi),1/(Pi),&ctdot;,0,0],[1/(Pi),1/(Pi),&ctdot;,1/(Pi),1,1/(Pi),&ctdot;,1/(Pi),1/(Pi)],[0,0,&ctdot;,1/(Pi),1/(Pi),0,&ctdot;,0,0],[&vellip;,&vellip;,&utdot;,&vellip;,&vellip;,&vellip;,&dtdot;,&vellip;,&vellip;],[0,1/((M-1) Pi),&ctdot;,0,1/((M-1) Pi),0,&ctdot;,0,0],[1/(M Pi),0,&ctdot;,0,1/(M Pi),0,&ctdot;,0,0]]]

for M=4 we get

Matrix(9, 9, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = -(1/4)/Pi, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = (1/4)/Pi, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = -(1/3)/Pi, (2, 6) = 0, (2, 7) = 0, (2, 8) = (1/3)/Pi, (2, 9) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = -(1/2)/Pi, (3, 6) = 0, (3, 7) = (1/2)/Pi, (3, 8) = 0, (3, 9) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = -1/Pi, (4, 6) = 1/Pi, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (5, 1) = 1/Pi, (5, 2) = 1/Pi, (5, 3) = 1/Pi, (5, 4) = 1/Pi, (5, 5) = 1, (5, 6) = 1/Pi, (5, 7) = 1/Pi, (5, 8) = 1/Pi, (5, 9) = 1/Pi, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 1/Pi, (6, 5) = 1/Pi, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (6, 9) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = (1/2)/Pi, (7, 4) = 0, (7, 5) = (1/2)/Pi, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (7, 9) = 0, (8, 1) = 0, (8, 2) = (1/3)/Pi, (8, 3) = 0, (8, 4) = 0, (8, 5) = (1/3)/Pi, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0, (8, 9) = 0, (9, 1) = (1/4)/Pi, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = (1/4)/Pi, (9, 6) = 0, (9, 7) = 0, (9, 8) = 0, (9, 9) = 0})

I want the general for of this matrix for any value of M

9_by_9.mw

I have a problem with IsMatrixShape. I have in my part of formulation this matrix expression: QTIbQ

While Ib is a symmetric matrix, this matrix expression is clearly symmetric. However, when I try to check this issue with IsMatrixShape command, it returns false. I am extremely confused. Can anyone help me? Thanks in advance.

I want to translate my maple code with matrice multiplication  to C code. But the command  "Multiply" cannot be translated. So I want to edit the function translation by myself. I use "AddFunction" command to create a new function  "Multiply" and want to specify its corresponding C code.

 


f := proc ()
local x,y;
x := Matrix([[1, 2], [3, 4]]);
y := Matrix([[1,3],[4,2]]);
Multiply(x, y);
NULL;
end proc;

LanguageDefinition:-Define("NewC", extend = "C", AddFunction("Multiply", [Matrix,Matrix]::Matrix,
proc (X, Y)
local a,b;
a := 2;
b := convert(a, string);
Printer:-Print("Mmultiply(", X);
Printer:-Print(",", Y, ")"); Printer:-Print("\n");
Printer:-Print("from", b, "to");
Printer:-Print(",", Y, "do") end proc, numeric = double));
Translate(f, language = "NewC")

 

But when I run it, the "Multiply" function cannot be translated.  The result is:

 

Warning, type signature [CodeGeneration:-Names:-ArrayType(integer,CodeGeneration:-Names:-ArrayRanges(1 .. 2,1 .. 2),CodeGeneration:-Names:-ArrayOptions()), CodeGeneration:-Names:-ArrayType(integer,CodeGeneration:-Names:-ArrayRanges(1 .. 2,1 .. 2),CodeGeneration:-Names:-ArrayOptions())] for function Multiply is not recognized
void f (void)
{
  int x[2][2];
  int y[2][2];
  x[0][0] = 1;
  x[0][1] = 2;
  x[1][0] = 3;
  x[1][1] = 4;
  y[0][0] = 1;
  y[0][1] = 3;
  y[1][0] = 4;
  y[1][1] = 2;
  Multiply(x, y);
  ;
}

I don't know why "Multiply(x,y)" cannot be translated.

If I put two "Multiply(x, y)" in the procedure, like this:


f := proc ()
local x,y;

Multiply(x, y);
x := Matrix([[1, 2], [3, 4]]);
y := Matrix([[1,3],[4,2]]);
Multiply(x, y);
NULL;
end proc;

LanguageDefinition:-Define("NewC", extend = "C", AddFunction("Multiply", [Matrix,Matrix]::Matrix,
proc (X, Y)
local a;
a := 2;
b := convert(a, string);
Printer:-Print("Mmultiply(", X);
Printer:-Print(",", Y, ")"); Printer:-Print("\n");
Printer:-Print("from", b, "to");
Printer:-Print(",", Y, "do") end proc, numeric = double));
Translate(f, language = "NewC")

THe result is:

Warning, cannot resolve types, reassigning x's type
Warning, cannot resolve types, reassigning y's type
Error, (in CodeGeneration:-IssueError) type 'Matrix' cannot be translated to target language

I don't know why type 'Matrix' cannot be translated.

 

 

Hello!

I performed a calculation where the output was a matrix that Maple said was too big to display explicitly. So, this output was just a summary. Specifically, something like this:

 

 

How can I save/export the data inside it to another matrix so that I can manipulate it while staying within Maple?

 

I can export to an external file using

and then reimport the data back into Maple. But this is cumbersome.

I can also see the data on my screen by double-clicking on the matrix. But I haven't been able to manage to copy & paste it within Maple or transfer it to another matrix so I can manipulate the data. How do I do this? I'd like to stay within Maple to avoid the hassle of exporting data to Excel & then reimporting it.

Thanks,

Damian.

Hi

I am trying to optimize a 39, 1 MATLAB matrix, but cannot seem to get a result beyond a 6, 1 matrix. I am getting "Warning, cannot resolve types, reassigning t##'s type" where t## varies from each time I run it, and can show multiple of these warnings. It also says "Warning, cannot translate list".

 

I found a pretty similar problem posted here earlier, where the user "Carl Love" suggested to replace a command from the original code with

Matlab(
     subsop([-1,1]= J, eval([codegen:-optimize](tmp, tryhard), pow= `^`)),
     output = string, defaulttype = numeric
);

 

I was wondering what exactly this command does? Can I apply it to my code to solve my problem? It yielded a result that looks (on the surface) as an optimized code, but I don't feel completely comfortable using it without being certain.

What I have done is simply to replace Matlab(tmp, optimize) with the suggested code above. My code is attached. Thanks in advance for any help.

OptiMatrix.mw

Hello,

I have 20 by 20 matrix (with only two symbolic components, say a and b), other entries of the matrix are either populated with zeros or real numbers. I am trying to obtain the inverse.

 

All the command I have tried returned an error message. In particular M^(-1) yields:

Error, (in radnormal/ifactors) too many levels of recursion.

 

I would appreciate any suggestion that could solve this issue. Thank you

 

ps: I am essentially trying to solve Ax=b. The commands within LinearAlgebra all yielded similar error messages.

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