Hi Samuel, As per Shri advised, this is something to do with Matlab programming and not MATPOWER. And as you may know, programming likewise writing in which there is nothing wrong with it as long as you get what you want. There are many ways you can do the plots. One of it by storing the values of Vm and k for each iteration and plot it thereafter, with this you can always call and view the values at anytime you want. Another way is by plotting the graph via HOLD ON function in which this code should be embedded into the loop of concerned. Via HOLD ON you will not be able to view it as the latter.
To be frank, the plotting method suggested aforementioned is not suitable for the one that really seeking for a fast monitoring scheme and this is because to store a value does consume space and time in the programming interface and this also applies to the so-called HOLD ON function. Hope it helps. Regards, SBusan On Tuesday, 5 November 2013 5:59 PM, Shri <[email protected]> wrote: This is a Matlab question not relevant to MatPower. Spend some time understanding Matlab programming, it will help you in the long run. Shri > On Nov 5, 2013, at 5:43 PM, "Kusi, Samuel A" <[email protected]> wrote: > > Guys, Will really appreciate if any of you can provide some insights on how > to accomplish this. > > I have the following code which multiplies a range of factors k by generator > and load powers: > > define_constants; > for k = 1:0.1135:2.135 > mpopt = mpoption; > mpc = loadcase('case39'); > mpc.gen(:,PG) = k*mpc.gen(:,PG); > mpc.bus(:,PD) = k*mpc.bus(:,PD); > mpc.bus(:,QD) = k*mpc.bus(:,QD); > results = runpf(mpc, mpopt,'loading_scenario.txt'); > end > > > Now the challenge is to make a plot of the load voltages vs k. There are 10 > (ten) k values in the formula above. > Therefore I will need to plot Bus1 load voltage (10 different values) vs k, > Bus 2 load voltage (10 different values) vs k, etc all on the same graph > > load_voltages = results.bus(:,VM); yields only voltages corresponding to the > last value of k. How do I modify the code to be a function of k, where I can > plot the various voltages on each bus as k is varied. > > Any insights will help. Thank you > > > > -- > Samuel Kusi > Electrical Engineering > >
