The common-sense way of handling impossible projects is to break them down into doable sub-projects: components, layers, aspects etc. Then you can get satisfaction out of completing each of them. A psychological problem I have is accepting these as goals in themselves - if it doesn't do all of the project, it feels like it doesn't count.
However, this is silly of me, because it is still progress. A journey of a thousand miles consists of steps - not just the first one, all of them. And even for a commercial project, an inadequate beginning (that still does something) is beneficial: people love the sense of progress more than everything already done, your updates give you publicity, and give customers a reason to upgrade. Even with regard to competitors, it's good to have room to improve, because when they've copied you, you've moved ahead. If you're already perfect, once they copy you, you've nowhere to go. You're a sitting duck (wrt engineering competitive advantage).
Of course, this article has a more joyful attitude towards such projects. Maybe I should try it.