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

Ask Your Question
0

Getting current time in dynamics simulation?

asked Aug 30 '1

likethevegetable gravatar image

updated Aug 30 '1

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.

1 answer

Sort by » oldest newest most voted
1

answered Aug 30 '1

perolofl gravatar image

Use API dsrval:

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

The API returns the current time.

link

Comments

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

likethevegetable gravatar imagelikethevegetable (Aug 30 '1)

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

2 followers

Stats

Asked: Aug 30 '1

Seen: 539 times

Last updated: Aug 30 '21