intellectual property during paid research I was working on a project as a researcher. The whole project was financed by an external grant from a private foundation (nonprofit organization) and my salary was paid through this grant during my work as a researcher.
During the project, I faced a problem that I had to solve it numerically. I had my own license and I paid for the software, the software that I used to solve the problem, I have not asked the principal investigator (PI) of the project to refund my license payment. 

I solved all the numerical problems, I sent the results and outputs to the PI and we wrote the manuscript out of our findings. 
Now at the end of my contract, the PI of the project asked me to send him all the data that I have produced during my work and I said I will send all the data except that I cannot send him the input file of the numerical solutions using my software; I mean the method that I used to solve the problems. He said I have to send them as I was paid to work on project. I said I sent you the results, but the method of solving the problems is my intellectual property and I have paid for the software by myself, but he insisted that does not give me any right to keep them.

Who is right? Are these my intellectual properties?

I have to mention that in the contract that I had signed there was nothing about the copyrights and intellectual property. 
The solutions are not a big deal, but the point is, there is a possibility that they use them in their future research without mentioning my name.
I am not sure what discipline you are in, but I have been working on software development with a team of health, social, and computer science researchers and from what I have learned, maybe this can help. 

Basically, since the grant paid for your salary it is the institution that has the most stake in for the intellectual property, which covers the PI. For instance, I helped develop and test the software I mentioned at University A, but since then have transferred to University B. I still work with the same team from University A, but any work we do with the software at University B (even when collaborating with the same team from University A), I have to pay University A a licensing fee for use of the software. They do not charge me a lot, granted, but they still require it, because they view it as theirs. Even though, I was a major contributor to the software. 

By extension, the PI should have the right to any materials associated with the project. When you mentioned that you used your own software for the calculations, were you asked by the PI to purchase this or did you go out and get it on your own? If the latter, I suggest that in the future, when materials are needed for a project, simply explain to the PI that resources are needed for the work. You shouldn't pay for them out-of-pocket. If you still have questions about ownership of the work, the institution has lawyers that deal with intellectual property that can help you figure out what is who's. I have had to work with them for our software project to make sure that we are in the clear for doing work outside of University A with our product. Hope this helps!