All Questions

Filter by
Sorted by
Tagged with
2
votes
1answer
45 views

How to grab two points from linear equations and from a matrix m.x == b for the purpose of creating lines or planes from each row.?

Don't get me wrong I can easily do it on paper and I could probably write convoluted code that will get the job done but I feel like there has to be an easy Mathematica way to do this. A few users on ...
1
vote
1answer
119 views

Determinant of 11x11 Matrix consumes immense amount of memory

I'm trying to take the determinant of an 11x11 matrix, constructed out of some functions I've defined ...
0
votes
0answers
49 views

Help in modifying my code

In my code, I want to plot (Dis[t]). The problem is some functions containing in the code do not work well if there are variables in the form of symbols, such as "Sort" "NMaximize" functions. I want ...
2
votes
3answers
67 views

Find minimum with matrix positive-definiteness constraint

Say I wish to find the minimum value of the determinant of a symmetric matrix under the condition that the matrix be positive definite. So I attempt: ...
0
votes
1answer
75 views

Maximize a six-dimensional function subject to joint positive-semidefiniteness constraints

I want to maximize Abs[a1 b1] + Abs[a2 b2] + Abs[a3 b3] subject to the joint constraints ...
6
votes
4answers
412 views

How to use genetic algorithm to calculate the maximum value of this matrix

1-9 the 9 numbers are arranged into 3 * 3 matrix without repetition.How to select the matrix with the largest determinant value: ...
3
votes
1answer
87 views

Proving the positive semidefiniteness of a 6X6 symbolic matrix

Specifically, I want to check the positive semidefiniteness of the following 6X6 symbolic matrix ...
11
votes
1answer
130 views

Minimizing expression over symmetric matrices

I'm trying to solve the following maximization problem over space of symmetric matrices A and positive definite H $$R=\max_{A\in S(R^d)}\frac{\text{tr}(HA)^2+2\text{tr}(HAHA)}{\text{tr}(AHA)}$$ So ...
3
votes
1answer
212 views

Solve the vector-matrix equation. Minimize the length of the desired n-dimensional vector

There is the following vector-matrix equation: $$\mathbf x^\top\mathbf M\mathbf x=\begin{bmatrix}x_1&x_2&x_3\end{bmatrix}\begin{bmatrix}a&b&c\\d&e&f\\g&h&i\end{bmatrix}...
1
vote
0answers
30 views

How to minimize the eigenvalues of a hermitian matrix?

