user3026610
user3026610

Reputation: 47

Solving a system of differential equations in R (saddle point stability)

I would like to solve a planar system of differential equations in which the initial condition for one variable is given, while the initial condition of the other needs to be determined in order to make sure that the system converges towards its equilibrium. If the equilibrium is saddle point stable (which is of interest for systems arising from optimal control problems analyzed in economics) then there exists a unique initial value of this variable to achieve convergence. How to determine such an initial value in order to be able to solve the system is thus the main question. Is it possible to use R to determine the value of such an initial condition and thus solve the system?

The system is:

x' = sqrt(x)-x -y

y' = y*((sqrt(x))^(-1)-1)

with x and y nonnegative. The analysis suggests that there exists a unique equilibrium with both x and y strictly positive, and analysis of the Jacobian matrix shows that one eigenvalue is positive and the other is negative, thus the equilibrium is saddle point stable. If the x(0) is given, say equal to 1, how can we determine the value of y(0) such that the system converges to the positive equilibrium value of (x,y)? I would like to be able to simulate the unique converging dynamic paths of x and y. Can someone help me with this?

With deSolve we can easily solve the system, but we need to specify x(0) and y(0). Can deSolve or some other package be used to determine what is the value of y(0) allowing y to converge towards its equilibrium value? Probably we should rely on a shooting algorithm to guess and recalibrate the initial condition y(0), but I have no idea of how this could be done.

Upvotes: 0

Views: 372

Answers (1)

WetlabStudent
WetlabStudent

Reputation: 2606

What you would like to do is compute the "stable manifold of the saddle" This is done by

  1. computing the Jacobian, J, at the equilibrium, xStar
  2. Finding the eigenvalues and eigenvectors of J
  3. Use as your initial condition y0 = Xstar - eps * eigenvector, where eigenvector is the eigenvector corresponding to the negative eigenvalue of J, and eps is a very small number (e.g. eps = 1e-7)
  4. Simulate the dynamics but in reverse time, e.g. times = seq(-10,0, by=.1), in lsoda
  5. Repeat steps 3&4 for but with the initial condition y0 = Xstar + eps * eigenvector

Upvotes: 0

Related Questions