You have to be more specific with your questions, because people who are willing to help you may not have expertise in your subject.
If your request is to turn a physical/chemical process that you know and understand into code, then you should provide the formulas or set of equations and/or process by which the requested quantity is calculated.