Welfare evaluation of Ramsey policy in model with distorted steady state


I have a NK DSGE model with a distorted steady state. I would like to evaluate welfare under Ramsey optimal policy (relative to welfare under an alternative policy). My understanding is that this requires taking a second-order approximation of the equilibrium conditions under the relevant policy. But Dynare only seems to allow for taking a first-order approximation to the FOC of the Ramsey problem, and not a second-order approximation.

Is there an alternative way of solving this type of problem with Dynare?