Andrew Que Sites list Photos
Projects Contact


   Back in March I had a class in linear algebra which unfortunately I didn't feel was taught all that well.  Since I felt the homework wasn't doing a good job of getting me to learn the techniques we were being taught, I decided to write a C++ library that implemented several of the methods this class covered. 
   For my linear algebra class, I used OpenOffice Calc to do my matrix calculations.  This made it easy to check my steps and eliminate arithmetic mistakes (which I seem to make a lot).  One thing I noticed was that OpenOffice often ended up with tinny rounding errors.  I would get results like 1E-15 (1-15) that I had to manually replace with 0.  The reality was, all the matrix math I was doing used integer numbers.  Since all the matrix operations I did were just addition, subtraction, multiplication, and division, everything could be done using rational numbers.  So my first task was to write a rational number template class.
   A rational number is a number that can be expressed as a quotient, so in the form a/b or "a over b".  Rational numbers (set Q) are made of two integer number (set Z), a and b.  In C/C++, there are several integer types, so I decided a template class would work the best so the programmer could select the integer type they needed.  In addition, as long as the type supported basic arithmetic (subtraction, multiplication, and division), any class that overloaded these operators could be used.  This allows the use of arbitrary precision libraries such as the GNU Multiple Precision Arithmetic Library
   The matrix class is also a template.  The elements of the matrix can be of any type (integer, floating-point, rational, ext.)  I implemented the following functions: addition/subtraction, transpose, row echelon reduction, determinants, dot product, matrix product, inversion, and LU decomposition.
   The libraries are available here, and linked on the projects page.

1 comment has been made.

From LJBarre

South Carolina

November 26, 2011 at 5:53 PM

Aha, very good information with template function. This should help the phobic matrix deviants who are trying a to teach a subject that they understand but are unable to teach.

November 01, 2011

Adult Math

So in my calculus III class, we're learning how to solve multiple integrals. I like to write about what I'm learning in my math classes, but I don't really have a lot of application for this. So, I decided to expand on my favorite integral. Here is my result:

For those of you who can solve this, go ahead—it's fun. But for those of you who can't, let me walk you through it. We first solve the inside most integral.

Substitute this back...

Now solve the inside integral again...

Substitute this back... (math is sometimes a lot of 'rinse and repeat')

Now, solve the finial integral...

There you have it. Mathematically I've shown that if you use the correct limits of integration, and do so three times (i.e. if you do it right) then can end up being 69. Don't get it? Then try and read the letters of the previous equation. Yep, I've learned so much now that I am attending a university raked in the top 20 in the country, I'm making licentious innuendos using math for lack of anything else to demonstrate.

1 comment has been made.

From Ericaceous :)

December 05, 2011 at 8:40 AM

I would like to take this moment to thank my awesome high school calculus teacher for making all of this simple and undaunting . . . Thank God. Everyone is capable of 'higher' maths, it's just bad teachers who don't know what they're doing and make it seem impossible for most people.

October 31, 2011

Happy Halloween

   I didn't get a single trick-or-treater this evening--guess that means I get to eat all the candy I was going to give them.  Spent most of the evening preparing a study guide for an exam on Wednesday with scary movies in the background.
   Just for the heck of it, I decided to give myself a typing speed test.  I did two tests, and both placed me over 60 words/min.  I can live with that.

1 comment has been made.

From Liz


November 01, 2011 at 5:04 PM

what movies did you watch? :D
   Maggie, Amber, October and I went on our annual trip to the Pumpkin Patch and Edward's Apple Orchard.  It is a trip I look forward to all month, and it was a lot of fun.  We had origionly planned to do this trip last weekend, but had to cancel.  With rain forecast for tomorrow, I knew we had to do the trip today.  It was chilly, but the skies were sunny and the fall colors still in full effect.
   This year's trip was also made by little October.  She likely won't remember this trip (or the next couple), but she seemed content sleeping through most the day.
   Show tonight at the Disaster House in Rockford.  The DH crew has a fine punk house, and they often put on good shows.  Pictured is myself, Chelsea (whom is playing with my hair), and Luca (in the bottom right corner) all squished onto a couch in the basement.  Picture by Crystal.

