Author 
Comment/Response 
Donny C

07/01/13 09:28am
Hello,
I recently moved to ver 9, and found that an algorithm that has served me well for years in previous versions no longer works in this newest version. Solving this kind of algorithm is critical to my work, so version 9 is virtually useless to me without the capability to solve them. (I had to return to ver 8 well hopefully for now.)
Attached file is the result after evaluating it in ver 9 and you can find the error messages concerning the k(t). However, the identical code works perfectly in ver 8.
So please help me out and let me know how to fix this. Any help or suggestion would be appreciated.
Thanks in advance,
Donny
If you need some background information, read below.
*****
It is about sovling 2x2 system of firstorder differential equations such as...
dk/dt = Kdd[k(t),p(t)]
dp/dt = Pd [k(t), p(t)]
k(0)=K
It can be shown that:
k(t) > ks and p(t) >ps as t > infinity, i.e. transversality conditions.
K, ks, ps are all constants. (ks and ps are called steady states.)
As you see, this is a boundary valuetype problem.
One can attack this problem by guessing the initial value of p(0) and trying repeatedly until a solution that meets transversality conditions are met. This method, called 'shooting', is conceptually as well as computationally inefficient.
The way to attack this kind of problem in my discipline is to view it as an initial value problem. That is, if the initial value of variable p corresponding to k(0)=K were known, then simply integrating these differential equations would yield the optimal solutions to k(t) and p(t) at each point in time.
By transforming a boundaryvalue problem into an initialvalue problem, we can express p(t) as a function of k(t), instead of as a function of time. That is,
p=P(k) (called “policy function”),
which solves for the optimal values for the variable p as a function of the variable k, is assumed to exist.
If this function exists, then this function can be substituted to dk/dt=Kdd[k(t),p(t)] above to obtain
dk/dt = Kdd[k(t), P(k(t))].
Then, given k(0)=K, once could simply integrate this function forward to a know value, the steadystates, ks, and thus obtain the solution k(t). Once the optimal series k(t) are know, p(t) series can be formed based on the policy function defined above. It should be obvious that this policy function corresponds to the stablearm of a saddlepath stable system.
In practice, we first linearize the DE system in the neighborhood of the know steady states, (ks,ps), and then verify that the determinant of the characteristic matrix is negative. In the 2x2 system like this, this requires that one of the two eigenvalues is negative, and the other positive, implying that the system is saddlepath stable. The eigenvector associated with the negative eigenvalue that corresponds to the stablearm, hence our policy function, p=P(k).
Returning to our system, we recognize that the ration of (dp/dt) to (dk/dt) is the first order derivative of the policy function, i.e,
(dp/dt) / (dk/dt) = Kdd[k(t),p(t)] / Pd [k(t), p(t)] = Kdd[k(t),P(k(t))] / Pd [k(t), P(k((t))].
And also note that
dp/dt = dP(k(t))/dk(t) x dk/dt (dp/dt) / (dk/dt) = dP(k(t))/dk(t).
Hence, we obtain
dP(k)/dk = Kdd[k,P(k))] / Pd [k, P(k)]
Still, we don’t know the initial pair of (k(0),p(0)) , but we do know the policy function goes through the steady state point (ks,ps).
Then we can start from this steadystate point and then solve dP(k)/dk = Kdd[k,P(k))] / Pd [k, P(k)] right above.
However, one important problem arises: the slope of the policy function at the steadystate is indeterminate, i.e,
dP(k)/dk at (k=ks) = Kdd[ks,P(ks))] / Pd [ks, P(ks)] = 0/0.
In short, this problem is addressed by getting eigenvectors after linearizing the system around its steady states,(ks, ps) using firstorder Taylor series expansion. It can be shown that the eigenvector associated with the negative eigenvalue represents the slope around the steady state.
Attachment: NDSolve v9.nb, URL: , 
