Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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 is 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.

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 is 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.