matlabeigenvaluefunction-handleode45transfer-function

Find Eigenvalues of ODE45 Solution MATLAB


I have the following non-linear ODE: enter image description here I have the following ODE45 solution:

fun = @(t,X)odefun(X,K,C,M,F(t),resSize); 
[t_ode,X_answer] = ode45(fun,tspan,X_0); 

The input matrices are stiffness K(X), damping C, mass M, and force F. resSize is the total number of masses in the system.

I would like to find the system's eigenvalues using either the Jacobian matrix, transfer function, or any other viable method.

I have tried using:

[vector,lambda,condition_number] = polyeig(K(X_answer),C,M);

This is tricky since my K matrix is a function handle of X. In other words, K=@(X). X represents a displacement vector of each mass in the system (x_1(t),x_2(t),...x_resSize(t)), where resSize is the total number of masses. My X_answer matrix is a double with dimensions of t_ode by resSize, where each row is the displacement vector of each mass in double form. Is there some way to substitute X_answer into my function handle for K so I can use polyeig()? If not, how would I go about finding my system's transfer function or Jacobian matrix so that I can find it's eigenvalues?


Solution

  • Without knowing the exact form of your equation, based on your description, I suppose you have something like:

    [M]{x''}+[C]{x'} + [K(x)]{x} = F(t)

    Since this system of equations is nonlinear, the eigenvalues can be estimated based on a expansion around each x estimated from the output of the ode45 function. Since ode45 integrates a system of first order equations, you probably have introduced a change of variables, to write the above system as a system of first order. In state space form, this is

    {y'} = [A]{y} + b(t), with {y} = {x ; x'}

    So, the output of the ode function contains the displacements {x} and the velocities {x'}.

    If you want to estimate the eigenvalues for each x on the output, you could do

    for ii=1:length(t_ode)
        [X,e] = polyeig(K(X_answer(ii,1:end/2),C,M)
    end