Suppose I have a complex hermitian matrix, M[x_,y_] whose eigenvalues must be real.I tried to minimize the first eigenvalue by writing following command:f[x_,y_]:=Eigenvalues[M[x,y]][[1]]; Minimize[f[...
0
votes
1answer
53 views

How can I specify the region for every variable simultaneously in NMinimize?

I want to use NMinimize to find the unknown unitary matrix that solves a (possibly nonlinear) matrix equation. For example, the one that transforms the Pauli matrix ...
1
vote
3answers
102 views

Find k largest edges with unique nodes (kind of maximum weighted matching)

I have a weighted graph, and I am interested to find k largest edges with unique nodes. Currently, I do it in the following manner ...
3
votes
1answer
154 views

How to sort Matrix

I am on permutation project, and I have trouble with my result, the sequence of my result is not same with Permutations in Mathematica here the code ...
8
votes
5answers
899 views

Indicate minimal path sum

Described on the page: http://www.mathblog.dk/project-euler-81-find-the-minimal-path-sum-from-the-top-left-to-the-bottom-right-by-moving-right-and-down/ It is an example of the solution indicated in ...
3
votes
1answer
184 views

Find maximum of the norm of matrix

g = 0.9; H = {{g, I}, {I, -g}}; G = MatrixExp[t*H]; Plot[Norm[G], {t, 0, 20}, AspectRatio -> 1] FindMaxValue[Norm[G], {t, 1}] The matrix has a parameter t. ...
1
vote
0answers
114 views

Exponential Matrix Differentiation

I have been struggling with the following question while solving an optimization problem in $\mathbb{R}_{+}^G$. Basically, I have $$\min_{y \in \mathbb{R}_{+}^G} F(y) = y^{T}\mathcal{K} + \exp(-y^{T} \...
2
votes
1answer
154 views

How to improve the speed of NMaximize function

My problem is as follows: Consider a 5*5 matrix Obj with 0 and 1 Obj = Array[x, {5, 5}]; The objective function is: ...
3
votes
2answers
128 views

How to efficiently optimize a strictly increasing linear function over convex set

I am trying to minimize the trace of a symmetric matrix $B$ fulfilling $x^T A_i x \leq x^T B x \ \forall x \forall i$ for given (in general) indefinite symmetric matrices $A_i, i = 1, ..., n$. The ...
3
votes
1answer
56 views

Minimize matrix column totals

I would like to pick up n (2 in example) columns from matrix. The sum/total of these columns should be minimal. ...
17
votes
2answers
960 views

Differentiating functions of vectors/matrices?

I'm dealing with derivatives of scalar functions of matrices and wondering if Mathematica can help me here. The standard approach of expanding it in terms of components is cumbersome. As an ...
1
vote
1answer
52 views

Specific aggregation of matrix elements

Let us consider the matrix 'x1': x1 = {{1, 2, 3, m}, {4, 5, 6, n}, {7, 8, 9, o}, {10, 11, 12, o}} MatrixForm[x1] From the matrix 'x1' we compute the matrix 'x2':...
1
vote
1answer
647 views
0
votes
1answer
66 views

Finding a column from Max comparing each element of two columns; subsequent column used for backward calculation

I have lensp=21; rho=0.975; e1=0; pid= 0.5212; qid=0.4788; tid=10; based on my own calculations I have given vectors of dimension ...
3
votes
3answers
261 views

Defining a function for the construction of a bordered hessian

I think in Mathematica the omission of a function that can create a bordered matrix. This code works ...
0
votes
2answers
95 views

An optimization problem involving the calculation of `MatrixRank` as a constraint

I am dealing with an optimization problem that involves the rank of a matrix as a hard constraint. I am starting with this simple example ...
3
votes
1answer
68 views

An optimization problem involving the calculation of MatrixRank gets wrong

I was trying to solve an optimization problem involving rank of a matrix and experimenting with a very simple one. A 2x2 matrix which contains only one parameter a11...
2
votes
2answers
414 views

Need an efficient method for finding certain matrices

I am trying to write a function which produces square matrices with certain characteristics. The function should have two inputs: number of the rows, n number of ...
3
votes
1answer
368 views

Optimize a parametric matrix to get a lowest possible eigenvalue

This question is a followup of Plot the lowest eigenvalues of a parametric matrix Now I can get the lowest eigenvalue LowEign(t) of the matrix for a given t numerically. When I plot the LowEign ...
1
vote
2answers
625 views

Find the minimum element of a row of a matrix and its column index for each row

I am trying to find the minimum value of a row of a matrix and its corresponding column. Please run the code below. OptV is the matrix that I would like to create which must give the output of the ...
0
votes
1answer
824 views

Solving linear system with constraints

I need to come up with a solution for a rather, odd situation. Let's say I have an $M \times N$ matrix called ${\bf A}$, and I would like to solve it for ${\bf x}$ where $b_1 \le {\bf A} {\bf x} \le ...
5
votes
1answer
2k views

FindMaximum “is not a real number at” nrnum problem

I'm experiencing a problem using FindMaximum that I don't understand (due to my newbie knowledge of Mathematica's syntax). That is, FindMaximum sometimes returns a (correct) answer, but sometimes ...
1
vote
1answer
76 views

Count and NMinimize don't seem to work together

Initially I write down a 2x2 unitary (Uni) , make a tensor product 4 times (LocalUni) and apply it to an initial numerical matrix Rho, to obtain RhoLU, that depends on 12 parameters. This is my code: ...
1
vote
1answer
127 views

NMinimize error

I want to use NMinimize in the following way: ...
24
votes
2answers
1k views

Obtain approximate Hessian using FindMinimum

According to the documentation, when FindMinimum is told to use the method "QuasiNewton" on a unconstrained problem, it uses the ...
4
votes
2answers
870 views

Maximization in Mathematica using matrix and vector notation

I am trying to solve a simple maximization problem in Mathematica, using matrix and vector notation. ...
8
votes
2answers
859 views

Is there any fast way to solve a quadratic matrix equation in Mathematica approximately?

Let the square nonsingular matrix $M$ is a given convergent matrix. What are the best scalar values for $\alpha$ and $\beta$ (in the real numbers domain), at which the following quadratic matrix ...
1
vote
0answers
85 views

Which method to use for finding maximum without actually computing optimization function explicitly?

I am new to Mathematica and I am currently working on an optimization problem. The optimization function that I have easy to calculate for some assignment of variable but it is very difficult to ...
1
vote
1answer
183 views

Optimizing matrix inequalities over trace

I need to solve the following problem. Given $n \times n$ Hermitian matrices $A\geq 0$ and $B_1, ~ B_2$ (need not be positive semidefinite), with $Tr(AB_1)<0~,Tr(AB_2)<0$ construct a ...
1
vote
0answers
144 views

NMaximize with matrix input

I defined function f[x_, fixed_] := {...}. Here x is an $M\times N$ matrix. I want to maximize $f$ with respect to $x$. I have ...
3
votes
2answers
908 views

Optimization problem with matrix positivity constraints

Is it possible for Mathematica to parametrically find a local minimum of a given function (say of some variable $x$ where $(a,b,c)$ serve as parameters) subject to the constraint that a given ...
10
votes
3answers
1k views

How can I complete a correlation matrix with missing values?

I would like to complete a correlation matrix with missing entries, such that the resulting matrix is positive semi-definite. Say I want to find some x and some y in the next matrix that satisfy ...
3
votes
1answer
201 views

Decomposing a diagonal positive real matrix

I would like to 'decompose' a diagonal positive real matrix $E$ of rank $D$ onto $\sum_{i=1}^{D}c(i)N^i$: $$E = \left( \begin{array}{ccc} 0 & & & \\ & a & & \\ &...
4
votes
1answer
114 views

quadratic constraint feasibility

Suppose that $A$ is an $n \times n$ matrix, and I have observed some entries of $A$, say, $A_S$ ($A$ restricted on $S$) for some subset $S$ in $\{1,...,n\} \times \{1,...,n\}$. I want to know if it's ...
4
votes
2answers
874 views

Optimizing functions taking matrix arguments

I'm looking for general information on how to optimize matrix valued functions, I have the following function I'm looking to maximize (or figure out if this is possible at all). ...
2
votes
1answer
776 views

Minimizing a Matrix

...