Models of agricultural economics typically operate at an annual basis or in a static equilibrium framework where inputs, outputs and their prices may change considerably. Production dynamics, however, imply that models relying on spatial and temporal aggregation do not capture the effects of biological constraints in the short run. This paper examines short and long-term impacts of demand and production cost shocks in the pig sector. The analysis is carried out with a dynamic programming model which takes into account changes in export and domestic demand and market clearing price. It optimizes the supply of piglets on a monthly basis. Econometric techniques are used to estimate demand functions. Short-term negative market shocks can already have significant income effects to agricultural producers. We simulated effects of pig meat export bans of different degrees due to livestock epidemics. Full closure of export markets for six months cost pig sector €21 million.