How can I find maximize value?

I want to find max value about omega when v is variable.
I make solve block and I retrict each range.
But I can't get omega max with variable v.
In other words, I want to find max location about curves.

I want to find max value about omega when v is variable.
I make solve block and I retrict each range.
But I can't get omega max with variable v.
In other words, I want to find max location about curves.
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).

No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.