# Tag Info

0

I believe it can be done with a semidefinite program by adding a multiplicative slack variable. Basically, $$\begin{array}{rcl} \min\limits_{A \in \mathbb{R}^{n \times n}, P\in \mathbb{R}^{n\times n}} &&f(A)\\ \text{st} && b I \preceq PA + A^TP \preceq a I\\ && P \succ 0 \end{array}$$ Essentially, this is the Lyapunov stability ...

3

Test your code. "I don't know if my linear algebra routines work or not" is a problem you can solve easily. It is easy to check if you have computed the correct eigenvalues or not; just check that $VDV^{-1}=H$, or if you don't fancy the inversion $HV=VD$. If you are not sure that your individual pieces work, you are walking in the dark. Possibly a hot take: ...

1

Your whole code is not understandable to me. Try this alternative components: int grid(int i, double a, double h) { return a+i*h; } int index(int i, int j, int N) { return i*N+j; } //potential function. returns the integral over the grid square indexed by i double V(int i, double x0, double hx, int j, double y0, double hy) { double xi=grid(i,...

Top 50 recent answers are included