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

Ask Your Question
0

initialise until no suspect initial conditions

asked Feb 25 '14

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

1 answer

Sort by » oldest newest most voted
0

answered Feb 25 '14

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
link

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

1 follower

Stats

Asked: Feb 25 '14

Seen: 748 times

Last updated: Feb 25 '14