I want to use gjh solver to get jocobian for my problem constraint...plz help me

162 views
Skip to first unread message

amit garg

unread,
Apr 7, 2011, 2:02:18 AM4/7/11
to am...@googlegroups.com
Dear All,
              I am a Research scholar and I need ur help to calculate derivative using AMPL.
                                       I have two variable P(V,theta) and Q(V,theta) which are the function of  V, theta variable . I want to calculate the dP/dV, dP/dtheta, dQ/dV, dQ/dtheta.
          I found some information about the gjh solver but i don't know how to use it in my program solving. I am using Window7 operating system in my computer. and using LOQO solver to solve my optimization problem.

--
Amit Kumar Garg
M.Tech, IIT Roorkee

Robert Fourer

unread,
Apr 7, 2011, 10:29:34 AM4/7/11
to am...@googlegroups.com

After you solve your optimization problem with LOQO, gjh can find the derivatives of the objective function and the constraint functions with respect to the variables that appear in those functions.  So if you have (just as an example) a constraint like "P(V,theta) >= 0" where P(V,theta) is actually a nonlinear AMPL expression in terms of variables representing V and theta, then ghj can produce derivatives of the expression with respect to those variables.  If necessary you can create an artificial objective or constraint for this purpose.

 

Since you already are using LOQO I guess you have an AMPL model.  To get more help you might want to describe your needs in terms of the AMPL expressions rather than in terms of less formal mathematical expressions like "variable P(V,theta)."

 

Bob Fourer

4...@ampl.com

 

 

From: am...@googlegroups.com [mailto:am...@googlegroups.com]

On Behalf Of amit garg
Sent: Thursday, April 07, 2011 1:02 AM
To: am...@googlegroups.com
Subject: [AMPL 4530] I want to use gjh solver to get jocobian for my problem constraint...plz help me

amit garg

unread,
Apr 8, 2011, 3:46:12 AM4/8/11
to am...@googlegroups.com
thank you very much sir ,
                                 Sir I got how to find the jocobian using gjh but sir i m not able to save these jocobian vales as parameter  . what will be the write command for saving my jocobians.
 
And sir in my problem there is a objective function and no. of constraints as paste below. but I am interested only the jocobian of first three constraints not for objective function and other constraints.
 
 
                
minimize total_shed: sum{m in nbus : bus_type[m] == 0}(z[m]);
subject to P_genbus{m in nbus : bus_type[m] == 1}:  
                         (P[m]-(P0[m]+kfactor*P0[m]))=0;#Active power balanced equation for PV buses.
subject to P_loadbus{m in nbus : bus_type[m] == 0}:
                                 (P[m]-(P0[m]+z[m]))=0;#Active power balanced equation for PQ buses.
subject to Q_loadbus{m in nbus : bus_type[m] == 0}:
                                (Q[m]-M[m,m]*(P0[m]+z[m]))=0; #reactive power balanced equation for PQ buses.
subject to load_shed_limit{m in nbus : bus_type[m] == 0}:   #to ensure that load is only allow to shed.
                   P0[m] <= (P0[m]+z[m]) <= 0;
subject to Vi{m in nbus}: V_min[bus_type[m]] <= V[m] <= V_max[bus_type[m]]; # voltage limit
subject to Adeltak{k in n}: -1.57 <= Adelta[k] <= 1.57;                     # angle limit
subject to total_shed1 : sum{m in nbus : bus_type[m] == 0}(z[m]) >= S_min;
  
in above problem P and Q are function of delta and V.
 
 
And One other enquiry :
                                       Sir I have a another similar problem in which i have a bound constraint. And I want to optimize that constraint and objective function both simultaneously.
 
With Regards
Amit Garg


 

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to am...@googlegroups.com.
To unsubscribe from this group, send email to ampl+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ampl?hl=en.

Robert Fourer

unread,
Apr 11, 2011, 11:33:31 AM4/11/11
to am...@googlegroups.com

The gjh "solver" is only set up to return all the derivative values, in parameters g, J, and H as described by www.netlib.org/ampl/solvers/examples/README.gjh.  You can determine the variables and constraints to which these values belong by looking at the builtin parameters _varname and _conname.  You can display any of the values in g, J, and H, or write them to files, or assign their values to other parameters using "let" statements, just as for any other kind of AMPL parameters; there is no special command for this. 

 

So if you only want jacobian values for the first three constraints then you can extract them from J and ignore the other values.  Or if you are ambitious, you can download the source code for gjh.c from netlib and modify it to return only certain values.

 

> I have a another similar problem in which i have a bound constraint.

> And I want to optimize that constraint and objective function both

> simultaneously.

 

You can only optimize one objective at a time.  If you have two criteria to optimize then you need to either optimize one and fix that and then optimize the other, or else combine the two into one objective such as by taking a weight times the first one plus a weight times the second.

 

Bob Fourer

4...@ampl.com

 

 

From: am...@googlegroups.com [mailto:am...@googlegroups.com]

On Behalf Of amit garg
Sent: Friday, April 08, 2011 2:46 AM
To: am...@googlegroups.com
Subject: Re: [AMPL 4535] I want to use gjh solver to get jocobian for my problem constraint...plz help me

amit garg

unread,
Apr 11, 2011, 5:13:21 PM4/11/11
to am...@googlegroups.com
thank u sir;
             As u describe here is really help me in my work. But when i m optimizing both the problem alternatively by using "Repeat " and fix and unfix command but my criteria to terminate the loop is when both optimization function will be minimize so in this case how i can define the problem. can u plz send me any example rather than "cut" and "Reduced_cost" example from where i can understand the syntax and way of writting of my problem.
 
with regards
Amit Garg 

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to am...@googlegroups.com.
To unsubscribe from this group, send email to ampl+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ampl?hl=en.
Reply all
Reply to author
Forward
0 new messages