Ask Your Question
1

Model writing using Python

asked 2013-11-15 11:03:16 -0500

Diz gravatar image

Hey Guys, I am wondering if anyone has tried writing a model using Python. If yes what are the steps that will be helpful for a a new PSSE user.

Thanks

edit retag flag offensive close merge delete

Comments

Thanks Jconto.

Diz gravatar imageDiz ( 2013-11-15 16:00:26 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
1

answered 2013-11-15 13:14:06 -0500

jconto gravatar image

Model writing is done using Fortran, following a rigid model developing process, with enough knowledge of the 'guts' of the PSSe libraries, to be able to use global variables and functions to represent the equations of your model. I do not know if PTI is planning to add python as a model development platform but at this time python is not supported.

edit flag offensive delete link more
1

answered 2014-07-10 02:57:17 -0500

agastalver gravatar image

updated 2014-07-10 02:58:56 -0500

There is a way to do this but it requires a bit of fortran knowledge. Use the system call in your fortran model:

call system(command [,status])
status = system(command)

where

  • command is the command you want to perform (python.exe your_code.py) character
  • status is the return status integer

There are some considerations to take here:

  • All the communication between your python code and psse (variables, functions, ...) should be defined in fortran as input and output before and after the system call; and, conveniently, through files.
  • The call system procedure will be called each integration step. Therefore, the simulation will run significantly slower.

It seems to be a rough and dirty way of developing models, but you have to think differently: this system calls can allow to communicate your models with other systems (even between multiple simulations, internet information, etc.), while performing a primary execution through fortran.

I hope it helps. Open your mind.

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

Stats

Asked: 2013-11-15 11:03:16 -0500

Seen: 984 times

Last updated: Jul 10 '14