If I want to make dal (let's say) in an Instant Pot, I google someone else's recipe and find that the pot should be at pressure for 12 minutes if you're using red lentils and 15 mins. if you're using green lentils. Is there a way to calculate that on my own (i.e., some equation or formula that people use to develop pressure cooker recipes)? Or does everyone just figure it out by trial and error?
Instant Pot has a page with cooking times for various things on it:
However, there are also lots of good pages out there with more specifics. For example, chicken thighs (fresh, frozen, bone in vs. out, brown first vs. not):
As already noted in comments: there are no usable formulas for this. Just look it up in a table.
First, the models which deliver the formulas would have to be developed. Developing the models would be more resource consuming (requiring time and tons of expertise) than creating tables by trial and error. Also, developing the models would also need quite a few use cases based on trial and error anyway.
Second, they would have to be applied. Very few people would have the required mathematical expertise to apply them, but even the minority who would happily solve a system of differential equations in the kitchen will have no source for the required parameters to plug in.
And then, models are not perfect. And nonlinear models with a large number of assumptions are especially likely to be off. Once you get a calculation from a model, there is still a chance that it will be wrong. Which means that even with a formula, you are still doing a trial-and-error thing, it is just that the formula supplies you with a reasonable initial guess to test. But the expertise of people who have cooked vegetables before will also supply a reasonable initial guess, without the need for all of the above.
So, in the end everybody uses tables. It is both easier and more effective.
As a rough rule of thumb, the modern generation of electric pressure cookers run at 10psi, the older stovetop ones at 15psi. I've had good results adding 20-30% time to traditional cooking times, generally finding that due to no loss of pressure/steam with the later generation PC's 20% is sufficient.
A great reference for PC cooking times is Miss Vickie, but her site has not been maintained in some time so she may be cooking for the angels now. Part of her site is still available on the Wayback machine: