Ramsey policy and linearized model

Dear all,

I have a log-linearized model in Dynare and I want to take it a step further and incorporate Ramsey.

Does it matter if I specify a log-linearized version of the welfare function or if I enter the non-linearized welfare function with log-linearized variables?

Thank you in advance for your help!