Ask Your Question
2

What is the purpose for the default type values _i, _f, _s and _o?

asked 2012-01-19 18:49:42 -0600

Daniel_Hillier gravatar image

updated 2012-01-22 19:01:03 -0600

The title says it all. What do psspy._i, psspy._f, psspy._s and psspy._o do and why are they necessary. I have repeatedly been seeing a string of these guys being passed to calls to the PSSE API (particularly when examining the PSSE Python recorder output).

For example,

psspy.solution_parameters_3(
    [_i,200,_i],
    [_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f])
edit retag flag offensive close merge delete

Comments

1

I want to flag your question as offensive, that function call looks hideous.

jtrain gravatar imagejtrain ( 2012-01-20 02:51:32 -0600 )edit
1

I think there is a fourth default type, but I can't remember what it is.

jtrain gravatar imagejtrain ( 2012-01-20 02:52:36 -0600 )edit

Yes, I missed the _o (default filename) type. I'm not sure why this is different to a string _s. Thanks for the pick up. I have edited the question to reflect this (and tidied up the code a little to make it slightly less hideous :p )

Daniel_Hillier gravatar imageDaniel_Hillier ( 2012-01-22 19:03:27 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
4

answered 2012-01-22 18:51:33 -0600

JervisW gravatar image
  • _i - default integer
  • _f - default floating point
  • _s - default character / string
  • _o - default filename

And here is an explanation as applied to your example:

psspy.solution_parameters_3(
    [_i,200,_i],
    [_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f])

The user wanted to change the second integer solution parameter, but not the first or third, and didn't want to change any of the floating point solution parameters.

So what are the first and third integer solution parameters? Well from the docs:

INTGAR(1)  - ITMX, Gauss-Seidel maximum number of iterations.
INTGAR(2)  - ITMXN, Newton-Rapheson maximum number of iterations.
INTGAR(3)  - ITMXTY, TYSL maximum number of iterations.

In your example you wanted to increase the Newton Rapheson iteration limit to 200 but leave the Gauss-Seidel and TYSL iteration limits alone. But you don't know ahead of time what the Gauss-Seidel or TYSL values already where, so you can't type them in with the 200:

psspy.solution_parameters_3(
    [2?,200,10?])

so instead we use the default value which means - Don't change this value, leave it the way it was.

Here is another way to update one value without changing the others:

# increase Newton-Rapheson iteration limit.
psspy.solution_parameters_3(intgar2=200)

we specify the same name as in the documentation INTGAR(2) as lowercase and without the brackets intgar2.

edit flag offensive delete link more

Comments

Thanks for the info. Makes much more sense now. The last code snippet is much easier to read than what I posted. I will start to use that syntax in my code. It is unfortunate that the PSSE recorder outputs the long winded version.

Daniel_Hillier gravatar imageDaniel_Hillier ( 2012-01-22 18:56:12 -0600 )edit

Wonderful post and explanation. I am currently using the long winded version too. Luckily I saw this post not too late. Thanks, JervisW!

ypwang gravatar imageypwang ( 2014-08-18 09:58:58 -0600 )edit

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

Stats

Asked: 2012-01-19 18:49:42 -0600

Seen: 6,165 times

Last updated: Jan 22 '12