Finding all complex eigenvalues near the unit circle of a large matrix (n around 10k-100k) with MATLAB - matlab

I am studying wave propagation in periodic material and need to computes slowness surfaces which are obtained by computing polynomial eigenvalues of some matrix.
Given that I am only interested in propagative waves, only eigenvalues near the unit circle should be researched.
Is there an efficient way to computes those given we do not know the number of values we are searching ?
Thanks for the help !

Related

Find point on the Spline Curve in Flutter

I am having some discrete points, by using which I can plot spline curve(Syncfusion chart) in flutter. But now I have to find the point on that curve i.e. by giving values of x, I need value of y. I am stucked here and don't have any algorithm to apply for that. How did they make graph using discrete point ? There should be some algorithm which can be applied here and get those point.
Please help me out
Thanks in advance!!
I am here with a great solution to this problem, So The idea goes like if we have n points for equilibrium data, then we will assume a polynomial of order n-1(For eg. no. of points on equilibrium curve to be 3 then the polynomial should be quadratic of form y= Ax²+Bx+C). Now as we have 3 variables(A, B, C), then to solve this equation we need 3 equations in terms of A, B and C. These equations are obtained by putting the equilibrium data points, in this case 3 points so we will get 3 equations. These three equations can be solved by using Cramer's rule. After solving the equation we will get the equation of the curve.
The equation thus obtained will be more accurate and as cramer's rule can be obtained to any number of equations, then we can easily obtain polynomial equation of any order.This method is quite big and will be time taking to apply.
This will give you the curve for a given number of points

Cholesky decomposition for simulation correlated random variables

I have a correlation matrix for N random variables. Each of them is uniformly distributed within [0,1]. I am trying to simulate these random variables, how can I do that? Note N > 2. I was trying to using Cholesky Decomposition and below is my steps:
get the lower triangle of the correlation matrix (L=N*N)
independently sample 10000 times for each of the N uniformly distributed random variables (S=N*10000)
multiply the two: L*S, and this gives me correlated samples but the range of them is not within [0,1] anymore.
How can I solve the problem?
I know that if I only have 2 random variables I can do something like:
1*x1+sqrt(1-tho^2)*y1
to get my correlated sample y. But if you have more than two variables correlated, not sure what should I do.
You can get approximate solutions by generating correlated normals using the Cholesky factorization, then converting them to U(0,1)'s using the normal CDF. The solution is approximate because the normals have the desired correlation, but converting to uniforms is a non-linear transformation and only linear xforms preserve correlation.
There's a transformation available which will give exact solutions if the transformed Var/Cov matrix is positive semidefinite, but that's not always the case. See the abstract at https://www.tandfonline.com/doi/abs/10.1080/03610919908813578.

MATLAB: Eigenvalue Analysis for System of Homogeneous Second order Equations with Damping Terms

I have a system of dynamic equations that ultimately can be written in the well-known "spring-mass-damper" form:
[M]{q''}+[C]{q'}+[K]{q}={0}
[M], [C], [K]: n-by-n Coefficient Matrices
{q}: n-by-1 Vector of the Degrees of Freedom
(the ' mark represents a time derivative)
I want to find the eigenvalues and eigenvectors of this system. Obviously due to the term [C]{q'}, the standard MATLAB function eig() will not be useful.
Does anyone know of a simple MATLAB routine to determine the eigenvalues, eigenvectors of this system? The system is homogeneous so an efficient eigenvalue analysis should be very feasible, but I'm struggling a bit.
Obviously I can use brute force and a symbolic computing software to find the gigantic characteristic polynomial. But this seems inefficient for me, especially because I'm looping this through the other parts of the code to determine frequencies as a function of other varied parameters.

Kalman filter on linear accleration for distance

I'm calculating displacement from the motion of an accelerometer and using a Kalman filter to improve the displacement accuracy. Please note that I am aware of ineffectiveness of using acceleration to obtain displacement in real scenarios, but in my case displacement is pretty small (like 10 cm over 2–3 seconds).
I am following this paper (PDF). In the paper there are two matrices, Q and R, for noise modeling and they are set such that displacement error is minimized. The authors tested the above with synthetic acceleration data of a known covariance to use the same in matrices Q and R.
I decided to vary the particular covariance and find its corresponding minimum error in displacement. But in my case there is no change in displacement at any value of covariance. Any help?

Creating a 1D Second derivative of gaussian Window

In MATLAB I need to generate a second derivative of a gaussian window to apply to a vector representing the height of a curve. I need the second derivative in order to determine the locations of the inflection points and maxima along the curve. The vector representing the curve may be quite noise hence the use of the gaussian window.
What is the best way to generate this window?
Is it best to use the gausswin function to generate the gaussian window then take the second derivative of that?
Or to generate the window manually using the equation for the second derivative of the gaussian?
Or even is it best to apply the gaussian window to the data, then take the second derivative of it all? (I know these last two are mathematically the same, however with the discrete data points I do not know which will be more accurate)
The maximum length of the height vector is going to be around 100-200 elements.
Thanks
Chris
I would create a linear filter composed of the weights generated by the second derivative of a Gaussian function and convolve this with your vector.
The weights of a second derivative of a Gaussian are given by:
Where:
Tau is the time shift for the filter. If you are generating weights for a discrete filter of length T with an odd number of samples, set tau to zero and allow t to vary from [-T/2,T/2]
sigma - varies the scale of your operator. Set sigma to a value somewhere between T/6. If you are concerned about long filter length then this can be reduced to T/4
C is the normalising factor. This can be derived algebraically but in practice I always do this numerically after calculating the filter weights. For unity gain when smoothing periodic signals, I will set C = 1 / sum(G'').
In terms of your comment on the equivalence of smoothing first and taking a derivative later, I would say it is more involved than that. As which derivative operator would you use in the second step? A simple central difference would not yield the same results.
You can get an equivalent (but approximate) response to a second derivative of a Gaussian by filtering the data with two Gaussians of different scales and then taking the point-wise differences between the two resulting vectors. See Difference of Gaussians for that approach.