RE:Analysis of portal frame
This sounds like a rather difficult thing to do by hand properly, and I would question the benefit of it, as you would never do this by hand for a real building as it will take too long. On past projects I have always used the elasto plastic method implemented in computer software such as CSC Fastrak. Essentially this assumes elastic behaviour until you exceed the nominal moment capacity of the section (the steel yields) then you assume this point rotates perfectly plastically, and is thus a pin, you then continue the analysis with an additional pin until another section yields and there is another pin, depending on support assumptions you probably now have a mechanism (if pinned supports) and there is no reserve capacity so the frame fails, if you have fixed bases you would continue until you have sufficient pins to cause collapse. A way of thinking of this is like a three pinned arch. (Three pins OK, four pins not OK).
As such I would suggest a starting point would be the bending moments diagrams for pitched frames in the Steel Designers Manual (page 1144 in 6th Edition). I wouldn't worry about purlins as for most buildings there are a lot of them quite close together (circa 1.2-1.5m) so they will be approximately a UDL for reasonably long stations and rafters. Based on selection of section sizes for stations and rafters and stations and assuming you have a vertical UDL on roof you should be able to calculate resulting bending moments and increase UDL incrementally until you exceed the nominal moment capacity of one section (taking account of restraints from purlins, rafter stays etc) at which point a pin will form. You then need to check that the load applied is more than the service load on the structure (but less than ultimate factored load on the structure). Beyond this point, you need to work out BMD etc for incremental loads with an extra pin. The Steel Designers Manual won't help you any further but perhaps the references below the diagrams will? It also won't help with deflections as the Steel Designers Manual doesn't give defection formulae for frames.
I would suggest all of the above at least needs a spreadsheet to allow you to incrementally change loads and section sizes. You should also be able to superimpose vertical and lateral loading on the frame if required.
Not sure that this will be of any help, but I have tried.