Are you a patent holder, wondering how to write software which implements your patent? Here's my advice: Patents expire. Towards the end of the patent's lifetime, you want to be trying to transfer the patent's franchise over to the relationship between the patent-holder and the licensee. That can be done with closed-source software, but you risk competitors writing their own software. With Open Source software, as long as you manage the relationship with the user correctly, you end up with a franchise.
Long before a patent expires, you have ZERO NEED for closed-source software. ZERO. NONE. The purpose of a patent is to give you ownership over the idea. The purpose of closed-source software is to give you ownership over the code. But if you already have a patent, you own the idea. No need to own the code -- in fact, owning the code only hurts you, because it closes you out to people who would improve the code, or even to people who would create new patented works based on your patent.
If you have a patent, you NEED open source software.