Today, the outbreaks of epidemic diseases such as Covid 19 is one of the most important challenges that facing the world economy. Therefore, the study of the effects of epidemic diseases on the economy is of particular importance. The studies showed there is a close relationship between trade, economy and production. In this paper, we will focus on the effect of the epidemic on macroeconomics, especially foreign trade. To achieve this goal, a new dynamic system model of the supply chain in foreign trade, is mathematically modeled. In this model, the parameters affecting the macroeconomy in the field of foreign trade and domestic production have been considered. Since epidemic diseases affect market demand and factory performance, they will have a direct impact on commodity prices and trade volume. Studying this effect is important during and after the epidemic. On the other hand, This model is simulated using time-varying behavior and input with time. Using a new method and utilizing the science of control engineering, an optimal tariff estimation system will be developed. Within system, it is possible to use policymakers to make the right decision in different situations.