The objective of this paper is a numerical method for designing ducts with arbitrary prescribed pressure distribution at the walls. The method applies to inviscid compressible subsonic or transonic, two-dimensional or axisymmetric flows, and it is based on the time-dependent technique. The walls where the pressure distribution is prescribed are considered as flexible and impermeable. Starting from some initial guessed configuration, the computation follows the transient which occurs while the flexible walls move and finally reach a steady shape. Several numerical examples are described and compared with the solution of the direct problem in the case rff two-dimensional and axisymmetric subsonic diffusers, transonic nozzles and elbows. Nomenclature a = speed of sound b y c = see Fig. 1 c v = constant volume specific heat / = length p = pressure q = velocity u, w,u,w = velocity components (see Fig. 2) t = time x,z = rectangular coordinates P = logarithm of pressure R = gas constant S = entropy T. = temperature X,Z,r = transformed coordinates 7 = specific heats ratio 8 = angle in the polar frame of reference <£ = see Fig. 2 \l/ = stream function All quantities are normalized with respect to reference values: / ref ,/? ref , r ref , tf ref = V*r ref , t rcf = (l ref /q nf ), S ref = c v .