Is it more economical to scrap or trade an extra ship?

Since no-one else has chimed in here, I will give the details as I see them after disposing of 4 or 5 extra ships.

Scrapping the extra ship:
You get scrap components that are nominally worth the trade value of the ship. Plus commonly a couple free upgrade modules. The draw back is you have to actually sell the scrap components, and are subject to market fluctuations. So it seems like you generally lose a few percentage points off the trade value, with the upgrade modules as compensation.

Trading the extra in on a new ship:
You get the trade value. Bonus, you don't have to worry about clearing enough suit inventory to accept the components from scrapping. Drawback, you have to be looking at the ship you want, while the one you want to dispose of is your active one.

Summary:
I generally prefer scrapping. That way I am not clogging up my ship slots with things I don't want, and have money free to use for other things, like hiring frigates. The exception is, I bought an A class fighter at a trading post near my base a while back, and I am holding off on upgrading it's systems, hoping to find the S class sitting there one of these days.


Exo-mech (2.42) version answer.

By scrapping, you have a chance to get an inventory upgrade for your ships
(considering my own experience, I would say 25-50% chance, buy I didn't do it enough in order to be representative, may be I was just lucky).

Upgrading ship inventory starts at 1 M the slot, and can get overpriced really fast (100 M for biggest ships) So by scrapping a 400k ship, you can get a 100 M item. even on a 10% chance, there is no reason not doing it. And I don't even take in consideration the spare part that can sell for a lot too.

So there is no reason not to scrap a ship by opposition to sell(trade) it. Scrapping is better 100% of the time. The only reason not to scrap a spare ship is that you want to keep for a long time, even if you don't make it your primary ship at the moment.

The only time you will want to sell your ship is that you have enough money by trading your current one, but not to buy the ship directly (and you really, really want that Shiney pokem.. heu ship). In this case, the money is not the deciding factor. It's the opportunity that is.