« Posts by MadRocketSci

The Forum is Back

I’m going to try running a forum again. This time, to try to cut down on spam, I’ll ask my friends and family (who are the intended users) to e-mail me a username and password at ams@amssolarempire.com.

My forums are located at http://www.amssolarempire.com/PrivateForum/

Come one, come all. Hopefully this one will be less dead than the last one.

The Journal of Useless Results: May Issue

The Journal of Useless Results presents:
A paper on the eigenvector/eigenvalue problem: An Algorithm for Direct Numerical Extraction of the Characteristic Polynomial of a Matrix

A New Toy: Raspberry Pi

I am playing around with a new toy tonight:

What you see here is a $35 computer on a board called the “Raspberry Pi”. The ‘hard drive’ feeding this thing it’s instructions is a microSD card (with an SD adapter) smaller than my fingernail. It has 8GB though, so it can store a special fork of the Debian Linux operating system (called “Raspbian”), plus a whole lot of other utilities (such as Apache, PHP, MySQL to form a LAMMP server), python, etc. There are libraries available to access the pinouts via python and C, so you can use a full computer environment to bit-bang electronics. The computer comes with two USB ports (currently plugged up with my keyboard and mouse, but if I stick a wireless network antenna in there, I should be able to control it remotely over a wireless network via ssh/sshd/sshfs.)

Honestly, that HDMI cable (what a ripoff) was almost as expensive as the computer itself! You have $35 to play with, don’t you? Why not try it?

Here you can see my first attempt at messing with the pins through a small python program. I am blinking an LED.

I can see all sorts of uses for this thing. You could have an always-on battery/usb powered internet-LAMMPserver-controller that, on recieving some socket connection or webpage-command pings microcontrollers and sends them commands. The microcontrollers could then move motors, turn things on and off, I could turn on my coffee maker, automatically drop a hammer on my alarm clock after detecting a noise, arm the trapdoor over the shark-tank, etc.

 

Quicksort implementation

I’ve recently coded a q-sort template function implementation. It’s part of another project, but it’s sort of stand-alone.

Author: Aaron M. Schinder
Date: 4 May 2013
Purpose: ams_qsort is an implementation of quicksort, the popular O(n*log(n)) sorting algorithm. There are millions of q-sort implementations out there, but this one is mine. This was programmed partially for the ability to sort multiple lists, but mostly for the exercise in converting a recursive program to a procedural loop.

It has some desirable features over most implementations of qsort:
1. It doesn’t use recursion of the function calls. Instead, it implements recursive behavior through the use of a tree data-structure. This means it won’t blow your call-stack when sorting large lists (which is the point of having an O(n*log(n)) sorting algorithm in the first place!).
2. What the actual sorting function returns is not a single sorted list, but a permutation map. The permutation map can be applied not just to this list, but to other related lists as well to sort each according to the first. First you acquire the permutation map that will sort the target list, then you apply it to lists.

Main functions of interest:
bool quicksort(std::vector<T> *V, std::vector<long> *map, bool (*comparator)(T, T));
bool rearrange(std::vector<T> *V, std::vector<long> *map);
void invertmap(std::vector<long > *map, std::vector<long > *inv);
void mapcompose(std::vector<long > *map_in_main, std::vector<long > *map_in_sub, long indstart);

Typical use:
quicksort(&myvector,&map,&comparatorfn);
rearrange(&myvector,&map); //rearranges myvector (sorts it)
rearrange(&myothervector, &map); //rearranges some other vector (sorts it according to myvector)

invertmap(&map,&othermap); //creates a map which, when composed with map, de-permutes it.
rearrange(&myothervector,&othermap); //unsorts the myothervector

bool comparator(T A,T B)
comparator is a pointer to a bool function that returns true if A>B, according to whatever evaluation of A and B you want.

ams-qsort.hpp

ams-qsort.cpp

 

Websurfing

I’m surfing the internet – from my python shell 😛

#!/usr/bin/python

import os,sys,math,socket

print “Hello world!”

print “Socket test”

s = socket.socket(socket.AF_INET,socket.SOCK_STREAM);
s.settimeout(10);
s.connect((“www.amssolarempire.com”,80));
#s.send(“HTTP REQUEST”);
msg = “GET / HTTP/1.1\n”;
msg = msg + “Host: amssolarempire.com\n”;
msg = msg + “Connection: close\n”;
msg = msg + “User-Agent: PythonExperiment\n”;
msg = msg + “\n”;
s.send(msg);
t = ” “;
ret = “”;
while(t!=””):
t = s.recv(1);
ret=ret+t;

