Hi,

The error message you receive has nothing to do with MATPOWER, but probably 
stems from calling the function "branch" of a different program. Please use

mpc = loadcase('case9');

because that will store the case file data in the struct "mpc".

And then, replace all "branch" with "mpc.branch" in your code below. So for 
example, it should be

mpc.branch(Location, BR_X) = mpc.branch(Location, BR_X) + x1;

Does that work?

Best,

Patrick

________________________________________
Von: [email protected] 
[[email protected]]" im Auftrag von "Umer 
Ali Alsedeeq Ibrahim [[email protected]]
Gesendet: Sonntag, 8. November 2015 16:03
An: MATPOWER discussion forum
Betreff: Varying  the reactance  of branch

Dear All

I would like to change reactance of branch and shunt susceptance  repeatedly as 
below

1- varying of reactance by the below code

rate= rand();

location = 5;

loadcase('case9');

r = -0.7 + 0.9 * rate;

 x1 = r * branch(Location, BR_X);

branch(Location, BR_X) = branch(Location, BR_X) + x1;


2- varying of  shunt susceptance  by the below code

rate= rand();

location = 2;

loadcase('case9');

Q = -100 + 200 * rate;
V = bus(branch(Location, F_BUS), VM) .* exp(sqrt(-1) * pi/180 * 
bus(branch(Location, F_BUS), VA))
V = abs(V);
 bs1 = -Q / (V^2);
bus(branch(Location, F_BUS), BS) = bus(branch(Location, F_BUS), BS) + bs1;
bus(branch(Location, F_BUS), BUS_TYPE) = PV;

when I have running the above code  I receive the  following error:

??? Error using ==> branch at 112
first input argument must be either a TREE or an LTI created by MKSYS

please help


[Logo]

Disclaimer:

This e-mail and any attachments may contain information which is confidential. 
They should not be distributed, disclosed or copied to anyone without the 
approval of the sender. If you are not one of the intended recipients of this 
e-mail, please delete the e-mail and any attachments, and all copies, and 
notify the sender by e-mail or telephone. Confidentiality is not waived or lost 
by mistaken communication. Before opening this e-mail or an attachment, you 
should check them for viruses. تنويه هام: هذه الرسالة الإلكترونية وأية ملحقات 
معها قد تحتوي على معلومات سرية، يجب أن لا يوزعا أو يكشف مضمونهما و/أو نسخهما 
لأي كان من دون موافقة المرسل. إذا لم تكن واحداً من الأشخاص الموجه لهم هذا 
البريد الإلكتروني ووصل إلى بريدك الإلكتروني عن طريق الخطاً، يرجى حذف الرسالة مع 
ملحقاتها فضلاً عن حذف جميع نسخها. وبعد ذلك، يرجى الإتصال بالمرسل عبر البريد 
الإلكتروني او الهاتف لإبلاغه بالخطأ الحاصل. لا تفقد سرية المعلومات أو يتنازل 
عنها بسبب خطأ ناجم عن إرسال وتوجيه البريد الالكتروني لأشخاص غير مقصودين. كما 
يتوجب على متلقي البريد الإلكتروني وملحقاته أن يتفحصوهما دوماً قبل الإطلاع 
عليهما، للتأكد من خلوهما من الفيروسات الإلكترونية الضارة.

Qatar General Electricity & Water Corporation <http://www.km.qa>


Reply via email to