Ask Your Question
0

Character to Integer Conversion for PSSE

asked 2022-11-23 22:55:47 -0600

CPReddy gravatar image

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.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2022-11-24 10:09:10 -0600

perolofl gravatar image

Branch id entered as character, e.g. '1', will be stored in CHRICN. If branch id is entered as an integer in DYRE-file the value is stored in ICON. Try the following

IF (CHRICN(I+2).EQ.'$$') WRITE(CHRICN(I+2),'(I2)') ICON(I+2)

where I+2 is the index of the branch id. This line will convert integer id to character id in array CHRICN

In this way the id will always be stored in CHRICN.

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

1 follower

Stats

Asked: 2022-11-23 22:55:47 -0600

Seen: 47 times

Last updated: Nov 24