jinsuk Lee wrote:
thank you for information
You can do as shown below, but I would suggest that you make your function P() more stable as it will fail for certain values. At least put a try command around it and replace values where it fails by NaNs.
I used a vector with just 24 values for Omega as calculation time for any valy of P is quite long. That way the accuracy is just 0.5 rpm. For an accuracy of two decimals you would need more than thousend values in Omega and I bet it will take much longer than using maximize (which still yields a more accurate result).