In recent years, more and more attention has been paid to the simultaneous optimization of hardware and control to achieve an optimal design of complex and interacting systems. To efficiently carry out this co-design optimization, there is a need for flexible methods to apply the variable hardware and control co-design aspects while also allowing a faster system response calculation compared to traditional methods. These time savings in the response calculations are of significant importance when using iterative optimization algorithms that typically require a large number of simulations to arrive at a solution.That is why this paper proposes a general methodology to create a closed-loop state-space model consisting of an open-loop process with an observer and extensive control loop structures. These structures comprise a combination of cascaded decentralized and distributed controllers, synchronizing controllers, and feedforward controllers while taking into account reference trajectories and input disturbances. It is shown that with the proposed methodology, response calculations for a motion application are much faster compared to traditional graphical programming tools that enable to apply flexible control architecture features. This shows that the presented methodology permits the efficient co-design optimization of hardware en control aspects.