welfare loss and infinite sums

Hi to everyone!
I have to evaluate the value of my objective function (welfare loss) in a new keynesian model. The value of the objective function W(t) is the infinite sum from 0 to infinitive of the parameter beta times a linear quadratic expression. How can I express the infiinte sum on dynare? I cannot linearize the expression, since in the command planner_objective ir must be quadratic, and is also impossible to write it in recursive form, since in the command leads or lags cannot enter. Can someone suggest me a trick?
Thank you!
I have to evaluate the value of my objective function (welfare loss) in a new keynesian model. The value of the objective function W(t) is the infinite sum from 0 to infinitive of the parameter beta times a linear quadratic expression. How can I express the infiinte sum on dynare? I cannot linearize the expression, since in the command planner_objective ir must be quadratic, and is also impossible to write it in recursive form, since in the command leads or lags cannot enter. Can someone suggest me a trick?
Thank you!