Ask Your Question

Avoid "call change_var" writting.

asked 2014-07-04 05:15:18 -0500

agastalver gravatar image

updated 2014-07-07 07:01:14 -0500

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.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-07-07 07:00:22 -0500

agastalver gravatar image

updated 2014-07-07 07:17:58 -0500

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)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools


Asked: 2014-07-04 05:15:18 -0500

Seen: 168 times

Last updated: Jul 07 '14