0

Getting current time in dynamics simulation?

Is there a Python API to get the current time in the dynamics simulation? Perhaps 'time' exists as a STATE in the simulation, and I could retrieve that? I know it exists in the OUT file.

I figured this would work, but this function only returns IERR.

ierr = psspy.dlst(5, 5, 0, 0) # 5=0ut

EDIT: Perhaps I need to access the current out file in the case and get the last element in the time array. I could definitely attempt this by loading dyntools, but I'm still wondering if I can do this through psspy more elegantly.

likethevegetable's avatar
101
likethevegetable
asked 2021-08-30 11:34:25 -0500, updated 2021-08-30 11:46:42 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

Use API dsrval:

ierr, time = psspy.dsrval('TIME', 0)

The API returns the current time.

perolofl's avatar
3.8k
perolofl
answered 2021-08-30 15:02:27 -0500
edit flag offensive 0 remove flag delete link

Comments

Ah, I was looking in the wrong section. Thank you.

likethevegetable's avatar likethevegetable (2021-08-30 15:14:05 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer