A signicant part of crop productions is not marketed and can be totally (fodders and pastures) or partly (cereals) used on-farm. Regarding inputs, Nitrogen fertilizers are also not only provided by the market, but they are signicantly on-farm provided by livestock. When outputs and inputs are related through technical dose-response functions, like Nitrogen (N)-yield functions, the optimal gross margin is easily com- puted at the plot level, when input and output are marketed. In this case, market prices are required. The question addressed in this article is how to assess the optimal values when one crop production (respectively one input) is entirely on-farm used (respectively on-farm produced). We propose a simple iterative computation method aiming at replacing market prices by shadow costs. We apply this method to a large set of the bio-economic agricultural supply model AROPAj, which covers a large range of agri- cultural activities over the European Union. This method allows us to keep ecient the basic linear framework of the model even when the yield functions make it non linear.