First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
1

Model writing using Python

asked Nov 15 '13

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

Comments

Thanks Jconto.

Diz gravatar imageDiz (Nov 15 '13)

2 answers

Sort by » oldest newest most voted
1

answered Nov 15 '13

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.

link
1

answered Jul 10 '14

agastalver gravatar image

updated Jul 10 '14

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.

link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

Stats

Asked: Nov 15 '13

Seen: 1,024 times

Last updated: Jul 10 '14