This article presents techniques for the analysis of fluid systems. It adopts an optimization-based point of view, formulating common concepts such as stability and receptivity in terms of a cost functional to be optimized subject to constraints given by the governing equations. This approach differs significantly from eigenvalue-based methods that cover the time-asymptotic limit for stability problems or the resonant limit for receptivity problems. Formal substitution of the solution operator for linear time-invariant systems results in the matrix exponential norm and the resolvent norm as measures to assess the optimal response to initial conditions or external harmonic forcing. The optimization-based approach can be extended by introducing adjoint variables that enforce governing equations and constraints. This step allows the analysis of far more general fluid systems, such as time-varying and nonlinear flows, and the investigation of wavemaker regions, structural sensitivities, and passive control strategies.