The project aim is to study the coexistence of, or coemption between, antiferromagnetism and d-wave superconductivity at grain edges. The influence of Andreev bound states on superconductivity and ferromagnetism at such edges has been previously examined by the group, using quasiclassical theory. Now we wish to extend these investigations using a microscopic tJ-model solved using the Gutzwiller approximation allowing for antiferromagnetic correlations that naturally appear in this model. For this purpose, we have developed a code which simulate equilibrium properties in strongly correlated superconducting systems in real space.