how to make eigenvalues to be functions of time

I got the eigenvalues of the Jacobian matrix of a nonlinear time variant system. One of them is like:
0.5000000000e-2-0.2500000000e-2*y+0.5000000000e-2*x+0.2500000000e-2*sqrt(36.-12.*y-24.*x+y^2-4.*x*y+4.*x^2)

Now I'd like to make x and y still vary with time, i.e.
0.5000000000e-2-0.2500000000e-2*y(t)+0.5000000000e-2*x(t)+0.2500000000e-2*sqrt(36.-12.*y-24.*x(t)+y(t)^2-4.*x(t)*y(t)+4.*x(t)^2)

x(t) and y(t) bear a relation by differential equations.

Any ideas on how I implement this?

Thanks a lot!

JacquesC's picture

Need more details

You have provided too few details about your problem, which is why you have not gotten any answers. Could you provide some sample code?

eg. a nonlinear system like

eg. a nonlinear system like Lokta Voterra model:
LV := [diff(x(t), t) = 0.2e-1*x(t)-0.5e-2*x(t)*y(t), diff(y(t), t) = 0.1e-1*x(t)*y(t)-0.1e-1*y(t)]

the Jacobian matrix of the right part of these two equations are sth like:
[0.02-0.05y -0.005x]
[0.01y 0.01x-0.01]

(i used the style of matlab to show this matrix)

now, i'd like to know how the eigenvalues of this Jacobian matrix change with time t.

Could you please tell me some ideas or suggestions on this problem

thx!

JacquesC's picture

A bit tricky indeed

There are probably simpler ways, but you can get the matrix thus:

> LV := [diff(x(t), t) = 0.2e-1*x(t)-0.5e-2*x(t)*y(t), diff(y(t), t) = 0.1e-1*x(t)*y(t)-0.1e-1*y(t)]:
> r := map(rhs, LV):
> frontend(VectorCalculus[Jacobian],[r, [x(t), y(t)]], [{`+`,`*`,list},{}]);

               [0.02 - 0.005 y(t)      -0.005 x(t)   ]
               [                                     ]
               [    0.01 y(t)        0.01 x(t) - 0.01]

then LinearAlgebra:-Eigenvalues is quite happy to return a closed-form for that.

actually i have no codes,

actually i have no codes, just some simple commands.

numerical solution

Find the Jacobian, say using:

with(plots):with(LinearAlgebra):with(VectorCalculus):
LV := [diff(x(t), t) = 0.2e-1*x(t)-0.5e-2*x(t)*y(t), diff(y(t), t) = 0.1e-1*x(t)*y(t)-0.1e-1*y(t)]:
map(rhs,LV):subs(x(t)=X,y(t)=Y,%):
J:=Jacobian(%,[X,Y]);

Then find the eigenvalues as a function of x(t) and y(t):

ev1,ev2:=subs(X=x(t),Y=y(t),Eigenvalues(J,output=list))[];

Solve the odes for some set of initial conditions (I'm assuming you want a numerical solution):

ans:=dsolve({LV[],x(0)=1,y(0)=0.2},{x(t),y(t)},numeric);

And then plot things using odeplot, e.g., for ev1 as a function of time:

odeplot(ans,[t,ev1],t=0..10);

If you want numerical values, e.g. ev1 at t=5:

subs(ans(5),ev1);

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}