4
votes
Accepted
Commutant of set of matrices
Take a random matrix:
n = 3;
M = RandomInteger[{-10, 10}, {n, n}]
(* {{9, 1, 8},
{-7, 8, -3},
{7, 10, -7}} *)
Build a matrix of unknowns:
...
2
votes
Accepted
Generalized scalar product for matrices
The elementwise difference of 2 matrices x,y can simply be written as: x-y.
The elementwise square of a matrix x is simply x^2
To add all elements of a matrix, you may use "Flatten" and &...
2
votes
Solving the system of equation with the expression of total differentiation using Cramer's rule
In Mathematica you cannot use superscript input, they are interpreted as powers. Pi is reserved as the numerical symbol of $\pi$, differentials are
...
2
votes
Accepted
How to explore the unchanged eigenvalue with the largest real part?
We can look up clusters of eigenvalues at different number of collocation points as follows
...
2
votes
Accepted
How to delete duplicate lists of vectors (in any order) from a list of lists?
You could just use Union:
Union[Sort /@ v]
You could also use DeleteDuplicatesBy:
...
2
votes
Accepted
How to define linear mappings on a vector space spanned by abstract symbols?
Linearity is defined as f[x_+y_]= f[x]+f[y] and f[lam x_] = lam f[x], where lam is a scalar. ...
2
votes
Accepted
How to find and delete the duplicates from lists of vectors
Since V 13.1 there is DeleteElements
...
1
vote
How to delete duplicate lists of vectors (in any order) from a list of lists?
Another way to do this using GatherByand Union:
...
1
vote
Simplify to vectors and matrices
One has to proceed cautiously because Mathematica accepts non-standard algebraic input with vectors and matrices, e.g a.b instead of a.Transpose[{b]] such that dimensions fit for the contraction ...
1
vote
Accepted
Gauss elimination with pivoting error
If I make the following smallest possible change to your code:
...
1
vote
Nullspace if denominator is zero
First of all, why do you just don't use Inverse[mat]? Like so:
...
1
vote
Transition to a new basis with rotation of one of the axes
You may write the given base in an orthonormal base like:
base = {{4, 0}, 2 {-Sin[30 Degree], Cos[30 Degree]}};
Then the vertices are:
...
1
vote
Generalized scalar product for matrices
Another method perhaps closer to the textbook could be: (Excuse the code formatting, it is deliberate)
...
1
vote
Accepted
What is mathematica command for finding eigenvalues of a generalized eigenvalue problem?
There are several typos in the code with matrix U,W definition. After cleaning, the code looks like this
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
linear-algebra × 1562matrix × 792
equation-solving × 204
eigenvalues × 157
performance-tuning × 104
numerics × 85
list-manipulation × 74
symbolic × 69
sparse-arrays × 66
mathematical-optimization × 62
plotting × 58
vector × 49
tensors × 46
calculus-and-analysis × 36
differential-equations × 35
functions × 31
algebraic-manipulation × 31
simplifying-expressions × 30
polynomials × 30
bugs × 26
inverse × 25
function-construction × 22
complex × 21
implementation-details × 20
warning-messages × 19