Re: Run PF but it does not run OPF

2017-11-21 Thread Charalambos Ioannou
Dear Ray,

Thank you so much for your help.

Regards,

Charalampos

On 21 Nov 2017, at 15:17, Ray Zimmerman 
> wrote:

The total load in your system is 643.3 MW, but your generators have maximum 
active power outputs of 0 and 15 MW, respectively. Min and max reactive output 
from both are also zero. Clearly there is no feasible solution to such a 
problem. The OPF solves just fine if you use appropriate values for the 
generator limits.

Ray


On Nov 20, 2017, at 12:58 PM, Charalambos Ioannou 
> wrote:

Hello everyone,

The following shows a case study which i am trying to run optimal power flow. 
It works perfectly for power flow but it does not converge the system for 
optimal power flow.
Please can you help me??


function mpc = IsleExample()

%% MATPOWER Case Format : Version 2
mpc.version = '2';
%%-  Power Flow Data  -%%
%% system MVA base
mpc.baseMVA = 100;
%% bus data
% bus_i  type Pd  Qd Gs Bs area Vm Va baseKV zone Vmax Vmin
mpc.bus = [
1   3   30.4   14.7   0   0   1   1   0   132 1   1.060.94;
2   1   25.1   3.2   0   0   1   1   0   132 1   1.060.94;
3   1   25.1   3.2   0   0   1   1   0   132 1   1.060.94;
4   1   113   54.8   0   0   1   1   0   132 1   1.060.94;
5   1   113   54.8   0   0   1   1   0   132 1   1.060.94;
6   1   113   54.8   0   0   1   1   0   33  1   1.060.94;
7   1   5.76   2.8   0   0   1   1   0   33  1   1.060.94;
8   1   0   0   0   0   1   1   0   33  1   1.060.94;
9   1   0   0   0   0   1   1   0   33  1   1.060.94;
10  1   17.01   8.23   0   0   1   1   0   33  1   1.060.94;
11  1   113   54.8   0   0   1   1   0   33  1   1.060.94;
12  1   19.2   9.3   0   0   1   1   0   33  1   1.060.94;
13  1   0   0   0   0   1   1   0   33  1   1.060.94;
14  1   5.6   2.9   0   0   1   1   0   33  1   1.060.94;
15  1   0   0   0   0   1   1   0   33  1   1.060.94;
16  1   5.76   2.8   0   0   1   1   0   33  1   1.060.94;
17  1   0   0   0   0   1   1   0   33  1   1.060.94;
18  1   26.8   13   0   0   1   1   0   33  1   1.060.94;
19  1   0   0   0   0   1   1   0   33  1   1.060.94;
20  1   0   0   0   0   1   1   0   33  1   1.060.94;
21  1   0   0   0   0   1   1   0   33  1   1.060.94;
22  1   8.3   4   0   0   1   1   0   33  1   1.060.94;
23  1   0   0   0   0   1   1   0   33  1   1.060.94;
24  1   10.7   5.2   0   0   1   1   0   33  1   1.060.94;
25  2   0   0   0   0   1   1   0   33  1   1.060.94;
26  1   0   0   0   0   1   1   0   33  1   1.060.94;
27  1   11.6   5.6   0   0   1   1   0   33  1   1.060.94;
];
%% Generator Data
% bus  Pg Qg Qmax Qmin Vg mBase status Pmax Pmin Pc1 Pc2 Qc1min Qc1max Qc2min 
Qc2max ramp_agc ramp_10 ramp_30 ramp_q apf
mpc.gen = [
1   0   0   0   0   1   100 1   0   0   0   0   0   0   0   0   0   0   0   
0   0;   %Slack Bus
25  0   0   0   0   1   100 1   15  0   0   0   0   0   0   0   0   0   0   
0   0;%Natural Gas Generator with 15 MW maximum capacity
   ];
