Dear Prof. Zimmerman, 1.In the code below, I have generated V between zero and 1.1 while I don't want to have the same value for Vmax and Vmin. In this code they get always the same value. How can I submit the lower value to Vmin and higher values to Vmax (probabilistic)?
2. I don't know why the UOPF is not converged?
define_constants;
warning off;
mpc0 = loadcase('case6ww');
mpc=load2disp(mpc);
for k = 1:5
m=(abs(normrnd(0.5,.2,100,1)));
V = m(1); % generate a random draw of voltages
mpc.bus(1:6, VMIN) = V;
mpc.bus(1:6, VMAX) = V;
offers.P.qty = [200; 150; 180]/10;
offers.P.prc = [30; 40; 50];
bids.P.qty = [70; 70; 70];
bids.P.prc = [100; 100; 100]/1.5;
mkt.OPF = 'AC';
%r = runopf(mpc);
r=runmarket(mpc, offers, bids, mkt)
end
3.I want to have voltage in a range like the following figure. How can I do
this in MATPOWER?
[image: Inline image 1]
Best Wishes
Silvio Miceli
On Thu, Mar 29, 2012 at 19:26, Silvio Miceli <[email protected]>wrote:
>
>
> On Mon, Mar 26, 2012 at 22:10, Ray Zimmerman <[email protected]> wrote:
>
>> My guess is that the OPF is not converging due to unreasonable voltage
>> set points (your code generates voltage values ranging from less than 1e-4
>> to greater than 5 p.u. Make sure you check the value of r.success to
>> check if the OPF converges and use reasonable voltages (e.g 0.95 < V <
>> 1.05). Also, are you sure you want to use an identical voltage at all of
>> the buses? That doesn't seem like a reasonable requirement.
>>
>> --
>> Ray Zimmerman
>> Senior Research Associate
>> 419A Warren Hall, Cornell University, Ithaca, NY 14853
>> phone: (607) 255-9645
>>
>>
>>
>>
>> On Mar 26, 2012, at 11:47 AM, Silvio Miceli wrote:
>>
>> My mean is this:
>>
>> For the following code the results are always the same. Why I have to get
>> the same results by changing voltage limits
>>
>> define_constants;
>> mpc = loadcase('case9');
>> for k = 1:5
>> m=abs((normrnd(1,1,8760,1)));
>> V = m(1); % generate a random draw of voltages
>> mpc.bus(1:6, VMIN) = V;
>> mpc.bus(1:6, VMAX) = V;
>> r = runopf(mpc);
>>
>> end
>>
>>
>> Best Wishes
>>
>> Silvio Miceli
>>
>>
>> On Mon, Mar 26, 2012 at 17:25, Ray Zimmerman <[email protected]> wrote:
>>
>>> Sorry, you are going to have to describe what you are doing in a bit
>>> more detail and ask your question more clearly. Different results between
>>> what and what for the OPF? Same results between what and what for
>>> runmarket? What is the reason for what?
>>>
>>> --
>>> Ray Zimmerman
>>> Senior Research Associate
>>> 419A Warren Hall, Cornell University, Ithaca, NY 14853
>>> phone: (607) 255-9645
>>>
>>>
>>>
>>>
>>> On Mar 26, 2012, at 11:20 AM, Silvio Miceli wrote:
>>>
>>> Dear Ray,
>>>
>>> When I do an OPF with variable voltages I get different results while
>>> for the runmarket I get the same results. runmarket is done underlying an
>>> OPF. What is the reason?
>>>
>>> Best Wishes
>>>
>>> Silvio Miceli
>>>
>>>
>>> On Sun, Mar 25, 2012 at 03:28, Silvio Miceli <[email protected]>wrote:
>>>
>>>> Dear Prof. Zimmerman,
>>>>
>>>> Thank you very much.
>>>>
>>>> Best Wishes
>>>>
>>>> Silvio Miceli
>>>>
>>>>
>>>>
>>>> On Sat, Mar 24, 2012 at 01:44, Ray Zimmerman <[email protected]> wrote:
>>>>
>>>>> As I mentioned before, in MATPOWER's OPF the voltages *are*
>>>>> optimization variables. In other words, they are *output* values that
>>>>> depend on all of the input parameters. If you want to treat the voltages
>>>>> at
>>>>> generator buses as inputs (that you can set randomly according to some
>>>>> distribution), then you will need to set the VMIN and VMAX values at that
>>>>> corresponding bus to the desired value before calling the OPF.
>>>>>
>>>>> Something like this, where randomvoltage() is a function that returns
>>>>> a voltage for each generator bus drawn from some specified distribution
>>>>> and
>>>>> ig is the vector of indexes of generator buses ...
>>>>>
>>>>> mpc = loadcase('mybasecase');
>>>>> for k = 1:10000
>>>>> V = randomvoltage(); % generate a random draw of voltages
>>>>> mpc.bus(ig, VMIN) = V;
>>>>> mpc.bus(ig, VMAX) = V;
>>>>> r = runopf(mpc);
>>>>> % save whatever outputs you want to collect
>>>>> end
>>>>>
>>>>> --
>>>>> Ray Zimmerman
>>>>> Senior Research Associate
>>>>> 419A Warren Hall, Cornell University, Ithaca, NY 14853
>>>>> phone: (607) 255-9645
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Mar 23, 2012, at 7:13 PM, Silvio Miceli wrote:
>>>>>
>>>>> Dear Johnny
>>>>>
>>>>> I want to do a probabilistic OPF by using Monte Carlo. So, I have to
>>>>> load a distribution of voltage at the buses. I think MATPOWER is not able
>>>>> to load variables as optimization variable. If you have an idea please let
>>>>> me know.
>>>>>
>>>>> Best Wishes
>>>>>
>>>>> Silvio Miceli
>>>>>
>>>>>
>>>>> On Fri, Mar 23, 2012 at 23:39, Johnny <[email protected]> wrote:
>>>>>
>>>>>> Silvio Miceli <[email protected]> writes:
>>>>>>
>>>>>> > Dear Shiyang,
>>>>>> >
>>>>>> > I also want to do it by Monte Carlo, but not loads. I want to have a
>>>>>> > distribution of voltage as input. When I load loadcase it gives
>>>>>> error. My mean
>>>>>> > is this:
>>>>>> > I want load variable voltage values in bus matrix. Is it possible?
>>>>>> >
>>>>>>
>>>>>> Silvio,
>>>>>>
>>>>>> I believe the best way to achieve this is to generate the normal
>>>>>> distibution in a script which calls the OPF solver and collect the
>>>>>> results to display as a distribution. So, in the Monte Carlo, you use
>>>>>> stochastic input on a Black Box model and collect stochastic
>>>>>> output. This normally takes some time, but what do you look for
>>>>>> really?
>>>>>>
>>>>>>
>>>>>>
>>>>>> > Best Wishes
>>>>>> >
>>>>>> > Silvio Miceli
>>>>>> >
>>>>>> > On Fri, Mar 23, 2012 at 23:19, 李诗旸 <[email protected]>
>>>>>> wrote:
>>>>>> >
>>>>>> > HI Silvio Miceli,
>>>>>> >
>>>>>> > I think Mr. Zimmerman’s suggestion is the way like Monte Carlo
>>>>>> Method.
>>>>>> > Normally, you may have the distributions of some parameters
>>>>>> (inputs) such
>>>>>> > as loads and active generations, then you could use that way to
>>>>>> get the
>>>>>> > distributions of the optimized voltages (output) numerically.
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > Sincerely
>>>>>> >
>>>>>> > Shiyang Li
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > 发件人: [email protected] [mailto:
>>>>>> > [email protected]] 代表 Silvio Miceli
>>>>>> > 发送时间: 2012年3月24日 4:31
>>>>>> > 收件人: MATPOWER discussion forum; Ray Zimmerman
>>>>>> > 主题: Re: probabilistic voltage
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > I want to a have a distribution of voltage at buses that it is
>>>>>> an
>>>>>> > optimization variable in MATPOWER? These distributions are the
>>>>>> inputs for
>>>>>> > the OPF.
>>>>>> >
>>>>>> > Best Wishes
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > Silvio Miceli
>>>>>> >
>>>>>> > On Fri, Mar 23, 2012 at 21:25, Ray Zimmerman <[email protected]>
>>>>>> wrote:
>>>>>> >
>>>>>> > I'm afraid I don't know what *you* mean. The voltages are
>>>>>> *outputs* of
>>>>>> > MATPOWER's OPF. So what are the input parameters that you would
>>>>>> like to be
>>>>>> > stochastic? Voltage limits?
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > --
>>>>>> >
>>>>>> > Ray Zimmerman
>>>>>> >
>>>>>> > Senior Research Associate
>>>>>> >
>>>>>> > 419A Warren Hall, Cornell University, Ithaca, NY 14853
>>>>>> >
>>>>>> > phone: (607) 255-9645
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > On Mar 23, 2012, at 2:40 PM, Silvio Miceli wrote:
>>>>>> >
>>>>>> > My problem is this I cannot do loadcase. How can I do many, many
>>>>>> > deterministic optimization? If I introduce voltage as x and do
>>>>>> it with a
>>>>>> > FOR?
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > Could you please explain better? I didn't understand. I am
>>>>>> sorry.
>>>>>> >
>>>>>> > Best Wishes
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > Silvio Miceli
>>>>>> >
>>>>>> > On Fri, Mar 23, 2012 at 19:22, Ray Zimmerman <[email protected]>
>>>>>> wrote:
>>>>>> >
>>>>>> > MATPOWER does not implement any stochastic optimization. All of
>>>>>> it's
>>>>>> > variables and parameters are assumed to be deterministic.
>>>>>> However, one
>>>>>> > approach to handling probabilistic parameters is to simply do
>>>>>> many, many
>>>>>> > deterministic optimizations, where each one involves, for each
>>>>>> > probabilistic parameter, drawing a value from the corresponding
>>>>>> > distribution. Such an approach could use MATPOWER's OPF as a
>>>>>> subroutine to
>>>>>> > solve the deterministic sub-problem.
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > --
>>>>>> >
>>>>>> > Ray Zimmerman
>>>>>> >
>>>>>> > Senior Research Associate
>>>>>> >
>>>>>> > 419A Warren Hall, Cornell University, Ithaca, NY 14853
>>>>>> >
>>>>>> > phone: (607) 255-9645
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > On Mar 23, 2012, at 12:42 PM, Silvio Miceli wrote:
>>>>>> >
>>>>>> > Dear Dr. Zimmerman,
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > I want to have probabilistic voltage or reactive power in an
>>>>>> OPF. In other
>>>>>> > words, I want to do OPF with probabilistic variables,e.g.
>>>>>> voltage should be
>>>>>> > a normal distribution of voltage. How can insert this kind of
>>>>>> variables to
>>>>>> > case file of MATPOWER? Is there this possibility in MATPOWER?
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > Best Wishes
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > Silvio Miceli
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>>
>>>>>> --
>>>>>> Johnny
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>>
>
>
<<image.png>>
