Agree with most of what has already been said. I'm not as big of a Madrid fan as others particularly when compared Barcelona & Lisbon. Definitely agree with the train option between Barcelona & Madrid. Just got back from 5 days in Lisbon and miss it already.
Stop by Lisboa Bar if you're going to a nearby restaurant. Sampled the best gin & tonic I've ever had and I'm not a fan in general. Their meat & cheese plates are really good too. It's also near one of the main train stations so could be a nice sendoff. The TimeOut market is great too. So much high quality variety in one place that still has character. Jesus e Goas is slightly a tourist restaurant but the food really is great. Skip their mixed drinks. The Sweet & Sour spare ribs & baby shark are delicious and don't skip the lentil "burger" appetizer.