Andrew Que Sites list Photos
Projects Contact
Main
   Heidi

3 comments have been made.

From Steve

JanesHell, WI

May 26, 2010 at 6:47 PM

Heil Haerterich! Wish I could accompany her when she invades Germany this summer. I couldn't get enough of the Fatherland when I was there back in '99, and I want to go back so bad.

From Heidi

Wisconsin, USA

May 30, 2010 at 6:43 PM

Haha yeah im excited, not about this picture though! :( haha hey que, would you be interested in taking my senior pictures ?

From Ericasaurus Rex

Earth

June 11, 2010 at 1:32 PM

Me, too, Que! Could you take mine? I'm sure you would be cheaper than the photography businesses in town . . . and I don't need wallets or anything like that, just something to put in the yearbook.
   Liz at coffee this evening.

1 comment has been made.

From Ericasaurus Rex

Earth

June 11, 2010 at 1:33 PM

I like coffee. When's the next time you guys will be having it and will not mind if I come along?

May 14, 2010

Arrival of new camera

   My new camera arrived today, making me quite pleased.  I had been shooting with a Canon EOS 20D, which is the level above the Canon Rebel series.  When the shutter system died, I started looking into what to select for a replacement.  Back in January when this happened, I found Canon was just about to release the Rebel T2I.  The new Rebels had everything I used on the 20D and some.  After some reading, I decided the T2I made the most sense--there were no fetchers it didn't have that I used. 
   The delivery person came yesterday and left a note on our upstairs neighbors door.  So I left a note on his door this morning explaining we were the door on the left side of the house.  They said they would be back between 12:00pm and 2:00pm, and arrived just a few minutes before 2:00pm.
   Pictured is Tyson, and the very first frame taken with this camera.

April 20, 2010

Instability

   DrQue.net has been a little unstable for the last couple of weeks.  I had done some upgrades to the server in anticipation of the next long-term stable Ubuntu release due to come out at the end of the month.  When I had setup the Micro Dragon, I had installed Ubuntu 9.04, but had not done much with it since.  As usual, the server "just ran" and we logged over 160 days of non-stop runtime.  But as 10.04 is set to come out, I wanted the Micro Dragon to be ready by having 9.10.  In order to get the server to run, I had to make a new build of Apache and PHP, so I went with the most up-to-date versions of those.
   Turns out that when I updated PHP, it decided that all warnings and notices should be logged to the Apache error log file.  And, what I didn't know, was that I have some script on my site that has a warning which causes continuous log entries.  In not too much time, it fills the hard drive.
   What made this error hard to track was the symptoms.  At first, MySQL refused to start.  So, I thought it was a permissions problem related to the upgrade.  It was then I noticed the hard drive was full--all 144 GB.  DrQue.net, with all of it's sites, only has a foot print of 19 GB.  Still believing this was related to MySQL, I started to look at it's log file and the databases.  But nothing was out of the ordinary.  I then started looking at every directory on the hard drive to see how much space it was using.  To my surprise, nothing was taking up the space.  So, I flag the disk for a check on start-up and rebooted.  Sure enough, I was back to plenty of free space.  Thinking this was the problem, I left things alone.
   A few days latter, I noticed my hard drive price script not logging new values.  Usually when this happens, it is because the source site changes format.  But after some running around, I found the hard drive was again full.  Again, I rebooted and checked for errors.  After not freeing any hard drive space, I started probing a little deeper.  As part of the probe, I shutdown Apache.  This caused the error log file to close, and become it's proper size--over 100 GB.  Once I found the log file at this size, I removed it and restarted Apache.  Using tail, I watched the log for a bit and saw the problem.  A quick change the the PHP init file, and we seem to be back in business.
   This is one reason I'm not a big fan of doing regular updates.  And being out of state, I haven't kept up the back up server like I use to, so that when the main server has problems, I just let the old server run the show until I get things working.  Looks like I have a new project though.

1 comment has been made.

From Noah (http://www.amadameus.wordpress.com)

Underground

May 02, 2010 at 10:04 PM

...so are you able to resolve this from Ohiowa, or do you need to be at the Micro-Dragon to get it fixed?

April 01, 2010

Using Taylor series to compute exp

At work I stumbled on a function for doing a log in base 2. After studying the function, I decided to try a similar approach to the exponential function.

We start with Taylor series. I'm not sure how James Gregory discovered infinite series or how Brook Taylor figured out a general method for constructing them back in the early 1700s, but they sure do come in handy in the age of computers. This topic is infamous amongst calculus 2 students, but although they were a lot of work, I rather enjoyed them. Let's first look at the Taylor series transform function:

The notation denotes the nth derivative of the function. The variable a is some starting point. Our function is . To preform the Taylor series, we need a list of the function's derivatives. For our function, that's easy: . Fill in the blanks, our our series becomes .

To see why this is useful, let's step back to the Maclaurin series for ex: . This series will work for any value of x. There's just one problem, which should be easy to see from looking at the function: n!. This value grows very rapidly, and it doesn't take long before we run out of floating point precision. This is why the Taylor series is better. We can speed the process of convergence by starting from some known point closer to x.

In order to implement this in software, we now need a known point. If a general ex is desired, then we are going to need several known points. I used some known limitation for the implementation. 64-bit double precision floating point has a range from 2-1024 to 21023. Any value outside of this range is too much to work with. Just blindly judging from a spreadsheet, I could see that useful range from was -50 < x < 708. To keep it simple, I just decided to have a whole number increments in the table. So 758 known entries must be known.

To generate these, I used a program I've been using more and more. It's called PARI/GP and is a computer algebra system. One of the fetchers is arbitrary precision arithmetic (i.e. the ability to calculate big numbers). I used the program to generate my table of known values with 50 digits of accuracy.

And here is the implementation:

#include <float.h>
#include "exp_tables.h"

double Exponet
(
  double exponet
)
{
  double result;
  double sum;
  double last;
  double accumulator;
  double exponetOf_a;
  double fact;
  signed integerExponet;
  unsigned loopCount;

  // Of the exponent is too high...
  if ( exponet > centerPointsEnd )
  {
    // Produce +inf
    result = 0.0;
    result = 1.0 / result;
  }
  else
  // If the exponent is too low...
  if ( exponet < centerPointsStart )
  {
    // Produce -inf
    result = 0.0;
    result = -1.0 / result;
  }
  else
  {
    // Get the integer portion of the exponent.
    integerExponet = (int)exponet;

    // Lookup the integer portion of the exponent in the lookup table.
    exponetOf_a    = ln_centerPoint[ integerExponet - centerPointsStart ];

    sum         = 0.0;
    accumulator = 1.0;
    fact        = 1.0;
    loopCount   = 1;

    // Summation loop
    do
    {
      // Save current sum so we can check for changes.
      last = sum;

      fact *= loopCount;
      accumulator *= ( integerExponet - exponet );

      if ( loopCount & 1 )
        sum -= ( accumulator / fact );
      else
        sum += ( accumulator / fact );

      // Next iteration.
      ++loopCount;
    }
    while ( last != sum );
    // ^^^ Loop until no more change is detected (i.e. no more 
    // precision left).

    // Calculate finial result.
    result = exponetOf_a + exponetOf_a * sum;
  }

  return result;
}

// (C) Copyright 2010 by Andrew Que.
// Released as public domain.

Download the tables here.

If you follow the code, you will notice a couple of things. We can take advantage of the fact a summation is a loop. This speeds up two items, (a - x)n and n!. This is because and . Thus, we can accumulate the results similar just like with the summation—except instead of adding, we multiply. The upper limit on the loop is not infinity. The reality is, we only want as much precision as we can store. So once the loop has produced enough precision that the numbers no longer change, it stops. Also, the summation loop starts at 1, not zero. This is because of the factorial. 0! = 1, and 1! = 1. Rather then deal with this in the loop, I started with the second term and moved the results of the first term out of the loop. Evaluated, the first term of the loop comes out to be ea. The (-1)n means this is an alternating series—or that the sign is inverted on even/odd intervals. We can do that better with an if statement.. The loop is really . Note that k is some finite number based on the precision—usually less then 20.

My initial testing shows this function is accurate to about 12 digits.

2 comments have been made.

From sammie

Va beach

April 04, 2010 at 8:49 PM

Reading this made my head hurt.

From Erica

April 05, 2010 at 12:10 PM

I love math. Can you minor in it?

March 30, 2010

Space Port - Part 4 - Numbers

I now have a really massive space ship. Now lets run the numbers to see what would be required to make it work, and how big it really is. 

The outer ring has 100% gravity and contains 90 spheres for a total of 282 km2 (109 sq. miles). All the rings combine give a total of 540 spheres for 1,414 km2 (around 545 sq. miles), and with just the 6 sets rendered, 8,482 km2 (3,275 sq. miles)—a little less land area then the island of Island of Hawai*i.

The outer ring is for people. Assuming a population density of Beloit, Wisconsin (2,176.6 people/sq. mile), there could comfortably be 237,250 people. Up the density to that of New York City (27,440 people/sq. mile) and a total population of 2,445,960 people could be supported. If I had been able to render the full ship with 100 ring sets, the population could have been as high as 300 million people.

We can hold plenty of people, and there is a 5:1 ratio of auxiliary space to living space. The auxiliary space would be used to grow crops, and may be able to make more efficient use of the total cubic area of the spheres. It would seem we have enough space. So how much energy are we going to need in order to move this ship to the edge of the solar system?

First, we need to mass of this ship. This is going to be a very big number. To make things easier to estimate, lets just assume the mass of each sphere is about that if it were half filled with water. Why? Because we need a place to start, and water is fairly dense. I love the metric system for reasons such as this. The weight of 1 cubic meter of water is exactly 1,000 kg or 1 tonne (metric ton). Each sphere has a volume of around 4.1 billion cubic meters, and would have an estimated mass of 4.1 trillion kg. We have 3240 of these spheres for a grand total of 1.36x1016 kg—13.6 quadrillion kg. It's hard to comprehend this much mass because of it's scale.

Now that we know mass, we can determine the amount of energy required to keep it at a constant acceleration. Remember we want a constant acceleration of 9.81 m/s2 so that Earth's gravity is obtained from the linear acceleration. We need to know how much force is required to obtain this acceleration. The Newton unit is a measurement of force, and it is given in kg·m/s2. We have the mass in kg, and the acceleration in m/s2, so fill in the two numbers and we get 1.33x1017 or 133.1 quadrillion Newtons of force.

Now that we know how much force is needed for our constant acceleration, we need to know much much energy will be required to travel to the edge of the solar system. The unit of energy, the Joule, is kg·m2/s2. That is, how much force is being applied for the distance travel. We have force, and we know distance—50 AU or 7.5 trillion meters. So we need 995.9 octillion joules of energy. For comparison, a 1 megaton nuclear bomb contains 4.2 quadrillion Joules of energy. This craft requires the equivalent of 238 trillion 1 megaton devices.

So where does one come up with this huge quantity of energy? The common answer in sci-fi is to use the most dense energy form known—antimatter. Using mass-energy equivalence (yes, I'm about to invoke Einstein's famous E=mc2), 1 kg of mater, if converted to pure energy, contains 8.99x1016 or 89.9 quadrillion Joules of energy. That's the equivalent to the energy of a 21.5 megaton bomb—in just 1 kg. It's easy to see why sci-fi writers like antimatter, and if we could really produce it, we would indeed have an extremely dense form of energy.

Antimatter, however, doesn't convert into 100% usable energy. For those who are not familiar with antimatter, just understand that when mater and antimatter meet, they annihilate each other. The result is energy, transmitted in photons (electromagnetic energy—light, radio waves, ext.) and neutrinos. Neutrinos are useless as energy as they interact so weakly with matter their energy can not be captured. So 50% of the energy in antimatter is automatically lost. In addition, there is an efficiency loss on the engine—presumably some kind of rocket engine. Rocket science is a little difficult—it's rocket science. However, if we use the space shuttle as an example, it is known the rocket engines come out to be about 17% efficient. That is, 17% of the total energy stored in the fuel goes to moving the vehicle. The rest goes into making heat (most of the energy), light and noise. So lets assume our antimatter rockets can obtain 20% efficiency. Between the neutrinos and efficiency, we loss about 90% of of the energy in the fuel. But that's about all the better most cars do. The result is a total of 110.8 trillion kg of antimatter fuel is needed. This comes out to be less then 1% of the overall ship mass. Consider how massive the space shuttle is, and how much of that is just for fuel—this craft is pretty efficient.

To house this much fuel, we need to know how dense the fuel is. Lets assume we can make any kind of antimatter we desire. So anti-Iron would be a good choice. The density of iron is 7,874 kg/m3, and the properties of anti-iron should be similar (if not identical). A storage space of 14.1 billion cubic meters is required. For this, I added the 4 larger inner spheres, each with a radius of 6000 meters. Each would have a volume of 904.8 billion cubic meters—more then enough room for our fuel. Since this is antimatter fuel, some containment system would have to be in place. For how, like many other issues, I am ignoring this.

There we have it. One massive ship. But in theory, we could push it to the edge of the solar system.  Honestly, I love running the numbers.  I now have big spreadsheets full of equations so I can tweak values and see the results.  And this is only one run of "the numbers".

3 comments have been made.

From Erica

April 05, 2010 at 12:21 PM

This was my favorite blog entry you have written so far, I think. It made me feel smart because I understood everything, except what you mean by spheres in the space ship. I wish I was better at calculus though, otherwise I can never be a physicist. :(

From Erica

April 05, 2010 at 12:24 PM

i'm such a noob! You have the rest of the story in the last 3 entries. :P

From Noah (http://www.amadameus.wordpress.com)

April 22, 2010 at 10:37 AM

It may be important to note that neutrinos, although not necessarily valuable to propulsion, may be able to serve other purposes. There is some evidence that neutrinos may be affected by strong magnetic fields, and the interactions they cause may also be able to produce valuable effects as they pass through the ship. Primarily what concerns me is the lack of effective shielding for passengers. Even with several feet of heavy radiation shielding on the engines and the passenger compartments, there are astonishing amounts of energy being released by this antimatter engine. A magnetic nozzle and the use of a redshift engine would help reduce radiation (or at least bring it down to wavelengths which can be absorbed) but this would severely affect the possible efficiency of the rocket.