I'm not sure I understand what you are attempting to do. You most certainly can load m-files dynamically and add constraints at run-time. In fact, toggle_reserves, does exactly that. Are you trying to do something different from the standard use of toggle_reserves? See runopf_w_res and section 6.5.1 in the manual for more details.
-- Ray Zimmerman Senior Research Associate 419A Warren Hall, Cornell University, Ithaca, NY 14853 phone: (607) 255-9645 On Apr 26, 2013, at 7:23 PM, "Purohit, Sumit" <[email protected]> wrote: > Hi All, > > I am not a matpower user but a software developer who needs to integrate with > matpower. > > What I want is to add new constrains and variable to a case selected by user > of the software. > For example if user selects case9 then I want to add new constrains in > "toggle_reserve" file. > I want to add new constrains here : > > %% constraints > I = speye(ngr); %% identity matrix > Ar = [sparse(1:ngr, igr, 1, ngr, ng) I]; > ur = mpc.gen(igr, PMAX) / mpc.baseMVA; > lreq = r.req / mpc.baseMVA; > > > but because this file is already compiled and loaded by MatLab AND matlab > does not allow to load m-file dynamically (based on my understanding), I can > not update + user toggle_reserve.m file. > > Now is there a way I can update constraints programmatically ???? > I have access to objects such as "om = userfcn_reserves_formulation(om, args) > " and "mpc" > > > Thanks. > sumit > > >