October 01, 2011

Happy October

   Pictured is a wind turbine in the Blue Sky Green Field wind farm.  There were two wind farms on the way to Manitowoc, and this one was very close to us.  As we approached, Amber asked if we get closer to one of the turbines—something I had very much wanted to do. Although I have stopped at two wind farms in the past, I've never been next to a turbine while it was running, and had always wondered how it sounds.  With a steady breeze, all the turbines were turning steadily.  Doing a simple second count, I estimated they were turning about 15 RPM.  After reading about the field, I found I was fairly close—they turn at 14.4 RPM.
   After a fuel stop, we found our way to the pictured turbine.  Standing about 100 feet from the tower, I could hear a slight "swoop" sound as the blades went by, but it was more faint than the sound of the wind in the corn field we were surrounded.  After taking a couple pictures, Amber and I discovered something that turned out to be a lot of fun.  Looking directly up at the spinning turbine, you could see a massive 134 foot (40 meter) blade coming directly down at you, then turn up and out of the way.  We both laid down on the ground to stair up at this phenomena—it  was like being on a carnival ride.
   This tower stands 162 feet (50 meters), and can generate 1,650,000 watts.  Under the tower you couldn't hear the passing of the blades, nor the 60 Hz hum of the transformer over the sound of the wind.  I was already a fan of wind power, but this experience has made me even more so.  What a great way to make electricity.

1 comment has been made.

From Noah

October 27, 2011 at 3:18 PM

Wind power definitely does kick butt! Problem is, only a few lucky areas have strong winds during peak power usage - if the wind is blowing at 3AM, the power company can't use it very effectively. Nice photos!

September 01, 2011

UW-Madison Orientation

   Student orientation today at UW-Madison, and I was required to go.  My last required meeting was extremely productive, and resulted in me signing up for classes.  Orientation, not so much.  Despite being a transfer student, we sat through several people talking about how one makes it as a student at UW.  I folded my napkin into a paper crane, and a postcard on academic requirements into a fancy airplane.
   The second part of orientation moved us around to several group were we could find information about joining research projects, studying abroad, ext.  While more useful, I found I had learned most of this information in the sign-up for classes.
   Once done with orientation it was time for something I had to do: finding my classes.  The campus, to say the least, is much larger than UW-Rock County.  I had printed out my class scheduled, and a map (which printing quite poorly) of where each of the buildings were.  So I biked around to each of them, found a good bike rack (all the buildings had good racks) and searched for the class rooms I would be using.
   Some of the buildings are fantastic.  One of the buildings had a physics museum with a bunch of demos I had to play with.  By far the oddest building was the Humanities building, which I think was designed to be a hybrid labyrinth, and 1950ies sci-fi set.  It took me awhile to find my class rooms, but it was an interesting tour.
   After that, it was off to the bookstore.  I had put this off probably too long, but it needed to be done.  Naturally they were out of one of the books I needed.
   So once all this traveling was complete, it was time to head back home.  Madison is an easy city to bicycle.  Many of the one-way roads, and closed areas to motorists are still accessible by bike, and I found it makes biking easier than driving.  All day there was a huge quantity of foot traffic—people everywhere.  Yet was an easy coexistence between cyclists and pedestrians.
   The weather was awful with temperatures in the 90ies, and I returned home a sweat monster, but it was a good endurance test.  I will not be required to bike this long with my backpack for classes, and the heat is probably as bad as I am ever going to encounter.  And tomorrow, the first day of class...

1 comment has been made.

From Liz


September 03, 2011 at 8:47 AM

I still think it's weird... I start on the 6th. I still haven't found my classes but I've found the buildings. I haven't started school that early since grade school, always been after labor day since I started in the UW system.