Optimize function (find the minimun value of function of s, s is variable)

I have a function of (s):
Rl_f =
1/((- (5731525556631357*s^6)/147573952589676412928 + (21989195558260875*s^5)/18446744073709551616 - (30706941264372055*s^4)/2305843009213693952 + (294729030299171*s^3)/4503599627370496 - (2509916046412341*s^2)/18014398509481984 + (2858849959201839*s)/18014398509481984 + 6381469896557435/9007199254740992)^2 + ((28170773207104255*s^6)/590295810358705651712 - (10028621399684733*s^5)/9223372036854775808 + (18237315031244675*s^4)/2305843009213693952 - (1400809543005711*s^3)/72057594037927936 + (13548071838963447*s^2)/576460752303423488 + (4816708806873475*s)/144115188075855872 - 758739476339415/1125899906842624)^2)^(1/2)
And I want to find the minimum value of function.
What should I do? Give the code will be helpful to me (I try several command but it is not working)

 Accepted Answer

The limit is 0, at s = +/- infinity .
When you have a constant numerator and a polynomial-like denominator that is guaranteed non-negative (square root of sum of squares), your minimum is going to be at an infinity at which point the infinite denominator drives the fraction to 0. If your denominator could achieve exactly 0 over the range then that would lead to a singularity of infinity for the function, which would represent a maximum.
In order to achieve a negative value, your denominator would have to be allowed to go negative. But if the denominator crossed zero to become infinitesimally negative, that would lead to an infinitely negative ratio and the minimum would then be negative infinity. So you can only achieve a "useful" negative minimum if the denominator is something that is guaranteed to be negative and non-zero over the range, such as 1/(-1-x^2)

4 Comments

If s is 0 to 10. How can I get the minimum value of function? Give the code will be helpful to me. Thanks!
The minimum is at 10. 10 is past the last 0 of the differentiation of the denominator, which occurs at approximately 8.165134364. 10 into the infinite tail, so the minimum occurs at the boundary.
To minimize the function. maximize the denominator.
Take the denominator, remove the square root (because doing so simplifies calculations and does not change where the maximum is.) Expand the rest to get a degree 12 polynomial in s. Differentiate in s. Solve the derivative for 0's. You can do that using roots(). Discard the imaginary roots, and then discard the roots that are outside [0,10]. The only points you need to check for minimizing the overall function are then the boundaries 0 and 10, together with the locations of those roots.
Actually I know it. But I see a command "fminbnd" can be used to find the minimum value of function. But it is not working Here is my code:
....
function R_l = myfun(s,0)
R_l=1/sqrt(f2x^2+f2y^2);% function is the same.
R_l_min=fminbnd(@(s) myfun(s,0),0,10)
....
So Can I use this command or another command to find the minimum value of function?
If the command "fminbnd" can be used, can you give me the code to run?
fminbnd is a local minimizer, but you need a global minimizer unless you break the range into small enough segments that you can guarantee there is at most one minima in the segment. This is why you should prefer analytic solutions.
Your function is of the form
1/sqrt(f(s)+g(s)^2)
where f and g are both 6 order polynomials. If you let the coefficients of f be a(K)*s^(7-K) and g be b(K)*s^(7-K) then you get the representation used by roots(), the first element corresponding to the highest power. In symbolic form,
1/sqrt(a[1]*s^6 + a[2]*s^5 + a[3]*s^4 + a[4]*s^3 + a[5]*s^2 + a[6]*s + a[7] + (s^6*b[1] + s^5*b[2] + s^4*b[3] + s^3*b[4] + s^2*b[5] + s*b[6] + b[7])^2)
Take the denominator, strip the square root, differentiate, solve for 0, and you get RootOf() a polynomial of degree 11. The coefficient vector for it, which can be passed to roots(), is
[12*b(1)^2,
22*b(1)*b(2),
20*b(1)*b(3)+10*b(2)^2,
18*b(1)*b(4)+18*b(2)*b(3),
16*b(1)*b(5)+16*b(2)*b(4)+8*b(3)^2,
14*b(1)*b(6)+14*b(2)*b(5)+14*b(3)*b(4),
12*b(1)*b(7)+12*b(2)*b(6)+12*b(3)*b(5)+6*b(4)^2+6*a(1),
10*b(2)*b(7)+10*b(3)*b(6)+10*b(4)*b(5)+5*a(2),
8*b(3)*b(7)+8*b(4)*b(6)+4*b(5)^2+4*a(3),
6*b(4)*b(7)+6*b(5)*b(6)+3*a(4),
4*b(5)*b(7)+2*b(6)^2+2*a(5),
2*b(6)*b(7)+a(6)]
and you can proceed from there, filter out the imaginaries, filter out the ones out of range, test the value of the function at each of those locations and at boundaries.

Sign in to comment.

More Answers (0)

Categories

Find more on Optimization in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!