0

initialise until no suspect initial conditions

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

Peter B's avatar
125
Peter B
asked 2014-02-24 23:49:53 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

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
yfwing's avatar
436
yfwing
answered 2014-02-25 15:16:33 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Login/Signup to Answer