Here's the upgrade chart for siege and fortifications
The chart shows at what level you get the best value for money. It does not take into account the psychological level of a high fort level on people who cannot recon your DA (but above a certain level assume you are being spied on imo) or the unsabbability of upgrades. Still, little point saving for a 2mil upgrade unless you have the SA/DA to warrant it really.
where it says 'No of weapons' it means strictly the no of BPM's or IM's (it assumes you are only using the highest weapons!) it is worth selling to buy the upgrade(!). The math is good in terms of the gain the next time you use it, but I am not sure there is any economy in selling something for 75% that you will buy back the next day at 100%