If my model with explicitly specified trend, just like your “A Guide to specifying observation equations for estimation of dsge models” Chapter 6, let the labor augmenting technology growth to be Xt, define ut=Xt/Xt-1
Then original law of motion of capital changes from
Kt+1=(1-delta)Kt+It
to
ut+1kt+1=(1-delta)*kt+it,

In Dynare , I write code likeu(+1)*k=(1-delta)*k(-1)+i;

Just want to make sure if I am right with this line of code.
Many thanks,

I fact, the growth rate is a exogenous variable, right? How do you specify its values during the transition calculation? It changes along the transition path.

Here, with an explicit stochastic trend, the timing is crucial. If you go for the beginning of period capital stock notation as you do, capital K_{t+1 should have a trend factor X_t, not X_{t+1}. Therefore, you will get

Otherwise, people would form expectations about u, although it should be known. See also Aguiar/Gopinath (2007) on this.

[quote=“jpfeifer”]Here, with an explicit stochastic trend, the timing is crucial. If you go for the beginning of period capital stock notation as you do, capital K_{t+1 should have a trend factor X_t, not X_{t+1}. Therefore, you will get

Otherwise, people would form expectations about u, although it should be known. See also Aguiar/Gopinath (2007) on this.[/quote]

Many thanks Johannes, you help me to correct a big mistake, but your example code seems a little bit wrong.
If I understand you correctly,
I would like to define Yt/Xt=yt, While Kt/Xt-1=kt, Xt/Xt-1=ut
Therefore
Kt+1=(1-delta)*Kt+It , becomes
(kt+1)Xt=(1-delta)kt(Xt-1)+itXt,

so both sides divided by Xt-1 we get : ut*kt+1=(1-delta)kt+utit

In Dynare it should be:u*k=(1-delta)*k(-1)+u*i;

By the way, the production function Yt=(Kt^alpha)(XtNt)^(1-alpha)
After detrend becomes yt=(kt/ut)^alphaNt^(1-alpha);
In Dynare it should be:y=(k(-1)/u)^alpha*n^(1-alpha);

Interest rate Rt=alphaYt/Kt=alphaytXt/(ktXt-1)=alphaytut/kt;
In Dynare it should be:r=alpha*y*u/k(-1);

Could you help to check again if I am right this time?