Convert dynare matrices into GAM0,GAM1 used in gensys?

Is that possible dynare output the GAM0, GAM1,psi, pi matrices used gensys? I want to estimate a model with some coefficients values solved by nonlinear solvers, but I don’t know how to update their values in estimation. The simple # stuff doesn’t work in my case, since I have to call a function. Another reason I want to do that is I want to learn how to specify the “jump” variables or “state” variables in both systems.

Currently, I have a model that dynare recognize four jump variables, but gensys get 5 with the same parameterization. If I can compare the dynare generated GAM0,GAM1 matrices with what I got manually. I can find what the problem is.