Questions on the manipulation of matrices in Mathematica.

learn more… | top users | synonyms (1)

0
votes
2answers
156 views

Eigenvector Anomaly

I'm trying to compute the eigenvectors for: $$ M = \left( \begin{array}{ccc} 1 & 4 \\ 4 & 100 \end{array} \right) $$ Both myself and Mathematica report the eigenvalues as: $$ \lambda_1 = ...
1
vote
0answers
79 views

What is the fastest way to obtain the eigenvalues of a Wishart matrix?

I would like a fast method of creating a sample of random numbers which corresponds to the eigenvalues of a Wishart matrix: For M>N the eigenvalues \lambda_i are given by the jpd Where $K_N$ is ...
0
votes
1answer
88 views

How do I apply a rule to every element in a matrix? [closed]

I need to apply a set of rules (I used Which) to every element in a matrix, but the rules are dependent on the position [[i, j]] ...
0
votes
3answers
157 views

Padding of matrix

I want to do padding of matrix a = {{x,x},{x,u}}; to ...
1
vote
2answers
131 views

Manipulating sparse array elements

Suppose I have two sparse arrays ...
0
votes
1answer
437 views

How to find the inverse a symbolic matrix that Mathematica thinks might be singular

I have a square matrix depending on a parameter "a". When "a" has a numeric value (eg 2.1 * 10 ^ 8) through the inverse function Inverse[] I can invert the matrix. If I write the matrix as a function ...
3
votes
2answers
121 views

How to convert multidimensional matrix into regular matrix?

I have this multidimensional matrix: {{{{a1, a2}, {a3, a4}}, {{b1, b2}, {b3, b4}}}, {{{c1, c2}, {c3, c4}}, {{d1, d2}, {d3, d4}}}} I would like to convert it into ...
0
votes
0answers
140 views

Speeding up inversion of symbolic matrices by invoking caching

Is it possible to reduce the computation time taken to find inverse of symbolic matrices USING CACHING TECHNIQUES accessible (if any)? I am trying to compute inverse of symbolic matrices of size ...
4
votes
1answer
104 views

Computing Smith Normal form of a matrix with mod p coefficients

I would like to compute the Smith Normal form of a matrix with coefficients in GF(p). In particular, I am interested in GF(2). I have used the Smith normal form packages for integer and polynomial ...
10
votes
1answer
195 views

Drop selection of columns from a ragged array

I have an application where I need to drop some arbitrary list of columns from a ragged array (where of course the shortest array rows have at least all the specified columns). E.g., given a ragged ...
9
votes
8answers
340 views

Fast way to get positions of “boxed” array elements?

