From small personal projects to the data-ecosystems of fortune 500 companies, IaaS (Infrastructure as a Service) is becoming the standard way of obtaining infrastructure for any computing-related task. IaaS is, in short, a way of supplying computational-infrastructure that is similar to how you get water or electricity. Instead of you setting up your own pipes or electric-cables, you simply subscribe to a public system that runs on a common infrastructure and get charged a standard rate for a given unit of the utility you are consuming. In the same way, IaaS allows you to use 'public' data-centers (public meaning not owned by you) to host your applications while paying a standard rate for the computing power, memory, and bandwidth used. Amazon is the most popoular infrastructure supplier with AWS, but Google, Microsoft, Rackspace, and many others are also big players in the IaaS game. All of these companies offer APIs which allow us to create, destroy, and manage VMs programmatically. Today, I'll be going over how to do this through Google's IaaS offering, Compute Engine.

I'll start by going over how to set up an account with the Google Developers program and install the Google Cloud SDK, which will give you simple command-line access to Google Cloud Services. Then I'll show you how to use the gcloud tool to access the Compute Engine API from your command-line. Finally, I'll go over my library libGVM, which is a small container of python scripts that wraps around the API provided by Google. This library keeps track of running instances and instance-snapshots, lets you set default values for various virtual-machine parameters, and much more.

In this post, we build off the theory developed in Part 1 and actually implement a double-pendulum simulator in a few different programming languages. We'll start by writing our own Runge-Kutta solvers which will give us the position, velocity, and acceleration data that is needed to completely describe the trajectory of a double pendulum system given an arbitrary set of initial conditions. Once we have this data, we can move onto plotting it using a few different plotting libraries. The languages I'll be going over are Matlab, C++, and Python. I chose these languages because they are all quite popular and any given programmer is likely to understand at least one of them.

Getting the Code

All of the code is hosted here on Github, and more details can be found at the Double-Pendulum-Simulation project page on my website. The entire project is available for download via either of these two links : .Tar , .Zip. You can also clone it straight from the command line :

git clone
cd Double-Pendulum-Simulation

Quick Review

Below is a quick summary of the last post, for more information, read Part 1.

I've always thought that the double-pendulum makes an interesting system to simulate because the problem of doing so sits at the intersection of physics, mathematics, and computer science. The double-pendulum is also an approachable example of a chaotic system, which means it exhibits very complex and interesting behavior. Since I find it so interesting, I'll spend the next few posts writing about the topic. I'll start in this post with a derivation of the equations of motion and a look at the methods used to solve these equations. In the next post we'll actually solve these equations and implement the simulation in a few different programming languages, drawing performance and other comparisons along the way. Post 3 will wrap up this series with a deeper look into the complexities of the system, including an examination of its chaotic properties

The Double Pendulum - A snapshot at 5 seconds into my double-pendulum simulation in matlab

Welcome to the first post for my new blog. I'm John Allard, a junior Computer Science student at UC Santa Cruz. I'll be writing about anything I find particularly interesting, which will mostly involve computing, math, and physics. I don't really expect many people to read the stuff I write, this just serves as a creative writing outlet and a place to practice my web-programming skills. With that said, I'm thinking about starting with a series of posts about the double-pendulum and how to go about simulating one of them, so look for that in the near future.

While my blog might be a bit-empty right now, the rest of my website actually is quite packed with content. You can check out the list of projects and even my recent commits on Github through my website. I also have my Resume and CV available on my profile page.