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,
If you need some background information, read below.
It is about sovling 2x2 system of first-order differential equations such as...
dk/dt = Kdd[k(t),p(t)]
dp/dt = Pd [k(t), p(t)]
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 value-type 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 boundary-value problem into an initial-value 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 steady-states, 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 stable-arm of a saddle-path 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 saddle-path stable. The eigenvector associated with the negative eigenvalue that corresponds to the stable-arm, 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 steady-state 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 steady-state 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 first-order 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: ,