1

Avoid "call change_var" writting.

Every time I use call change_var function. PSS/E writes a message in the output (in my case, a file). I would like to keep the other messages, due it provides information while executing into PSS/E gui.

A solution is to get the position from the machine using mdlind and changing the var array itself. But I would like to know whether there is a better solution using the API.

agastalver's avatar
66
agastalver
asked 2014-07-04 05:15:18 -0500, updated 2014-07-07 07:01:14 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

After hours of debugging and testing. I figured out there is no better solution than the described in the question. Also, I've noticed the time performance of using mdlind for getting the machine position in the arrays and change the var array instead of calling change_var is significantly better when developing machine models in fortran.

Here, I write some examples, where:

  • bus_mac is the bus number where the machine is.
  • id_mac is the id of the machine inside the bus.
  • l_mac is the position of the machine in the var array.
  • n_val is the new value to set to the position, for example, l_mac+2 of the var array.

Way 1 - Better performance: only fortran

call mdlind(bus_mac, id_mac, 'GEN', 'VAR', l_mac, ierr)
var(l_mac+2) = n_val

Way 2 - Secure and API use: fortran

call mdlind(bus_mac, id_mac, 'GEN', 'VAR', l_mac, ierr)
call change_var(l_mac+2, n_val, ierr)

Way 2 - Secure and API use: python

ierr, l_val= psspy.mdlind(bus_mac, id_mac, 'GEN', 'VAR')
ierr = psspy.change_var(l_mac+2, n_val)
agastalver's avatar
66
agastalver
answered 2014-07-07 07:00:22 -0500, updated 2014-07-07 07:17:58 -0500
edit flag offensive 0 remove flag delete link

Comments

I use Way 2 - Secure and API use

yunzhi cheng's avatar yunzhi cheng (2020-03-15 17:12:23 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer