Category Random Python

Runge-kutta method using Python.

My exams finally got over . I got back home and slept for a week continuously . After that I realised I had to solve a differential equation for a project . Seniors told me the Runge-kutta method is numerically the best method to find function values at a particular point provided you are given […]

Cycle Simulation – Part Two

Continuing with my previous post about cycle simulation , I will focus on the three , important gas cycles , Otto , Diesel and Dual Cycle. I used PyQt4 for the graphical user interface ,  and matplotlib for the simulation . This was quite easy for the following reasons: 1 . Gas cycles are those […]

Simulation of Rankine Cycle

If you are a mechanical engineer continue reading. If you are not then please still continue reading because you have taken efforts to click on the link. So coming to the point , a Rankine cycle is a cycle that according to wiki , generates 90% of the electric power across the world. Before , […]

Automated steam tables

Okay , the code that I wrote in the previous post , sucked and it sucked badly. There were many bugs while using it , i was iterating through lists multiple times , when I could have used a simple inbuilt python module. I have revised(rewritten) the code and can be found in this gist […]

Thermodynamics and Python

Hello. I wanted a python module by which I could access thermodynamic properties of steam. On googling I came across this module called thermopy http://packages.python.org/thermopy/  .  But the range of temperatures and pressure  which I could use was very limited.  Then I came across this library , called freesteam , which I couldn’t install , […]

Renaming files in python

I had downloaded 2012 id pics but couldn’t view them due to the following error . Error interpreting JPEG image file (Not a JPEG file: starts with 0x89 0x50) On googling I found out that the image had to be renamed as a ‘.png file’ . But I couldnt do them manually as there are […]

Multithreading in pygtk

My friend Ranganath had some problem with implementing a stopwatch in Java. I told him it would be a piece of cake in python and I would do it in a hour or so . The only thing I do was to call a callback function , whenever I clicked the start button which would […]