New answers tagged matrix
1
vote
Symbolic scalar-by-matrix derivative
I tried the NCAlgebra package:
<< NC`;
<< NCAlgebra`;
SNC[X, A]
NCGrad[tr[tp[tp[X] ** A] ** (tp[X] ** A)], A]
And ...
4
votes
Accepted
Inverse of a matrix with symbolic variables
Replacing all machine-precision numbers by exact numbers:
...
0
votes
How to solve this equation of n-order matrix?
Does this work for you?
ident[i_, j_] := KroneckerDelta[i, j]
jmat[i_, j_] := 1
mmat[i_, j_] := (k - \[Lambda]) KroneckerDelta[i, j] + \[Lambda]
then:
...
4
votes
Timing for generating long matrix
This seems to produce the correct result and is much faster for small values of n.
...
4
votes
Accepted
Timing for generating long matrix
I suspect you only want to optimize the last line, i.e. I haven't bothered speeding up s. In what follows I'll use the first 1000 x 1000 submatrix to show some ...
0
votes
How to approximate a function using B-spline interpolation?
B splines are already built into MMA.
To expand Sin[x] over the region 0 o 2 Pi into B splines of degree d=3 we choose a basis of b splines with uniform knots at a distance of 1/(d+1):
...
8
votes
Accepted
How do I create and combine column matrices from lists
Mathematica uses the list for almost everything. You can think of a list as a row for now for purposes of making matrices.
So when you write ...
1
vote
Is there a way to apply a two-argument function to matrices?
Is the following application of MapThread with a level specification what you are looking for?
...
3
votes
How does NDSolve treat matrices?
An alternative to Indexed to deal with matrices is to prevent f from evaluating until a matrix value is substituted for ...
4
votes
How does NDSolve treat matrices?
I think that what you want to do with your broken code :
f[rho_,t_]:=Table[rho[[n,m]],{n,1,2},{m,1,2}]Cos[t]
is something similar to this code :
...
0
votes
How to Create an Efficient Word Square Algorithm?
I have created an algorithm that takes about 2.4 seconds to find the word squares for "hair" and 10.5 seconds for "dogs".
...
3
votes
NDSolve: there are more variables than equations, underdet
There are several typos in the code. First, initial data array probably should be in a form
...
4
votes
Accepted
Derivative of quadratic form in NCAlgebra
As noted in the documentation of NCGrad:
IMPORTANT: The expression returned by NCGrad is the transpose or the
adjoint of the standard gradient. This is done so ...
2
votes
Looking for a efficient way of solving a matrix which is function of some variable
Maybe you could use FindRoot? The trick is to know how to differentiate the determinant of a matrix, which is:
$$\frac{d \det (g(x))}{dx} = \det\left(g(x)\right) \
\...
1
vote
Accepted
Total Spin Matrix Squared (Casimir Operator)
Compute Dot[#,#] for each element # of the list and then sum up the results?!
...
1
vote
Looking for a efficient way of solving a matrix which is function of some variable
The type of dependence in f is critical here. For your example, it amounts to calculating a generalized eigenvalue.
...
6
votes
Invert a generic n x n matrix
Clear["Global`*"]
For the given example of DiagonalMatrix[n*Range[n]], the Inverse...
1
vote
Help with equation within adjacency matrix
You could use, for instance:
{i, j} = Transpose[List @@@ edges];
truedistance = scalefactor Sqrt[Total[Abs[coordinates[[i]]^2 - coordinates[[j]]^2], {2}]];
If you ...
2
votes
Accepted
Insert a dynamic vector into a matrix
Maybe like this:
NN = 3;
n = 6;
Flatten /@ (IdentityMatrix[n] /. 1-> Cs[NN])
0
votes
Insert a dynamic vector into a matrix
I think you need to minimally modify your code using Sequence in a ReplaceAll.
...
1
vote
0
votes
Test First row of matrix
I think it may be better to use something like Association, but since this question is from 2012, but Association is introduced ...
Top 50 recent answers are included
Related Tags
matrix × 3145linear-algebra × 726
list-manipulation × 622
performance-tuning × 215
equation-solving × 183
eigenvalues × 142
plotting × 129
functions × 111
sparse-arrays × 111
symbolic × 99
tensors × 86
vector × 80
array × 79
table × 77
graphs-and-networks × 65
replacement × 64
differential-equations × 62
mathematical-optimization × 60
random × 59
function-construction × 58
numerics × 58
simplifying-expressions × 57
calculus-and-analysis × 49
programming × 45
physics × 40