Finite sum Code writing

Hi,
I want to input a formula which has finite summation in it, and also top boundry is an endogenous variable of the model, somthing like the picture attached

That is the type of non-stationary model that Dynare cannot handle. Depending on the value of n_t the length of the sum would change in each period.

Thank you so much for the answer, then i’ll have to modify the equation’s or trick it somehow, appreciate your remark