Ask Your Question
0

initialise until no suspect initial conditions

asked 2014-02-24 23:49:53 -0500

Peter B gravatar image

Hi,

At the moment when I initialise a case using python I will call the psspy.strt() command an arbitrary number of times (usually 2 or 4).

I want to initialise using psspy.strt() only the minimum number of times needed to get rid of suspect initial conditions.

I know suspect initial conditions can be detected using the psspy.okstrt() command.

Does anyone know how I can combine the two commands in some kind of loop to achieve my objective?

Thanks,

Peter

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-02-25 15:16:33 -0500

yfwing gravatar image

Don't know what the reasons are that call strt number of times. The purpose of strt is to help debug the model errors or missing models. I don't think that it is a good practice to run strt a couple of times, as the power flow conditions may not be what you want (i.e., the condition at t=0-, may not be the one that you want to study).

However, for your particular question, you can set loop based on the return of okstrt() function. something like,

# initialization
bStrt = 1;
while bStrt:
    ierr = psspy.strt();
    if ierr > 0:
        print 'STRT Error with code:', ierr;
        break;
    bStrt = psspy.okstrt();

# run
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: 2014-02-24 23:49:53 -0500

Seen: 705 times

Last updated: Feb 25 '14