Unable to calculate steady state

See

Also,

gm = m - m(-1);

suggests your model has a unit root. See