Ask Your Question

CPReddy's profile - activity

2024-01-30 02:39:43 -0500 received badge  Famous Question (source)
2024-01-23 15:07:17 -0500 received badge  Notable Question (source)
2024-01-23 15:07:17 -0500 received badge  Popular Question (source)
2024-01-21 10:14:07 -0500 asked a question How to write a Fortran-wrapper for C-code and attached it to the PSSE model?

I have a control code in C language. How can I write a wrapper for this c code, build the DLL, and attach it to the PSSE model? Any example please???

2023-02-05 09:36:43 -0500 received badge  Famous Question (source)
2023-02-04 02:37:49 -0500 received badge  Popular Question (source)
2023-02-04 02:37:49 -0500 received badge  Notable Question (source)
2023-02-03 10:52:52 -0500 asked a question Import Environmental Manager in Python and build dll for V35

def CreateDLL(psseversion, keyname): # ____________________ # [vars]

mypathlib = False  # set PATH and LIB values using installed components
src_lst = []

work_dir = os.getcwd()
if len(sys.argv) > 1:
    keyname = sys.argv[1]
dllname = "%s_v33.11.0.dll" % (keyname)
dlllib = dllname.replace('.dll', '.lib')
try:
    os.remove(dlllib)
except:
    pass

for ext in ['*.flx', '*.f', '*.for', '*.f90']:  # include conec & conet files
    src_lst += find_files(ext, work_dir)  # get source files
objlibfiles = find_files('*.obj', work_dir)
objlibfiles += find_files('*.lib', work_dir)

ierr = psse_env_manager.create_dll(psseversion,
                                   src_lst,
                                   modsources=[],
                                   objlibfiles=objlibfiles,
                                   dllname=dllname,
                                   workdir=work_dir,
                                   showprg=True,
                                   useivfvrsn='15.0.285',
                                   shortname=keyname,
                                   description='User Model',
                                   majorversion=1,
                                   minorversion=0,
                                   buildversion=0,
                                   companyname='Enerzinx',
                                   mypathlib=mypathlib)

if name == 'main': psseversion = 33 keyname = 'Mydll' CreateDLL(psseversion, keyname)

this code works for building the dll for ver33 and 34. But if I use the same code for ver35, it throws the error message below.

fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'

ERROR during link(2)... Aborted

2022-12-10 11:38:19 -0500 received badge  Famous Question (source)
2022-11-27 01:46:18 -0500 received badge  Famous Question (source)
2022-11-26 06:58:52 -0500 received badge  Popular Question (source)
2022-11-26 06:58:52 -0500 received badge  Notable Question (source)
2022-11-25 06:36:54 -0500 received badge  Enthusiast
2022-11-23 22:55:47 -0500 asked a question Character to Integer Conversion for PSSE

Hi all,

I am writing a user-written model in PSSE. I need to measure a branch flow in PSSE. I passed From bus, To bus and Bus ID as ICONs. Inside my model, I used the bus ID as CHRICN. When I print it in DOCU, it is printed as 0. So, I need to convert this character to Integer. I used the read function. read(BID, *) BIDint. This function will convert character to integer. It is successfully compiled. But, when I run the model, the PSSE is crashing. Kindly help me with how to convert and print in the DOCU section.

2022-11-23 13:11:24 -0500 received badge  Notable Question (source)
2022-11-23 05:21:11 -0500 commented answer FLOW1 function output not matching with Load Flow Solution

I didn't get your answer exactly. Could you please give me a piece of code to do it.

2022-11-22 20:37:08 -0500 commented answer FLOW1 function output not matching with Load Flow Solution

Hi, the model is initialized from the load flow solution. I think we should solve the network solution first and read the Q value from the solution. This may solve the issue. But I don't have any idea to do it. In the case of the current injection model, normally we do this when IFLAG is true.

2022-11-22 20:14:09 -0500 received badge  Popular Question (source)
2022-11-22 07:22:09 -0500 received badge  Editor (source)
2022-11-22 07:20:53 -0500 asked a question FLOW1 function output not matching with Load Flow Solution

I have written a power plant controller model in PSSE. I need to initialize the PPC model with remote branch flow. I used the FLOW1() function to get the active and reactive power flow of the remote branch. Somehow there is a difference in the results between the steady-state model and this function output. The difference is very minor (0.02 MVAR). Due to this, I am getting initial suspects in the PSSE model, which is not accepted by many utilities.

CALL FLOW1(M+1,L+2,L+3,L+4) Q = VAR(L+3)

from load flow Q = 16.0042 MVAR, but from VAR(L+3) it is 15.99409 MVAR. Even though the difference is very small but it will show as a suspect.

Kindly help me to resolve this issue.

2022-10-28 13:43:30 -0500 commented answer Is there any alternative function command for NSWICH in v35 ?

Thanks for your suggestion.

2022-10-28 13:43:01 -0500 commented answer Is there any alternative function command for NSWICH in v35 ?

Hi Alex, Yes, now my code is working. Thanks for your support.

2022-08-05 03:34:30 -0500 received badge  Notable Question (source)
2022-08-05 03:34:30 -0500 received badge  Famous Question (source)
2022-08-05 03:34:30 -0500 received badge  Popular Question (source)
2022-08-03 19:45:06 -0500 asked a question Is there any alternative function command for NSWICH in v35 ?

NSWICH command has been removed from common4.ins of v35. Is there any alternative function ? Please help me.

2022-08-03 19:42:36 -0500 asked a question Is there any alternative function for NSWICH in V35 ?

NSWICH function has been removed from v35 common4.ins file. Is there any alternative function in v35 ? please let me know.