%% branch data
% fbus  tbus r  x b rateA rateB rateC ratio angle status angmin angmax
mpc.branch = [
1   2   0.0008  0.0013  0.0409  0   0   0   0   0   1   -360360;
1   3   0.0007  0.0012  0.0391  0   0   0   0   0   1   -360360;
4   1   0.0101  0.0181  0.2147  0   0   0   0   0   1   -360360;
2   5   0.0146  0.0303  0.0830  0   0   0   0   0   1   -360360;
3   5   0.0145  0.0303  0.0808  0   0   0   0   0   1   -360360;
4   5   0.0019  0.0101  0.0174  0   0   0   0   0   1   -360360;
4   5   0.0026  0.0078  0.0184  0   0   0   0   0   1   -360360;
5   6   0   0.2482  0   0   0   0   0.95   0   1   -360360;
5   6   0   0.2501  0   0   0   0   0.95   0   1   -360360;
6   7   0.0398  0.1333  0.0002  0   0   0   0   0   1   -360360;
6   7   0.0389  0.1302  0.0002  0   0   0   0   0   1   -360360;
7   8   0.0315  0.1054  0.0001  0   0   0   0   0   1   -360360;
10  8   0.0093  0.0310  0.  0   0   0   0   0   1   -360360;
7   9   0.0398  0.1333  0.0002  0   0   0   0   0   1   -360360;
10  9   0.0093  0.0310  0.  0   0   0   0   0   1   -360360;
4   11  0   0.2813  0   0   0   0   0.95   0   1   -360360;
4   11  0   0.2771  0   0   0   0   0.95   0   1   -360360;
11  6   0.0944  0.1853  0.0002  0   0   0   0   0   1   -360360;
11  6   0.0912  0.1790  0.0002  0   0   0   0   0   1   -360360;
11  12  0.0087  0.0037  0.0002  0   0   0   0   0   1   -360360;
11  12  0.0087  0.0037  0.0002  0   0   0   0   0   1   -360360;
12  13  0.1005  0.2384  0.0010  0   0   0   0   0   1   -360360;
14  13  0.0672  0.1601  0.0002  0   

Re: AC OPF vs DC OPF in MOST

2017-11-21 Thread Mohammed Alhajri
Actually our target is to do an economic dispatch for a given network in
presence of Solar PV Power

We want to do the ED for multiple periods,24hr,  and we want to use AC OPF
to compare the simulation results with the practical results


is there any way to do this task?

بتاريخ ٢٠١٧/١١/٢١ ٨:١٧ م، كتب "Mohammed Alhajri" :

> Thank you Ray for your clarification
>
> بتاريخ ٢٠١٧/١١/٢١ ٧:٠٦ م، كتب "Ray Zimmerman" :
>
>> From the Introduction section in the MOST User’s Manual
>>  …
>>
>> *While the problem formulation is general and incorporates a full
>> nonlinear AC network model, the current implementation is limited to DC
>> power flow modeling of the network. Some work has been done on an AC
>> implementation, but it is not yet ready for release.*
>>
>> Maybe someday … but currently, MOST is limited to a DC model of the
>> network.
>>
>> — Ray
>>
>>
>>
>> On Nov 19, 2017, at 12:42 PM, Mohammed Alhajri  wrote:
>>
>> Hello all
>>
>> i wanted to compare between AC OPF results and DC OPF results using MOST
>>
>> My code for AC OPF is:
>>
>> 
>>
>> define_constants;
>> verbose = 1;
>> mpopt = mpoption('verbose', verbose);
>> mpopt = mpoption(mpopt, 'out.gen', 1);
>> mpopt = mpoption(mpopt, 'model', 'AC');
>> mpopt = mpoption(mpopt, 'opf.ac.solver', 'MIPS');
>> mpopt = mpoption(mpopt, 'most.solver', 'MIPS');
>> if ~verbose
>> mpopt = mpoption(mpopt, 'out.all', 0);
>> end
>>
>> casefile = 'ex_case3b';
>> mpc = loadcase(casefile);
>> xgd = loadxgendata('ex_xgd_ramp', mpc);
>> profiles = getprofiles('ex_load_profile');
>> nt = size(profiles(1).values, 1);   % number of periods
>>
>> mdi = loadmd(mpc, nt, xgd, [], [], profiles);
>> mdo = most(mdi, mpopt);
>> EPg1 = mdo.results.ExpectedDispatch;% active generation
>> Elam1 = mdo.results.GenPrices;  % nodal energy price
>> if verbose
>> most_summary(mdo);
>> end
>>
>>
>> ++
>>
>> For DC OPF
>>
>> ++
>>
>> %% set up options
>> define_constants;
>> verbose = 1;
>> mpopt = mpoption('verbose', verbose);
>> mpopt = mpoption(mpopt, 'out.gen', 1);
>> mpopt = mpoption(mpopt, 'model', 'DC');
>> mpopt = mpoption(mpopt, 'opf.dc.solver', 'MIPS');
>> mpopt = mpoption(mpopt, 'most.solver', 'MIPS');
>> mpopt = mpoption(mpopt, 'most.dc_model', 1);
>> if ~verbose
>> mpopt = mpoption(mpopt, 'out.all', 0);
>> end
>>
>> casefile = 'ex_case3b';
>> mpc = loadcase(casefile);
>> xgd = loadxgendata('ex_xgd_ramp', mpc);
>> profiles = getprofiles('ex_load_profile');
>> nt = size(profiles(1).values, 1);   % number of periods
>>
>> %%-  Multiperiod DC OPF (w/ramp)  -
>> mdi = loadmd(mpc, nt, xgd, [], [], profiles);
>> mdo = most(mdi, mpopt);
>> EPg1 = mdo.results.ExpectedDispatch;% active generation
>> Elam1 = mdo.results.GenPrices;  % nodal energy price
>> if verbose
>> most_summary(mdo);
>> end
>>
>> +++
>>
>>
>> i suppose to get in the results, isn't it?
>>
>> the results are attached, i don't find any difference between them!
>> 
>>
>>
>>


Re: AC OPF vs DC OPF in MOST

2017-11-21 Thread Mohammed Alhajri
Thank you Ray for your clarification

بتاريخ ٢٠١٧/١١/٢١ ٧:٠٦ م، كتب "Ray Zimmerman" :

> From the Introduction section in the MOST User’s Manual
>  …
>
> *While the problem formulation is general and incorporates a full
> nonlinear AC network model, the current implementation is limited to DC
> power flow modeling of the network. Some work has been done on an AC
> implementation, but it is not yet ready for release.*
>
> Maybe someday … but currently, MOST is limited to a DC model of the
> network.
>
> — Ray
>
>
>
> On Nov 19, 2017, at 12:42 PM, Mohammed Alhajri  wrote:
>
> Hello all
>
> i wanted to compare between AC OPF results and DC OPF results using MOST
>
> My code for AC OPF is:
>
> 
>
> define_constants;
> verbose = 1;
> mpopt = mpoption('verbose', verbose);
> mpopt = mpoption(mpopt, 'out.gen', 1);
> mpopt = mpoption(mpopt, 'model', 'AC');
> mpopt = mpoption(mpopt, 'opf.ac.solver', 'MIPS');
> mpopt = mpoption(mpopt, 'most.solver', 'MIPS');
> if ~verbose
> mpopt = mpoption(mpopt, 'out.all', 0);
> end
>
> casefile = 'ex_case3b';
> mpc = loadcase(casefile);
> xgd = loadxgendata('ex_xgd_ramp', mpc);
> profiles = getprofiles('ex_load_profile');
> nt = size(profiles(1).values, 1);   % number of periods
>
> mdi = loadmd(mpc, nt, xgd, [], [], profiles);
> mdo = most(mdi, mpopt);
> EPg1 = mdo.results.ExpectedDispatch;% active generation
> Elam1 = mdo.results.GenPrices;  % nodal energy price
> if verbose
> most_summary(mdo);
> end
>
>
> ++
>
> For DC OPF
>
> ++
>
> %% set up options
> define_constants;
> verbose = 1;
> mpopt = mpoption('verbose', verbose);
> mpopt = mpoption(mpopt, 'out.gen', 1);
> mpopt = mpoption(mpopt, 'model', 'DC');
> mpopt = mpoption(mpopt, 'opf.dc.solver', 'MIPS');
> mpopt = mpoption(mpopt, 'most.solver', 'MIPS');
> mpopt = mpoption(mpopt, 'most.dc_model', 1);
> if ~verbose
> mpopt = mpoption(mpopt, 'out.all', 0);
> end
>
> casefile = 'ex_case3b';
> mpc = loadcase(casefile);
> xgd = loadxgendata('ex_xgd_ramp', mpc);
> profiles = getprofiles('ex_load_profile');
> nt = size(profiles(1).values, 1);   % number of periods
>
> %%-  Multiperiod DC OPF (w/ramp)  -
> mdi = loadmd(mpc, nt, xgd, [], [], profiles);
> mdo = most(mdi, mpopt);
> EPg1 = mdo.results.ExpectedDispatch;% active generation
> Elam1 = mdo.results.GenPrices;  % nodal energy price
> if verbose
> most_summary(mdo);
> end
>
> +++
>
>
> i suppose to get in the results, isn't it?
>
> the results are attached, i don't find any difference between them!
> 
>
>
>


Re: Update runpf to formula voltage deviation, not PLOSS

2017-11-21 Thread Ray Zimmerman
I’m afraid I don’t understand your code example (see here 
 for the 
calling syntax options for runpf), but if you want to see the deviations of bus 
voltages from 1 p.u. in, say, the results of a power flow, you can simply do 
something like …

define_constants;
r = runpf('case9');
dV = abs(r.bus(:, VM) - 1)

— Ray


> On Nov 21, 2017, at 10:27 AM, Sabhan Kanata  wrote:
> 
> 
> 
> Dear Ray Zimmerman,
> 
> 
> if function [PLOSS] = runpf(casename,AA)
> To find the value of the function of the voltage deviation on the load bus : 
> deviation voltage = (IVi-1.0I) 
> 
> how to update runpf coding?
> 
> Thank you
> Sabhan K



Re: delivery of reactive power depending on voltage given by a curve

2017-11-21 Thread Ray Zimmerman
Yes. The current development version of MATPOWER on GitHub 
 includes capabilities for adding 
user-defined nonlinear constraints. See Sections 6.3.2 and 7.1.2 in the 
corresponding User’s Manual (PDF linked here 
). You 
probably also want to look at the example from the OPF testing code (e.g. 
t_opf_mips) that is mentioned in 7.1.2, just to see a working example of the 
syntax.

Let us know how it works.

   Ray


> On Nov 21, 2017, at 5:11 AM, Weber, Jens  wrote:
> 
> Hello everyone,
>  
> i would like to  simulate a special Q(V)-control-behavior of a generator.
> This means delivery of reactive power depending on the actual bus voltage 
> given by a Q(V)-curve similar to this picture:
>  
> http://patentimages.storage.googleapis.com/DE102013105444A1/DE102013105444A1_0018.png
>  
> 
>  
> Is there a way to implement this behavior in MATPOWER OPF?
>  
> Thanks.
>  
>  
> Regards,
>  
> Jens



Update runpf to formula voltage deviation, not PLOSS

2017-11-21 Thread Sabhan Kanata


Dear Ray Zimmerman,

if function [PLOSS] = runpf(casename,AA)To find the value of the function of 
the voltage deviation on the load bus : deviation voltage = (IVi-1.0I) 

how to update runpf coding?
Thank youSabhan K


Re: Run PF but it does not run OPF

2017-11-21 Thread Ray Zimmerman
The total load in your system is 643.3 MW, but your generators have maximum 
active power outputs of 0 and 15 MW, respectively. Min and max reactive output 
from both are also zero. Clearly there is no feasible solution to such a 
problem. The OPF solves just fine if you use appropriate values for the 
generator limits.

Ray


> On Nov 20, 2017, at 12:58 PM, Charalambos Ioannou  
> wrote:
> 
> Hello everyone, 
> 
> The following shows a case study which i am trying to run optimal power flow. 
> It works perfectly for power flow but it does not converge the system for 
> optimal power flow. 
> Please can you help me??
> 
> function mpc = IsleExample()
> 
> %% MATPOWER Case Format : Version 2
> mpc.version = '2'; 
> %%-  Power Flow Data  -%% 
> %% system MVA base 
> mpc.baseMVA = 100; 
> %% bus data 
> % bus_i  type Pd  Qd Gs Bs
> area Vm
> Va baseKV
> zone Vmax
> Vmin 
> mpc.bus = [
> 1   3   30.4   14.7   0   0   1   1   0   132 1   1.060.94;
> 2   1   25.1   3.2   0   0   1   1   0   132 1   1.060.94;
> 3   1   25.1   3.2   0   0   1   1   0   132 1   1.060.94;
> 4   1   113   54.8   0   0   1   1   0   132 1   1.060.94;
> 5   1   113   54.8   0   0   1   1   0   132 1   1.060.94;
> 6   1   113   54.8   0   0   1   1   0   33  1   1.060.94;
> 7   1   5.76   2.8   0   0   1   1   0   33  1   1.060.94;
> 8   1   0   0   0   0   1   1   0   33  1   1.060.94;
> 9   1   0   0   0   0   1   1   0   33  1   1.060.94;
> 10  1   17.01   8.23   0   0   1   1   0   33  1   1.060.94;
> 11  1   113   54.8   0   0   1   1   0   33  1   1.060.94;
> 12  1   19.2   9.3   0   0   1   1   0   33  1   1.060.94;
> 13  1   0   0   0   0   1   1   0   33  1   1.060.94;
> 14  1   5.6   2.9   0   0   1   1   0   33  1   1.060.94;
> 15  1   0   0   0   0   1   1   0   33  1   1.060.94;
> 16  1   5.76   2.8   0   0   1   1   0   33  1   1.060.94;
> 17  1   0   0   0   0   1   1   0   33  1   1.060.94;
> 18  1   26.8   13   0   0   1   1   0   33  1   1.060.94;
> 19  1   0   0   0   0   1   1   0   33  1   1.060.94;
> 20  1   0   0   0   0   1   1   0   33  1   1.060.94;
> 21  1   0   0   0   0   1   1   0   33  1   1.060.94;
> 22  1   8.3   4   0   0   1   1   0   33  1   1.060.94;
> 23  1   0   0   0   0   1   1   0   33  1   1.060.94;
> 24  1   10.7   5.2   0   0   1   1   0   33  1   1.060.94;
> 25  2   0   0   0   0   1   1   0   33  1   1.060.94;
> 26  1   0   0   0   0   1   1   0   33  1   1.060.94;
> 27  1   11.6   5.6   0   0   1   1   0   33  1   1.060.94;
> ]; 
> %% Generator Data 
> % bus  Pg Qg Qmax
> Qmin Vg
> mBase status
> Pmax Pmin
> Pc1 Pc2
> Qc1min Qc1max
> Qc2min Qc2max
> ramp_agc ramp_10
> ramp_30 ramp_q
> apf
> mpc.gen = [
> 1   0   0   0   0   1   100 1   0   0   0   0   0   0   0   0   0   0   0 
>   0   0;   %Slack Bus 
> 25  0   0   0   0   1   100 1   15  0   0   0   0   0   0   0   0   0   0 
>   0   0;%Natural Gas Generator with 15 MW maximum capacity 
>]; 
> %% branch data 
> % fbus  tbus r  x b rateA
> rateB rateC
> ratio angle
> status angmin
> angmax 
> mpc.branch = [
> 1   2   0.0008  0.0013  0.0409  0   0   0   0   0   1   -360360;
> 1   3   0.0007  0.0012  0.0391  0   0   0   0   0   1   -360360;
> 4   1   0.0101  0.0181  0.2147  0   0   0   0   0   1   -360360;
> 2   5   0.0146  0.0303  0.0830  0   0   0   0   0   1   -360360;
> 3   5   0.0145  0.0303  0.0808  0   0   0   0   0   1   -360360;
> 4   5   0.0019  0.0101  0.0174  0   0   0   0   0   1   -360360;
> 4   5   0.0026  0.0078  0.0184  0   0   0   0   0   1   -360360;
> 5   6   0   0.2482  0   0   0   0   0.95   0   1   -360360;
> 5   6   0   0.2501  0   0   0   0   0.95   0   1   -360360;
> 6   7   0.0398  0.1333  0.0002  0   0   0   0   0   1   -360360;
> 6   7   0.0389  0.1302  0.0002  0   0   0   0   0   1   -360360;
> 7   8   0.0315  0.1054  0.0001  0   0   0   0   0   1   -360360;
> 10  8   0.0093  0.0310  0.  0   0   0   0   0   1   -360360;
> 7   9   0.0398  0.1333  0.0002  0   0   0   0   0   1   -360360;
> 10  9   0.0093  0.0310  0.  0   0   0   0   0   1   -360360;
> 4   11  0   0.2813  0   0   0   0   0.95   0   1   -360360;
> 4   11  0   0.2771  0   0   0   0   0.95   0   1   -360360;
> 11  6   0.0944  0.1853  0.0002  0   0   0   0   0   1   -360360;
> 11  6   0.0912  0.1790  0.0002  0   0   0   0   0   1   -360360;
> 11  12  0.0087  0.0037  0.0002  0   0   0   0   0   1   -360360;
> 11  12  0.0087  0.0037  0.0002  0   0   0   0   0   1   -360360;
> 12  13  0.1005  0.2384  0.0010  0   0   0   0   0   1   -360360;
> 14  13  0.0672  

Re: Multiple Slack bus

2017-11-21 Thread Ray Zimmerman
No, MATPOWER does not currently implement distributed slack.

Ray


> On Nov 20, 2017, at 7:01 AM, Ahmad Sadiq Abubakar 
>  wrote:
> 
> Dear all,
> 
> Can I run power with multiple slack bus in matpower?
> 
> -- 
> Engr. AHMAD, Abubakar Sadiq
> PhD Student
> Electrical Engineering.
> Bayero University, Kano. Nigeria.
> OR
> Lecturer
> Electrical and Electronics Engineering,
> Federal University of Technology,
> P.M.B, 65, Minna.
> Nigeria.
> +2347068043665



Re: AC OPF vs DC OPF in MOST

2017-11-21 Thread Ray Zimmerman
>From the Introduction section in the MOST User’s Manual 
> …

While the problem formulation is general and incorporates a full nonlinear AC 
network model, the current implementation is limited to DC power flow modeling 
of the network. Some work has been done on an AC implementation, but it is not 
yet ready for release.

Maybe someday … but currently, MOST is limited to a DC model of the network.

— Ray



> On Nov 19, 2017, at 12:42 PM, Mohammed Alhajri  wrote:
> 
> Hello all
> 
> i wanted to compare between AC OPF results and DC OPF results using MOST
> 
> My code for AC OPF is:
> 
> 
> 
> define_constants;
> verbose = 1;
> mpopt = mpoption('verbose', verbose);
> mpopt = mpoption(mpopt, 'out.gen', 1);
> mpopt = mpoption(mpopt, 'model', 'AC');
> mpopt = mpoption(mpopt, 'opf.ac.solver', 'MIPS');
> mpopt = mpoption(mpopt, 'most.solver', 'MIPS');
> if ~verbose
> mpopt = mpoption(mpopt, 'out.all', 0);
> end
> 
> casefile = 'ex_case3b';
> mpc = loadcase(casefile);
> xgd = loadxgendata('ex_xgd_ramp', mpc);
> profiles = getprofiles('ex_load_profile');
> nt = size(profiles(1).values, 1);   % number of periods
> 
> mdi = loadmd(mpc, nt, xgd, [], [], profiles);
> mdo = most(mdi, mpopt);
> EPg1 = mdo.results.ExpectedDispatch;% active generation
> Elam1 = mdo.results.GenPrices;  % nodal energy price
> if verbose
> most_summary(mdo);
> end
> 
> 
> ++
> 
> For DC OPF
> 
> ++
> 
> %% set up options
> define_constants;
> verbose = 1;
> mpopt = mpoption('verbose', verbose);
> mpopt = mpoption(mpopt, 'out.gen', 1);
> mpopt = mpoption(mpopt, 'model', 'DC');
> mpopt = mpoption(mpopt, 'opf.dc.solver', 'MIPS');
> mpopt = mpoption(mpopt, 'most.solver', 'MIPS');
> mpopt = mpoption(mpopt, 'most.dc_model', 1);
> if ~verbose
> mpopt = mpoption(mpopt, 'out.all', 0);
> end
> 
> casefile = 'ex_case3b';
> mpc = loadcase(casefile);
> xgd = loadxgendata('ex_xgd_ramp', mpc);
> profiles = getprofiles('ex_load_profile');
> nt = size(profiles(1).values, 1);   % number of periods
> 
> %%-  Multiperiod DC OPF (w/ramp)  -
> mdi = loadmd(mpc, nt, xgd, [], [], profiles);
> mdo = most(mdi, mpopt);
> EPg1 = mdo.results.ExpectedDispatch;% active generation
> Elam1 = mdo.results.GenPrices;  % nodal energy price
> if verbose
> most_summary(mdo);
> end
> 
> +++
> 
> 
> i suppose to get in the results, isn't it?
> 
> the results are attached, i don't find any difference between them! 
> 



Re: OPF convergence issue with piecewise linear cost

2017-11-21 Thread Ray Zimmerman
Have you tried simply using a different solver? It could also be a problem with 
the starting point, so you might try setting the opf.init_from_mpc option to 1 
and possibly even solve the power flow problem first and use it’s solution as 
the starting point. E.g.

mpopt = mpoption('opf.init_from_mpc', 1);
pf = runpf(mpc);
r = runopf(mpc, mpopt);

— Ray


> On Nov 21, 2017, at 4:47 AM, Gamze Dogan  wrote:
> 
> 
> Dear all,
> 
> I wanted to compare the results of the OPF with the two types of model for 
> the generator costs (polynomial and piecewise linear cost).
> 
> So first, I launched an OPF with polynomial cost which converged, then I 
> launched one with linear cost and it does not converge.
> 
> I know that my formulation of the linear cost is correct as it has already 
> converged for several cases, but for some it does not.
> 
> As the first OPF has converged, it means that there is an electrical solution 
> to my problem, but with linear cost it seem that the OPF cannot verify the 
> constraints on the cost function (minimal f(x)).
> 
> I suppose that there is a way to make it converge, do you have any idea how?
> 
> Thank you for your time,
> 
> Gamze
> 
> 
> 



Re: How to Obtain Electric Current in branches with Zero Loss Indication

2017-11-21 Thread Ray Zimmerman
You can compute the complex currents directly from the power and voltage. The 
following code works for cases with consecutively numbered buses, otherwise you 
need to convert to internal bus numbering using ext2int first.

define_constants;
r = runpf('case9');
j = sqrt(-1);
Sf = (r.branch(:, PF) + j * r.branch(:, QF)) / r.baseMVA;
St = (r.branch(:, PT) + j * r.branch(:, QT)) / r.baseMVA;
V = r.bus(:, VM) .* exp(j * r.bus(:, VA) * pi/180);
If = conj(Sf ./ V);
It = conj(St ./ V);

— Ray


> On Nov 17, 2017, at 12:52 PM, Andrey Vieira  wrote:
> 
> I need to get the electric current in each of the parts of certain cases ieee 
> (for example 84 buses) after the load flow simulation. One of the ways is by 
> means of the electrical losses in each of the branches. It turns out that 
> there are cases (like the 84 buses) in which the indication of the losses in 
> some branches is null. To see 84 buses example below (branches 1 - 2  and 2 - 
> 3).
> How to obtain the current of the branches where the indication of losses is 
> zero?
> 
> 
> | Branch Data 
>  |
> 
> Brnch   From   ToFrom Bus Injection   To Bus Injection Loss (I^2 * Z) 
>  
>   # BusBusP (MW)   Q (MVAr)   P (MW)   Q (MVAr)   P (MW)   Q 
> (MVAr)
> -  -  -            
> 
>1  1  2  0.00  0.00  0.00  0.00 0.000  0.00
>2  2  3 -0.00  0.00  0.00 -0.00 0.000  0.00
>3  3  4 -0.08 -0.04  0.08  0.04 0.000  0.00
>4  4  5 -0.33 -0.20  0.33  0.20 0.000  0.00
>5  5  6 -0.61 -0.41  0.61  0.41 0.001  0.00
>6  6  7 -0.79 -0.49  0.79  0.49 0.000  0.00
>7  7  8 -1.70 -1.15  1.70  1.16 0.002  0.01
>8  8  9  0.25  0.17 -0.25 -0.16 0.000  0.00
>9  8 10  0.25  0.19 -0.25 -0.19 0.000  0.00
>   10  8 11  0.25  0.21 -0.25 -0.21 0.000  0.00
>   11  1 12  2.62  1.89 -2.61 -1.88 0.006  0.01
>   12 12 13  2.61  1.88 -2.59 -1.82 0.027  0.06
> ..  ..  ...  ...   ..
> .. .. ....
> ..



delivery of reactive power depending on voltage given by a curve

2017-11-21 Thread Weber, Jens
Hello everyone,

i would like to  simulate a special Q(V)-control-behavior of a generator.
This means delivery of reactive power depending on the actual bus voltage given 
by a Q(V)-curve similar to this picture:

http://patentimages.storage.googleapis.com/DE102013105444A1/DE102013105444A1_0018.png

Is there a way to implement this behavior in MATPOWER OPF?

Thanks.


Regards,

Jens



OPF convergence issue with piecewise linear cost

2017-11-21 Thread Gamze Dogan
Dear all,


I wanted to compare the results of the OPF with the two types of model for the 
generator costs (polynomial and piecewise linear cost).


So first, I launched an OPF with polynomial cost which converged, then I 
launched one with linear cost and it does not converge.

I know that my formulation of the linear cost is correct as it has already 
converged for several cases, but for some it does not.

As the first OPF has converged, it means that there is an electrical solution 
to my problem, but with linear cost it seem that the OPF cannot verify the 
constraints on the cost function (minimal f(x)).

I suppose that there is a way to make it converge, do you have any idea how?

Thank you for your time,

Gamze