Info

This question is closed. Reopen it to edit or answer.

Verification of Optimal Solution given in Optimization Problem

1 view (last 30 days)
Hello,
I am trying to verify that the solution that Matlab provides as my optimal objective value (fval) is correct.
For some reason when I put the values that matlab generates back into my problem just to verify that the same optimal solution will be returned, I can never get the same answer. Is there a logical reason for this or am I doing something wrong in verifying the answer?
Below is an example of a solution I would get. Now if I plugged the x variables (x = 1.0001 1.0000 1.4779 9.9994 1.4779) back into the problem then it gives the same answers for the components: ExpUnitProfit = 0.71676 ExpIncMarketShare = 0.0098135 UnitPrice = 1.0001 MarShareWOExtWar = 0.13953
These components are the initial optimization function where the optimization function = -(ExpUnitProfit*ExpIncMarketShare)/(UnitPrice*MarShareWOExtWar) = .0070339243/.139543953 = -.0504065146
But the fval (optimal solution) given by matlab = -.0962
Not sure if this matters, but within the function for the optimization problem there is a random variable that is generated which is included within finding ExpUnitProfit. I know the program has to do many interations before it finds a solution and so the variable may change, but since I display the random variable at the end then I believe that takes care of knowing which one it uses.
I am having a bit of trouble trying to round everything in the below display to 4 decimal places. Any suggestions on a generic method?
Max Line search Directional First-order
Iter F-count f(x) constraint steplength derivative optimality Procedure
0 6 0.131685 -1
1 12 -0.00667422 0 1 -6.92e+06 7e+06
2 27 -0.0105627 0 0.00195 -6.87e+05 1.36e+06
3 33 -0.0886607 0 1 -3.17e+05 1.15e+07
4 47 -0.0943893 0 0.00391 -4.17e+06 1.77e+07 Hessian modified
5 64 -0.0954622 0 0.000488 -4.14e+06 1.53e+08
6 78 -0.0961024 0 0.00391 -1.11e+08 1.54e+08 Hessian modified
7 85 -0.0961913 0 0.5 -8.66e+06 1.86e+07
8 124 -0.096216 -4.441e-16 1.16e-10 -9.2e+06 6.36e+06 Hessian modified
Local minimum possible. Constraints satisfied.
fmincon stopped because the predicted change in the objective function is less than the default value of the function tolerance and constraints are satisfied to within the default value of the constraint tolerance.
criteria details
Active inequalities (to within options.TolCon = 1e-06): lower upper ineqlin ineqnonlin 3 9
fval =
-0.0962
x =
1.0001 1.0000 1.4779 9.9994 1.4779
P =
1.0001
W =
1.0000
U =
1.4779
Wprime =
9.9994
Uprime =
1.4779
ExpUnitProfit = 0.71676 ExpIncMarketShare = 0.0098135 UnitPrice = 1.0001 MarShareWOExtWar = 0.13953 r = -2.8326 Theta0 = 0.005 Theta0 = 0.01 Theta0 = 0.01 Theta0 = 0.02 L = 10 D = 0.11684 Qprime = 0.1886 e = 2 v = 0.02
ans =
x: [9x5 double]
fval: [9x1 double]

Answers (0)

Community Treasure Hunt

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

Start Hunting!