Finding set of variables that make my function approach zero

1 view (last 30 days)
I am trying to find a set of variables that make my objective function approach zero. My objective function is presented below.
-function f = rutdepth(x)
f= 0.08 - ((1 - exp(-1/6*log(x(1)/x(3))*8000))/(1/6*log(x(1)/x(3))))*x(1); (I want to make this function approach zero as close as possible if no exact solution exist)
while satisfying the following constraints
function[c, ceq] = const(x)
ceq(1)= 3877781.13- 2838712.84280904/((-log(x(1)/(33.43*x(2)*1*1.35)))^(1/0.113576473076284));
ceq(2) =3877781.13- 2838712.84280904/((-log(x(3)/(33.43*x(4)*1*1.35)))^(1/0.113576473076284));
c = [ ];
I have 4 variables x(1), x(2), x(3), and x(4). only x(1), and x(3) exist in the objective function I tried every single optimization method available, none were able to solve it. I was able to solve it in excel using evolutionary method as an option in the solver, by manipulating the seed values manually. Does anyone know how to solve it in matlab. Please any help is greatly appreciated.

Answers (1)

Walter Roberson
Walter Roberson on 25 May 2020
x(1) = 0.00001
x(3) = x(1)
x(2) = 0.00000058171249020241154476633048977861
x(4) = x(2)
f will be 0 to within round-off
That x(2) value is
1/4513050*exp(1/4163735783598981*2^(8184047389190525/36028797018963968)*
762011176412501^(8184047389190525/72057594037927936)*4163735783598981^(
63873546648737411/72057594037927936))
Note that you need to take the limit of f as x(3) approaches x(1)
You cannot really get exact solutions, as your coefficients are obviously only approximate.
  1 Comment
rami skaff
rami skaff on 25 May 2020
thank you for your response, but x(1) cannot be equal to x(3). I solved it in excel solver getting different answers. Given that x(1) is not equal to x(3), x(2), and x(4) cannot be equal as well. could you please tell me how did you solve it in matlab, (what method did you).

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!