ernilesh80

35 Reputation

4 Badges

8 years, 59 days

MaplePrimes Activity


These are replies submitted by ernilesh80

@tomleslie 

Thanks Sir for your help.

 

Regards,

Nilesh

@vv 

Dear Sir, 

All my queries are resolved. Many many thanks for your invaluable help.

 

Thanks and regards,

Nilesh

@vv 

Dear Sir,

You have substituted equality constraint  back into objective function and then derived regular hessian matrix out of it. Then maple Isdefinite function properly worked. So, in this case ( when inequalities are binding at KKT solutions), I don't need to work with a Bordered Hessian. Thanks Sir for guiding this process.

Sir, I have two query with my maple code-

1) suppose If I have two inequalities constraint and one is binding at KKT solution and second constraint is non binding ( ie. working as strict inequality) at KKT solution. So for binding constraint, I would adopt the same procedure as you adopted. But for non binding one, can I drop this constraint from my problem because it is already satisfied at KKT solution?

If my objective function would be linear, then I can safely drop the non binding constraint from my problem but for nonlinear objective function, I am not sure whether non binding constarint( at first order optimal KKT solution)  can be removed from the problem without affecting the result ( optimal solution got from the problem).

2) My second query is - In my worksheet, I have got KKT solution through fsolve command. "fsolve" solves simultaneous equations and provides only one root. Although "Solve" command can gives multiple roots but in my case Solve command is showing executing for many hours and doesn't provide any roots. I have also tried by following Direct Search command to find multiple roots but it also shows evaluating for many hours-

DirectSearch[SolveEquations]([Grad_Z[1] = 0, Grad_Z[2] = 0, Grad_Z[3] = 0, Grad_Z[4] = 0, Grad_Z[5] = 0, Grad_Z[6]*lambda1 = 0], evaluationlimit = 10000, AllSolutions, solutions = 1)

 Is there any way to get multiple roots of the simultaneous equation, so that we can decide which one to select out of it.

 Sir your code helped me in showing that the given kkt solution is a local maxima. Thanks Sir for devoting your precious time in solving my problem.

Thanks and regards,

Nilesh

@Kitonum 

Thanks Sir. Your code is successfully executed and all principal minors are shown in output.

It saves much of my time. Thanks a lot Sir for your time and efforts.

Thanks and Regards,

Nilesh

@Kitonum 

Thanks Sir for sharing the code. Although I am unable to understand this code right now. I am thinking how this code gets all possible combinations of principal minors ( in my 6 by 6 bordered hessian , there are 63 principal minors). Sir, In above code, it gives output in terms of  positive or negative definite but can I also get  sign (positive or negative) of determinant of all possible 63 principal minors? 

I would check with above code and let you know if gets any problem.

Thanks and Regards,

Nilesh 

@vv 

Hi Sir,

Thanks for your early reply. I have stil few queries so let me define my problem in detail-

I have an objective function with one linear inequality constraint. So I have formed a lagrangian function and applied first order optimality condition ( here kuhn tucker condition, shortly known as KKT conditions) to it. At KKT solution, the value of lagrange multiplier is striclyly positive so inequality constraint is binding ( working as an equality constraint) at KKT solution. 

Now, I have to check the second order sufficient condition for local maxima. Since inequality constraint is binding at first order crirical points (at KKT solution) so we have to check the sign of Bordered Hessian and not a regular Hessian. For eg. In my problem- there are five independent variables (T, E1, E2, W1, W2) and one equality constraint. So I have to check sign of (5-1=4) four leading principal minor. For maximization we should have following sign of determinant-

H6 <0, H5>0, H4<0 and H3>0

(here H6 denote the determinant of 6 by 6 principal minor. Similiarly, H5, H4, H3 can be defined.)

But If I provide a regular 6 by 6 matrix to maple and issue a command LinearAlgebra:-IsDefinite(A, 'query' = 'negative_semidefinite'); it would check following inequality for negative definite-

H1<0,   H2>0,  H3<0, H4>0, H5<0 and H6>0

These inequalities are entirely different from above inequalities. So In my openion, LinearAlgebra:-IsDefinite(A, 'query' = 'negative_semidefinite'); command is not suitable to check the negative definite property of Bordered hessian. This command is only suitable for checking negative definite property of a regular Hessian matrix.

So I didn't use this built in command and checked the sign of determinant of leading principal minor through determinant command. I have found the following result-

H6 <0, H5>0, H4=0 and H3=0

So although H6 and H5 satisfy the condition of negative definite but H4 and H3 are equal to zero. So the negative definite test failed. Now I have to check with negative semidefinite test, which requires checking of all principal minors of a 6 by 6 matrix. To check it manually, one by one is a tedious task.

Although,  taro 365 has suggested "Minor" command for this but it is not suitable in my context. For eg. to get a 3rd order principal minor, I have to remove any three row and same three column from original matrix  and then calculate its determinant but "Minor" command in maple allows only one row and one column removal at a time. Minor command can't remove two or more rows and columns at a time.

I have attached my problem in maplle worksheet. I have also enclosed a small example of 3 by 3 matrix which demonstrate all possible principal minors of a 3 by 3 matrix. There are 7 principal minors for a 3 by 3 matrix. So in my case, 6 by 6 matrix contains many principal minors (63) and checking the sign of each ,one by one is very tedious task

Thanks for your attentive consideration to my problem. Please help in this issue.

Thanks and Regards,

Nilesh 

borderedhessian-question.mw

 

@John Fredsted 1797

Hi Sir,

If objective function contains equality constraint then we test Bordered Hessian (instead of regular hessian) to check local maxima/minima. Sir, can you guide how to compute bordered hessian in maple.

Thanks and Regards,

Nilesh

 

@Preben Alsholm 

Problem is resolved now.

Many Thanks Sir.

Regards,

Nilesh

@Preben Alsholm 

Thanks Sir for pointing out mistake.

Nilesh

@Preben Alsholm 

Dear Sir,

I have made changes as per your suggestion. I have still some issue with my maple code-

After execution of maple code-

1) How can I read the contents of the both array - pd_arr and id_arr. I tried to export the contenets of array by ( right click- Export as- Excel) but it gives an error- "Export-invalid input".

2) The first elements of the best_value array (best_value[1]) is updated but the remaining four elements ( second, third, fourth and five) are not updated and just shows (0,0,0,0). There might be still some problem ini maple code.

Sir, can you help me in above issues. updated maple worksheet is enclosed.

invalid-if-stat-term-error_updated.mw

Thanks and Regards,

Nilesh

@Preben Alsholm 

 

Ok. I didn't know whether an array cab be defined without specifying its size. Thanks Sir for helping me out.

Regards,

Nilesh

@Preben Alsholm 

Thanks Sir. You have pi pointed all my misttakes in maple code. I corrected it and now maple code shows executing. You said that there is at least one more proble "Array index out of range". Please guide how I can resolve it.

 

Many many thanks Sir.

 

Regards,

NIlesh

@Rouben Rostamian  

Thanks a lot Sir for your help.

Regards,

Nilesh

 

 

@tomleslie 

Thanks for code sharing.it would help me a lot in my work.

Thanks a lot Sir.

Regards,

Nilesh

@Preben Alsholm 

Thanks for information. I would check try command.

Regards,

 

Nilesh

 

 

1 2 3 Page 1 of 3