Because of the form of the user-defined costs, I'm not sure you have full 
control over a constant term, but that doesn't impact the optimization anyway. 
You can certainly implement the quadratic function f(x) = -x^2 + 4x - 4. You 
will simply have to add an offset of 2 to that cost and to the final objective 
function value outside of the optimization.

You can do this with the following parameters:
rhat = 2
k = 0
d = 2
m = 1
C = -1

-- 
Ray Zimmerman
Senior Research Associate
419A Warren Hall, Cornell University, Ithaca, NY 14853
phone: (607) 255-9645




On Sep 17, 2012, at 3:13 PM, Panagis Vovos wrote:

> Dear Ray,
> 
> I mean an quadratic cost function, such as f(x)= - x^2 + 4x - 2. This
> function f(x) has both negative and positive values for positive
> values of x (attached picture).
> 
> Thanks for the help,
> 
> Panagis
> 
> 
> 
> 
> On 17 September 2012 16:20, Ray Zimmerman <[email protected]> wrote:
>> In order to be sure I understand what you are attempting, I think I'd still
>> need an example of the kind of function you are looking for.
>> 
>> --
>> Ray Zimmerman
>> Senior Research Associate
>> 419A Warren Hall, Cornell University, Ithaca, NY 14853
>> phone: (607) 255-9645
>> 
>> 
>> 
>> 
>> On Sep 14, 2012, at 3:40 AM, Panagis Vovos wrote:
>> 
>> Dear Ladies and Gentlemen,
>> 
>> Judging from a reply I received already, I definetely have not made it
>> perfectly clear what I mean by negative-psitive values for my
>> user-defined cost function. I can get a function having both positive
>> and negative values, BUT ONLY IF my variable can take negative values.
>> This is because the user defined cost function is in the form
>> Y=aX^2+bX, which means it has to verify Y=0 for X=0 (cross junction of
>> the two axes). Unfortunatelly, most OPF variables cannot take negative
>> values.
>> 
>> 
>> Thanks again,
>> 
>> Panagis Vovos
>> 
>> 
>> 
>> Dear Ladies and Gentlemen,
>> 
>> I am trying to define my own cost function, that will be added to the
>> regulat MATPOWER OPF cost function, using 5.3.1. However, after
>> simulating (5.27)-(5.31) in Matlab, I am unable to produce a (ideally,
>> quadratic) cost function that will span in both negtive and positive
>> values. The best I can get is a positive or negative (but never both)
>> cost function with a dead band. Does anyone know a way that I can
>> achieve this according to MATPOWER standard approach or do I have to
>> write my own code for the definition of the cost function, derivatives
>> etc?
>> 
>> Thank you for your time,
>> 
>> Panagis Vovos
>> 
>> 
> <fx.jpg>

Reply via email to