Given a 2D array (arbitrary numeric / evaluates to numeric elements, simplified for examples, and can be arbitrary dimensions so long as the operation makes sense, I'm working with 2K X 2K in my ...
1
vote
1answer
280 views

How to obtain the orthogonal matrix that diagonalize a symmetric matrix [closed]

I have a real symmetric matrix H which is in symbolic form, I need a matrix P that can diagonalize H; also P is orthogonal and its columns are the eigenvectors of H. How can I doing this in ...
13
votes
1answer
432 views

Block Matrix Algebra with Mathematica

I have come up with some BlockMatrix Algebra for Mathematica to make notations easier. I have the following: ...
1
vote
1answer
92 views

Extracting Imported Information

What I want to do is to compare the relationship between the consumption of say beer and wine using scatter plots where each point designates the particular country (preferably named). I have tried to ...
0
votes
2answers
119 views

Replace matrix with conditions

I want to replace the values of 1. in slot under the condition that the year and month in basevalue and ...
0
votes
0answers
42 views

How do you explicitly define Box Operator (D'Alembert operator)? [duplicate]

I wanted to see how one can define a box operator in mathematica? $$ \Box\phi=(-\frac{\partial^{2}}{\partial t^{2}}+\frac{\partial^{2}}{\partial x^{2}}+\frac{\partial^{2}}{\partial ...
1
vote
0answers
72 views

Define inverse for the custom operator

I want to define simple matrix algebra (inspired by the following posts: Block Matrix Algebra with Mathematica ; How to define custom operators ). I assume the funtion ...
1
vote
1answer
284 views

How can you convert a matrix back into a list of lists?

It is very simple in Mathematica to convert a list of lists into a matrix: all you need to do is apply the //MatrixForm function to it and voila. Is it possible ...
0
votes
3answers
137 views

Implementing nested subtotals

Inserting a nested subtotal in a spreadsheet is a facility that Excel performs very well. But if a subset of this facility can be implemented in MMA for a table which needs it the hassle of its ...
2
votes
1answer
576 views

Contracting with Levi-Civita (totally antisymmetric) tensor

I have an array $v_{ijk}$ which is effectively a rank-$3$ tensor with dimensions $3\times3\times3$, and I need to contract it with $e^{ijk}$, i.e. evaluate $v_{ijk} e^{ijk}$ (see Einstein ...
0
votes
1answer
131 views

Applying a general formula

We are a group of students who are struggling with transforming this formula to run in mathematica. In fact there are many formulas that we are struggling with, but if we are able to see how this is ...
1
vote
1answer
184 views

How Manipulating a matrix and a graphic in only one Manipulate? [closed]

I have to manipulate a matrix and graphics in one big Manipulate-Block. This way: Manipulate[Matrixform[mat],Graphics3D[]] How can I achieve that? Ok, here my ...
35
votes
3answers
1k views

Tiling a square

I wondered if there was a way to automate the process of finding a way to tile a tile into a square. The idea is to represent the tile with a matrix of $0$s for blank space and $1$s for filled spaces ...
0
votes
2answers
95 views

How can I adjust matrices into the same ItemSize and aligned well in Notebook?

I typed three matrices, but they are not aligned well, and the Items in one matrix are also not aligned well and with differenct ...
2
votes
3answers
143 views

Join matrix based on conditions

Given the following matrix: ...
1
vote
3answers
156 views

Conditional Check on Matrix

Suppose I have the following matrix (i,j): ...
0
votes
0answers
79 views

Back Linear Substitution

I have an equation set Ax=b and A(n*m),n<m . To lower down the dimension, I express some vars by other vars, which gives ...
0
votes
0answers
55 views

eigenvalues and eigenvectors without Root answers

I'd like to find eigen values and vectors of parametric 21*21 Matrix and i cant solve the root problem.please help me to find the answers without Root. My Matrix is: ...
0
votes
0answers
23 views

Jacobian matrix formation from polynomial expressions [duplicate]

I want to find the jacobian matrix for 3 polynomial expression with 3 variables.. the polynomial expressions have the degree of 8.how to form it.?
-1
votes
1answer
105 views

Solve set of non linear differential equations [closed]

I have set of differential equations. For example, I took two equations and tried to solve them as below. I am not getting any results. Please help me to figure it out the mistake. And I wonder if I ...
0
votes
1answer
117 views

Why Eigenvalues thinks matrices are non-numerical

I use Mathematica version 9.0.1. ...
5
votes
3answers
273 views

Question about Map and Total

Suppose I have a list and I want to generate a new list, such that $$ NewList[index] = \sum_{index \neq j}^{NumOfElts} \frac {1}{ \lvert OldList[index]-OldList[j] \rvert ^2 } $$ Can I do it using ...
0
votes
1answer
188 views

Extracting coefficients from multiple equations and generating coefficient matrix

after 6 hours reading about string patterns, string manipulations and trying ..and trying..I officially give up (for now) and ask for some help. I have some unorderly equations you will find here ...
0
votes
1answer
65 views

Produce a 1-dimensional list of all unique matrix elements

We have some symbolic matrix m, e.g. m={{1, x, 4 x + y},{0, x y + 4x, 4x},{7 x, x, 4x + x y}} and we want to produce as output a list of all the unique elements ...
0
votes
2answers
120 views

How to display output as symbols?

I have this piece of code which populates a matrix following different rules depending on row and column number: ...
0
votes
2answers
109 views

Define a function on a parameter argument set to zero

Say I have an expression (matrix) that depends on several variables. f= {{a, b+c},{2a-b^2,c^5+a b}} I want to define new matrices with the single parameter ...
0
votes
0answers
47 views

Differential curve geometry Frenet Formula [duplicate]

I am using Mathematica for differential geometry studies using Frenet Formulae. The problem is that I need to graph the solution curve r[t]. Suppose the curvature of a curve is k(s) = |s|and the ...
0
votes
1answer
52 views

Function output of two lists are only diagonal elements

I'm having a little crysis over here. What I basically want to do is some sort of 3D-Plot, but I'm only interested in the resulting values. I have two vectors x and p: ...
0
votes
1answer
182 views

Symbolic matrix simplification and solving

I am trying to expand or solve an equation that contains matrices for a certain matrix, but it is not working: ...
0
votes
0answers
52 views

How do I interpret the Roots syntax when I am finding the eigenvalues of a matrix [duplicate]

Here is an example of my problem: I am somewhat confused by the syntax of this. I am guessing that the #1 is specifying the start of another root? Why then does one of the roots = u + with nothing ...
0
votes
1answer
97 views

How to faster map density matrix element to make differential equations

I have a time dependent matrix $M(t)$ of $L^n \times L^n$ size and want to write differential equations like D[M[i,j][t],t] = H[i,j][t] Here is my code: ...
-2
votes
1answer
69 views

I need to calculate sin[x] series summation for sin[A] where A is a 3X3 matrix

I am evaluating $\sin(A)$ where $A$ is a $3\times 3$ matrix. I have calculated it but now I want to check this with a Taylor series expansion of Sin[x]. What I am ...
3
votes
0answers
123 views

Discriminant of Characteristic Polynomial

I'm doing a calculation which finds the characteristic polynomial of a matrix with rather complex entries and then determines the discriminant of that polynomial. For smaller matrices up to around 7x7 ...
1
vote
1answer
95 views

How to place a matrix under controls (sliders) in a Manipulate?

I want to know how I can place a matrix under my sliders. Here is my code: ...
3
votes
1answer
175 views

Is there any faster way than Eigensystem to diagonalize a Hermitian matrix?

Is there any faster way than using "Eigensystem" to diagonalize(get all the eigenvectors and eigenvalues) of a Hermitian(self-adjoint) matrix? That would be amazing :). Thanks.
6
votes
4answers
269 views

Counting adjacent elements in a Matrix?

To start, I have a situation where I have some matrix, for example $$ A=\left[ \begin{matrix} 4&2&2&3&3\\ 2&3&1&2&3\\ 3&0&4&0&4\\ ...
1
vote
2answers
201 views

Fast randomization of a graph, while keeping the graph connected

I'm looking for a very efficient method for randomizing graph of a given size (N nodes, L links), but keeping them connected. Assume you have the adjacency matrix A of a given connected graph. You ...
0
votes
1answer
72 views

Solving symbolic matrix equation

I have this equation, $$f(x)=Ax-diag(x)(Ax+b)$$, where $x\in \mathbb{R}^n$, $A\in \mathbb{R}^{n\times n}$ and $b\in \mathbb{R}^n$, for which I need to find the zeros. $x=0$ is an obvious solution, ...
6
votes
4answers
534 views

Check if a matrix is Positive Semidefinite

I have a question concerning the check whether a given matrix is positive semidefinite or not. In mathematica the function PositiveDefiniteMatrixQ[m] tells me ...