Re: Python for IPSA (Power flow analysis)

2013-05-29 Thread steve . ingram
On Tuesday, May 28, 2013 11:00:42 AM UTC+1, Debbie wrote:
> Hi there,
> 
> I am new to Python, and wondering if you could help me with python based 
> coding for the IPSA (Power system analysis software). I have a electrical 
> distribution network with generators, buses and loads, on which I am 
> performing the load flow analysis every 1 hour for a period of 1 year. 
> 
> 
> 
> The code to perform instantaneous load/power flow analysis is given below. I 
> need to modify it such that I can perform this load flow analysis every 1 
> hour for a period of 1 year. Please help.
> 
> 
> 
> from ipsa import *
> 
> 
> 
> ipsasys = IscInterface()
> 
> net = ipsasys.ReadFile("refinery.iif")
> 
> bok = net.DoLoadFlow();
> 
> if bok:
> 
> busbars = net.GetBusbars()
> 
> print "Load Flow results:"
> 
> print ""
> 
> print "BusName Vmag(kV)"
> 
> print ""
> 
> for bus in busbars.itervalues():
> 
> name = bus.GetName()
> 
> vm = bus.GetVoltageMagnitudekV()
> 
> res = "%-8s  %10.5f" % (name, vm)
> 
> print res
> 
> else:
> 
> print "Load Flow failed!"
> 
> 
> 
> Regards,
> 
> Debbie

Hi Debbie,

Just found your question. I work for Ipsa and, among other things, provide 
support for the scripting side.

The quickest way to achieve what you want is to adjust the loads on the network 
and perform a load flow. The sequence would be roughly as follows;

for hours in year():
# set load values
loads = net.GetLoads()
for load in loads().itervalues:
# set new value for each load to represent the next hour of data
load.SetDValue(IscLoad.ReactiveMVAr, next_MVAr_value)
load.SetDValue(IscLoad.RealMW, next_MW_value)

net.DoLoadFlow()
# do something with these results
 
The above code obviously won't work and will need tweaking, but should give you 
the idea. The next version of Ipsa (2.3.2) will have load profiles in so will 
give a different way of achieving the same results, as well as speed 
improvements.

As Robert mentioned, the best place for Ipsa support is to go onto the website 
(www.ipsa-power.com) and check the Support of Education pages or check the 
LinkedIn group Ipsa Power Software Group at 
http://www.linkedin.com/groups/IPSA-Power-Software-4860907

Hope this helps,

Steve
-- 
http://mail.python.org/mailman/listinfo/python-list


Close program built with py2exe

2006-11-12 Thread Steve Ingram
Found out what I'd done, and it wasn't py2exe causug the problem. I wasn't
 closing the main dialog properly, I was calling Close() instead of
Destroy(), so the dialog stayed in memory, basically it was still running.

Thanks for your help,

steve

-Original Message-
From: Fredrik Lundh [mailto:[EMAIL PROTECTED]
Sent: 12 November 2006 12:50
To: python-list@python.org
Subject: Re: Close program built with py2exe

Steve Ingram wrote:

> I've got a problem with a program I've written and want to distribute.
> It uses a wxPython dialog and I've built a distribution version with
py2exe.
> Problem is when I run the .exe under windows I can only stop the
> program completely using the task manager. When I close the dialog and
> check the task manager, there is still a running process. I think this
> is probably the python interpreter that is still running.
>
> Can't find any help anywhere, does anyone know how to get the dialog
> to kill the process properly??

have you checked if any exceptions occur during application shutdown?

it could be that the GUI toolkit manages to remove all windows, but that
something goes wrong at the application level before the GUI gets around
to shut down the message loop.






-- 
http://mail.python.org/mailman/listinfo/python-list


Close program built with py2exe

2006-11-11 Thread Steve Ingram
Hiya,

I've got a problem with a program I've written and want to distribute. It
uses a wxPython dialog and I've built a distribution version with py2exe.
Problem is when I run the .exe under windows I can only stop the program
completely using the task manager. When I close the dialog and check the
task manager, there is still a running process. I think this is probably
the python interpreter that is still running.

Can't find any help anywhere, does anyone know how to get the dialog to
kill the process properly??

Ta very much,

Steve

-- 
http://mail.python.org/mailman/listinfo/python-list