Solutions and diagnostics of switching problems with linear state dynamics