print ret;

s.shutdown(0);
s.close();

[Untitled]

Shapelib is coming along. I can now triangulate arbitrary manifold regions in two dimensions. (It may not be constrained delaunay though – I’m going to have to check).

test5 test5_shape test4 test4_shape

Kerbal Space Program Review

One game that I have wasted far too much time on since passing quals has been Squad Software’s Kerbal Space Program. Kerbal Space Program is a game that puts you in charge of a space agency, throws an infinite number of rocketry parts at you, and lets you stick them together in almost any arbitrary way to construct spacecraft. The Kermen are a fairly bold lot – even with me in charge of rocket design, they still keep signing up. 😛

Anyway, you can build just about anything in this game. Orbital rockets, space stations, bases on other planets. With version 0.19, you can dock and un-dock modules that you launch to assemble arbitrarily complicated structures in orbit or elsewhere.

The fascinating thing about this game, apart from the completely freeform nature of what you can build, is the physics. The game physics are very challenging, because of the realism involved. If you play this game, and want to accomplish the more interesting stuff (landing your astronauts on the moon, getting them to rendezvous in orbit, getting them to another planet without running out of fuel), you’ll find yourself learning a great deal about orbital mechanics, and the basics of astronautical engineering and spaceflight. I’m an astronautical engineer, so I may have an advantage in this department – but it’s fascinating how easy it is to learn things when you are playing with it – when you can interact with a world and watch it respond in the context of a game.

As you build ever more complicated rockets, you’ll find yourself intuitively understanding things like why we stage them, how they fly, how you get into orbit, why Neil Armstrong and the rest of the lunar lander pilots had nerves of steel.

Version 0.19 also includes the rest of the Kerbal’s solar system. Pictured below are the Kerbal version of Mars (Duna), a sort of golden-age Venusian planet (Eve), and what happens when I try to land a lander in planetary gravity.

screenshot12

screenshot6screenshot11

Carmly’s still thrilled to be on the surface and alive. The Kerbals are gung-ho like that. 😛 (For various values of alive). Lander 2 is still up there. Theoretically in the hands of a competent pilot, it could rescue him.

Hillariously exploding ill-assembled vehicles, and crashed landers aren’t the only threat to your overly trusting astronauts. Nothing quite conveys the eerie tension of interplanetary flight like this game. Watching your safe blue homeworld dwindle into a tiny dot lost against the stellar background. If you’ve got your carefully assembled mothership into solar orbit, then you’re still mostly at the mercy of solar gravity. Make a wrong move on your delicate maneuvers, and you may end up having to orbit the sun for an extra 3 years, or blow your maneuvering margin and get trapped millions of miles from anything.

Anyway, if you want a very fun crash course in what realistic space-travel is like, I can’t recommend this game highly enough.

Qualifying Exam: Spring 2013 – Victory!!

I managed to pass the PhD qualifying exam yesterday. A semester of constant worry and cramming for this test have managed to pay off in the end. Now I will no longer need to focus so much on coursework, and can turn my attention fully to research. Anyway, that hurdle is passed.

The next challenge: What is the Thesis? 😛

 

Anyway, woohoo! Yes! Victory is mine!

Study Circle

So … Uncyclopedia has a bunch of hillarious misinformation (?) about Georgia Tech, one bit of which had me laughing like a maniac:

 

The typical study environment of tech students. This pentagram offers 360 degrees of studying wall also giving students direct access to the devil for bargaining purposes

Dead Week

Dead week is the name given to the week before finals by Techies. The name dead week is derived from the phrase “I wish I was dead”, because during dead week this is heard constantly. During this week students spend most of their time studying and bargaining with Satan to pass their classes. Satan typically asks for the blood of a non-virgin in exchange for a “C”, as opposed to the blood of a virgin, because he knows it will be harder for Techies to come across.

—–

I’m not into summoning the devil, so I figured I’d be pretty safe. However, I have noticed the “study circle” accumulating lately as I have been constantly cramming for quals …

OLYMPUS DIGITAL CAMERA

Planet Around Alpha Centauri

While I’m posting stuff (I really do need to be more consistent. Was it Mark Twain that said the hardest thing in the world was actually keeping a journal?)

The European Southern Observatory has found an earth-massed planet orbiting Alpha Centauri (Earth Massed, but it is far too close to be within the habitable band).

http://www.space.com/18089-earth-size-alien-planet-alpha-centauri.html

Planets orbiting further out are possible, and the search is still ongoing.