Before revision: We propose and study an algorithm for computing a nearest passive system to a given non-passive linear time-invariant system (with much freedom in the choice of the metric defining `nearest'  ), and also a closely related algorithm for computing the structured distance of a given passive system to non-passivity.
After revision: We propose and study an algorithm for computing a nearest passive system to a given non-passive linear time-invariant system (with much freedom in the choice of the metric defining `nearest' , which may be restricted to structured perturbations ), and also a closely related algorithm for computing the structured distance of a given passive system to non-passivity.