Mathematical simulations are of increasing relevance for applications in engineering and the life sciences. Disciplines like epidemiology, biomechanics, medical image processing, just to name a few, are subject of academic research since decades. With modern numerical methods and the advent of increasing computing power not just simulations of biological systems are within reach, but also questions of optimizing the systems to aim at a certain goal can be addressed. In this paper, we will discuss some examples from epidemiology as well as biomechanical models for muscles. All these models are based on a set of differential equations. Defining a suitable cost functional to measure the distance to the goal of our optimization, mathematical tools from constrained optimization can be applied to solve optimization problems and to derive suitable numerical algorithms.