Timing convention for capital adjustment costs

I have a couple of questions to ask. Apologies if they appear "lame".
The cost of adjusting investment is usually equal to phi*(i/k- delta)^2*k. When you program it with dynare and using k = (1-delta)*k(-1) + i, do you program the cost in your program as phi*(i/k(-1) -delta)^2*k?
Also, if you want to do log-linearization, would you program your costs like this: phi*(exp(i)/exp(k(-1)) - delta)^2*k, considering your i and k are logs.
The cost of adjusting investment is usually equal to phi*(i/k- delta)^2*k. When you program it with dynare and using k = (1-delta)*k(-1) + i, do you program the cost in your program as phi*(i/k(-1) -delta)^2*k?
Also, if you want to do log-linearization, would you program your costs like this: phi*(exp(i)/exp(k(-1)) - delta)^2*k, considering your i and k are logs.