Thank you Dr. Ray for your answer. Regard,
Ahmad On Wed, 26 Jan 2022 at 23:31, Ray Daniel Zimmerman <[email protected]> wrote: > Hi Ahmad, > > The documentation for the get_soln() > <https://matpower.org/docs/ref/matpower7.1/mp-opt-model/lib/@opt_model/get_soln.html> > method > is found in Section 5.5.5 of the *MP-Opt-Model User’s Manual* (v3.0 > <https://matpower.org/docs/MP-Opt-Model-manual-3.0.pdf> for MATPOWER 7.1, > but v4.0 <https://matpower.org/docs/MP-Opt-Model-manual-4.0.pdf> is the > latest). > > You can call it anywhere you have access to the solved optimization model > object. For example, you can do something like the following. > > 1. Solve your case: > r = runopf('case9'); > 2. Have a look at the resulting optimization model object (shows you > details of each set of vars, constraints, costs): > om = r.om > 3. Extract, e.g. non-linear equality (nle) constraints for active > power balance equations: > [g,dg] = om.get_soln('nle', {'g','dg'}, 'Pmis'); > 4. Extract, e.g. non-linear inequality (nli) constraints for branch > flow constraints at *from* end of branches: > [h,dh] = om.get_soln('nli', {'h','dh'}, 'Sf'); > > I hope this answers your questions. > > Ray > > > On Jan 25, 2022, at 4:26 AM, Ahmad Bariq Al Fahri <[email protected]> > wrote: > > Dear all, > > I am trying to obtain the value of *g*,* dg*,* h*, etc from OPF by using > *get_soln > *and placing it in the *solve.m* script. But, I found an error as shown > below: > <image.png> > > Error: > <image.png> > Could you help me to show how to use this properly and where should I call > this function, inside a script or somewhere else? Thanks in advance. > > Best regards, > > *Ahmad* > Sepuluh Nopember Institute of Technology > > >
