Friday, March 9, 2012

What's a Polytropic Process

Midterms are finally over. Deep sigh!. Had a very short time to chill and decided to write up something. Comments, suggestions and corrections will be greatly appreciated.

Polytropic Process

Sunday, January 2, 2011

Area of Circle in Fortran

I had a really happy holiday, mostly because I did significantly better at school this fall than I anticipated. Got to play the game of spoons on Christmas day. Well, its back to being serious. Just wrote this simple Fortran program. It basically calculates the area of circles given 5 radii. If a negative value is entered for the radius, the program terminates after complaining. This implies that a negative numeric value can be used as a sentinel in the event one intends to calculate the area of fewer than five circles. As usual, attached is a screen shot of the code. Its a very very simple program.


























Like I said, its a simple program. I hope it proves useful to someone. Heads up, if time permits I'll be writing some Fortran programs for stuffs I learn in mech and vibes, thermodynamics and heat transfer and flight mechanics. I'm bailing out for now.

Oh! I almost forgot, Happy New Year to everyone.

Monday, December 20, 2010

My first fluids problem solver using Fortran

With the mean dark days behind me (fall finals), I now have time to pluck at things for fun. I totally lost interest in MatLab and advancing the capabilities of the slider crank mechanism problem is on hold. I got my self a new toy C::B and since I've not been able to gather the motivation to learn C++ or start solving engineering problems in C, I decided to start playing around with Fortran. It seems to have a much cleaner syntax compared to C, at least for calculations (which is what Fortran is really meat for in the first place).

With AER316 behind me, I ran back to Frank M. White and goofed around. With a little help from a few lecture notes and the web, here's the result of what I've done. ;)


That's a screen shot of the code I wrote. I used VIM to get the screen shot as Code::Blocks - C::B has a somewhat bigger interface and all I intended to place here was the code. Compiled it with GFortran and it worked well. As I progress with Fortran, I might add more capabilities if I get a chance to do so.

Saturday, December 18, 2010

Settled for an Integerated Development Environment.

After a lot of digging I finally settled for an IDE. And the winner is Code::Blocks - C::B. I did quite a bit of reading and sampling. I'm somewhat new to using IDE's. Prior to today, I've been coding using vim without X window as well as compiling. Lets see how this goes. Wish me luck. Go Code::Blocks go C::B. ;)

Wednesday, December 1, 2010

Slider crank mechanism with Newton-Rapheson method

A = 1;
B = 2*LENGTH_AB*sin(ANGLE_ALPHA);
C = (((LENGTH_AB)^2 + 2*LENGTH_CD*LENGTH_AB*cos(ANGLE_ALPHA) + LENGTH_CD^2 - LENGTH_BC^2));
LENGTH_DA = (B + sqrt(B^2 - 4*C))/2;

A small part of the MatLab code I wrote while trying to implement a slider crank mechanism. This one was kinda tricky as the problem presented was somewhat restrictive.

The cylinder was oscillating on a translational path along the x axis above the crank. I only was given the angle at the crank source, its angular velocity, the magnitude of the arms and potential offset of the cylinder. After much digging, I decided to try this method as it allowed me write all distances in vector form. This way, I will be able to determine the maximum angle the crank end can go as it is somewhat dependent on the magnitude of the arms. I plan to add more features to this system later.

NOTE: The code chunk above is only for the positive roots. Negative roots was not needed for this problem. Might be once I start to expand the capabilities of this program.

Just for fun.

Decided to try Google Blog.