Friday, May 29, 2015

Double Pendulum, more Iowa rides and the slug

As promised a couple of days ago, I went ahead and solved the double pendulum problem in classical mechanics. Definitely not as interesting as the Schwarzschild metric, but still pretty cool. I can never figure out how to make cool animations in matplotlib (any suggestions???) so I didn't make any. Regardless, the plot I'll present does show the crazy motion of the double pendulum (assuming I got all my algebra right!).

What's the motivation behind this problem? I remember sitting in Mechanics in my sophomore year wondering how the hell anyone could go about solving the double pendulum problem -- the equations of motion are super complicated! The method I employed to solve the two body problem and to solve for geodesics in the Schwarzschild metric still applies here. I set up the Lagrangian for the system, and apply the Euler-Lagrange equations, generating my equations of motion for the system. With these in hand, I replace my generalized coordinates and their respective time derivatives with new coordinates. This reduces the order of the system, but adds an extra equation per set of generalized coordinate. With a system of first order differential equations, I can apply any appropriate numerical method for first order systems. Forward Euler has a small stability region, so the best move, especially with unstable systems (like the double pendulum) is to use an implicit method, like backward Euler. The problem with backward Euler method is that you have to solve for the roots of a system of nonlinear equations at each time step. The best way to go about this is to use the corresponding forward Euler time step as the initial guess for the root. The SciPy optimization scipy.optimize.root method converge in a relatively small number of iterations (less than 5 or 10 iterations) when using the 'hybr' solver. Ultimately backward Euler is substantially faster (and more accurate) than forward Euler, because I can use a time step size about 3 orders of magnitude larger in backward Euler. This difference in time step (apparently) far outweighs the cost of solving the system of nonlinear equations at each time step. This is a testament to the power and speed of MINPACK. All I can say is that I'm deeply grateful that I live in 2015 as I don't have to write all these fortran routines myself.

Anyways, on to the double pendulum! I'm not going to solve it completely here, as I don't really want to type up the equations of motion. I'll set up the problem, and it'll become clear that moving from the double pendulum from the single pendulum is no small task. Imagine that we've got a single pendulum (just a weight attached to a massless rod that doesn't flex) hanging from some surface. The Lagrangian for this system is the following.
$$L = T-V \\
L = \frac{1}{2}m_{1}(l_{1}\dot{\theta_1})^2 - m_1gl_1(1-cos(\theta_1))$$
I've placed the origin at the place where the pendulum is attached to the surface, such that $x_1 = l_1sin(\theta_1)$ and $y-1 = l_1cos(\theta_1) $. I'm using the subscripts $m_1$, $\theta_1$ and $l_1$ because we're going to develop the double pendulum problem in a little bit. $g$ is the gravitation constant here on the surface of Earth, $l_1$ is the length of the rod of the pendulum, and $m_1$ is the mass of the object at the end of the pendulum. Notice that I could just as easily write the Lagrangian as follows:
$$L = \frac{1}{2}m_{1}(l_{1}\dot{\theta_1})^2 - m_1gl_1cos(\theta_1)$$
The equations of motion will be the same; when we apply the Euler-Lagrange equations
$$\frac{d}{dt}\left( \frac{\partial L}{\partial \dot{q}} \right) = \frac{\partial L}{\partial q} $$
the right side of the equation will be the same regardless of how we set up the Lagrangian. This will come in handy later. Now let's move on to the double pendulum. The coordinates of the second pendulum are as follows:
$$x_2 = l_1sin(\theta_1) + l_2sin(\theta_2) \\
y_2 = l_1cos(\theta_1) + l_2cos(\theta_2) $$
or
$$ x_2 = x_1 + l_2sin(\theta_2) \\
y_2 = y_1 + l_2cos(\theta_2) $$
Oh fudge. Now we have to differentiate with respect to time and then square these variables! We get some cancellations, but its still pretty ugly.
$$\dot{x_2} = l_1cos(\theta_1)\dot{\theta_1} + l_2cos(\theta_2)\dot{\theta_2} \\
\dot{y_2} = -l_1sin(\theta_1)\dot{\theta_1} - l_2sin(\theta_2)\dot{\theta_2} \\
\dot{x_2}^2 = (l_1cos(\theta_1)\dot{\theta_1})^2 + (l_2cos(\theta_2)\dot{\theta_2})^2 + 2l_1l_2cos(\theta_1)cos(\theta_2)\dot{\theta_1}\dot{\theta_2} \\
\dot{y_2}^2 = (l_1sin(\theta_1)\dot{\theta_1})^2 + (l_2sin(\theta_2)\dot{\theta_2})^2 + 2l_1l_2sin(\theta_1)sin(\theta_2)\dot{\theta_1}\dot{\theta_2} \\
\dot{x_2}^2 + \dot{y_2}^2 = (l_1\dot{\theta_1})^2 + (l_2\dot{\theta_2})^2 + 2l_1l_2\dot{\theta_1}\dot{\theta_2}(sin(\theta_1)sin(\theta_2) + \cos(\theta_1)\cos(\theta_2)) \\
\dot{x_2}^2 + \dot{y_2}^2 = (l_1\dot{\theta_1})^2 + (l_2\dot{\theta_2})^2 + 2l_1l_2\dot{\theta_1}\dot{\theta_2}cos(\theta_1 - \theta_2)$$
Notice that lil' trig substitution that allows us to get from the penultimate line to the last line. In the end, our Lagrangian is pretty nasty looking.
$$ L = T - V \\
L = \frac{1}{2}m_1(l_1\theta_1)^2 + \frac{1}{2}m_2((l_1\dot{\theta_1})^2 + (l_2\dot{\theta_2})^2 + 2l_1l_2\dot{\theta_1}\dot{\theta_2}cos(\theta_1 - \theta_2)) \\ - (m_1g(l_1 + l_2 - l_1cos(\theta_1)) + m_2g(l_1 + l_2 - l_1cos(\theta_1) - l_2cos(\theta_2)) $$
Just like before, I can drop all the freestanding $l_1$ and $l_2$ terms in the potential energy term.
$$L = \frac{1}{2}m_1(l_1\theta_1)^2 + \frac{1}{2}m_2((l_1\dot{\theta_1})^2 + (l_2\dot{\theta_2})^2 + 2l_1l_2\dot{\theta_1}\dot{\theta_2}cos(\theta_1 - \theta_2)) \\ + (m_1gl_1cos(\theta_1)) + m_2g( l_1cos(\theta_1) + l_2cos(\theta_2)) $$
This simplifies things a little bit. Now we have to apply the Euler-Lagrange equations to get the equations of motion. I'm not going through all the steps, but needless to say that it gets a little complicated, especially when you have to take the total derivative with respect to time of the left side of the Euler-Lagrange equation. It can be done however, and we can isolate $\ddot{\theta_1}$ and $\ddot{\theta_2}$ terms.
\begin{array}{rcl} \ddot{\theta_1} &=& \frac{4l_2^2m_2(\dot{\theta_1}sin(\Delta\theta)cos(\Delta\theta)\Delta\dot{\theta}) - 2l_1gm_2sin(\theta_2)cos(\Delta\theta) + \dot{\theta_2}sin(\Delta\theta)\Delta\dot{\theta} - gl_1sin(\theta_1)(m_1+m_2)}{l_1^2(m_1+m_2) + 4l_1^2m_2cos^2(\Delta\theta)} \\
\ddot{\theta_2} &=& \frac{2l_1}{l_2}(\ddot{\theta_1}cos(\Delta\theta) - \dot{theta_1}sin(\Delta\theta)\Delta\dot{\theta}) + \frac{g}{l_2}sin(\theta_2) \end{array}
where $\Delta\theta = \theta_1 - \theta_2$ and $\Delta\dot{\theta} = \dot{\theta_1} - \dot{\theta_2}$. Note that the equation for $\ddot{\theta_2}$ has a $\ddot{\theta_1}$ term. This is not a problem when actually solving the problem; we simply plug in the expression for $\ddot{\theta_1}$. This allows us to create a coupled system of four first order differential equations when we make the following substitutions. If you notice any errors in my algebra, please feel free to comment and let me know!
$$ \theta_a = \theta_1 ; \theta_b = \dot{\theta_1} \\
\theta_c = \theta_2 ; \theta_d = \dot{\theta_2} $$
Next, we solve with backwards Euler method. Below is a plot I made in matplotlib. The black line is the position of the first mass in time, and the red line is the position of the second mass as time progresses.

Below is a plot that shows how $\theta_1$ and $\theta_2$ change with time. The time units are arbitrary.
Pretty cool, huh? Moving away from talking about math/physics, Tom and I have been taking some good rides the last couple of days. Yesterday we took a short (~30 mile) ride, but it was brutal! We rode out into a 20 mph head wind! As I've come to kind of take for granted here in Iowa, the weather was perfect -- 80 degrees and sun. I'm getting a rather unpleasant farmer's tan. It doesn't seem to matter how much sunscreen I apply, I just keep getting tanner. I think it's rides like these that I'll remember and cherish when I get older; spending time with my parents is such a rare treat anymore. I'm excited for Tom to come out and chill with me in Nevada/Utah in a week or so. 

Here's something I've been thinking about lately. In the imperial system we talk about our weight, while in the metric system we talk about our mass. We use pounds and kilograms kind of interchangeably, even though they are fundamentally different. A pound is a unit of force, and the kilogram is a unit of mass! The slug is the imperial unit of mass. A pound is the amount of force required to accelerate a slug of mass by $1 \frac{ft}{s^2}$. In imperial units my mass is about 5.6 slugs. 






Tuesday, May 26, 2015

Dat gravel life

I took the old Schwinn world sport out for a spin today, and I ended up in the Amana colonies, about 30 miles outside of Iowa City. The last 12 miles on the route to Amana is unpaved. In other words, I rode gravel. I grinded the gravel. I ground the gravel, on my gravel grinding Schwinn, with its under-inflated fatty tires, perfect for floating effortlessly over all that gravel. Want proof? Check it out:


Riding on gravel is fun, but like anyone who's ever ridden gravel, I wonder if it necessitates its own category of bike (In reality, I shouldn't even be talking, because I'm riding a gravel bike across the country starting in a few days.). I think I like the name "adventure bike" more than gravel bike. Every time I got on my Diamondback this last semester and turned off on some random unpaved trail, I felt like I was taking an adventure; going some place I would never be able to go on my sexy slice of Cannondale. I got to explore in a way that I'd never explored before, all because my bike could go anywhere and I didn't have to worry about traction or pinch flats or messing up my (heavily discounted) $3200 race bike. Don't get me wrong, I love my Cannondale -- there's nothing quite like the feeling of blasting up a hill at 22 mph -- but having a road bike that can go anywhere is pretty sweet.

Today I got muddy, I saw some gorgeous countryside, and I got an entire road all to myself. Gravel's dope. 

Monday, May 25, 2015

Iowa is where it's at!

Today Tom and I went out for a bike ride. We did a 35 mile loop, heading to the Southwest to start and then coming back along an eastern leg and then a northern leg. The weather was pretty wet and cold yesterday, but it ended up being a gorgeous day. A perfect Iowa day. Little puffy clouds in a mostly brilliant blue sky. Tons of son, about 75 degrees. I got a little sunburned, despite applying sunscreen before I left. Unfortunately I didn't take any pictures. I have difficulty taking pictures because I fail to understand how I can capture a moment with a photo. Few photos can attempt to replicate the sensation of standing atop a hill surrounded by the vastness of rolling farmland. Tom and I spotted an interesting phenomenon a couple of times today: the wind blowing through fields of alfalfa creating undulations of color. It's a little disconcerting, because it almost feels like looking at a body of water. I like to think of it as a time lapse movie of a carpet. At every time slice you ruffle up the carpet differently, and when you stitch it all together you end up with an effect like the color gradations are rolling through the carpet.

When I was younger (before I went to college) the fam and I would occasionally take trips down to Iowa to visit family friends or to see my grandparents. More recently, my mom and I would come down to visit Tom when he was still going to school at the University of Iowa. Every time we would come down here, I would get this sinking feeling in the pit of my stomach. I had this feeling that Iowa was so far away from everything cool that I had to be missing out on something. I could be in New York City or Minnesota hanging with the homies, or taking some dope adventure somewhere or doing anything other than going to Iowa. Now I've been to New York City. I've spent a semester there. I had a good time, but here are some observations about NYC: 1. It's expensive and 2. it takes about and hour to bike to place where you can start taking a bike ride. As long as I don't have a car and I'm not making my own money, I don't think I'll ever truly feel at home in New York City. Strangely, I feel okay being here. I like it a lot, actually. No sinking feeling in my stomach. No longing for missed adventures. The adventure is here, right now. Playing physics in the afternoon, biking in the morning, drinking beer, chatting with my parents.

For those of you who are cursing me for not talking physics, I'm working on some more classical mechanics stuff. I'm going to solve the double pendulum problem, and then maybe move onto something involving E & M. I feel this need to solve all the differential equations we stated but never solved in my physics classes.




Sunday, May 24, 2015

Geodesics in the schwarzschild metric

I'll resume making posts about biking once I get in some good rides this week. I'm planning a cool gravel ride up to the Amana colonies tomorrow. It'll be my first time using my new shoes! We've been busy here at the ranch partying. My dad Tom just got his Ph.D. so we threw a big party to celebrate. Go dad! We've been drinking and eating and generally having a good time. I even went out bowling the other night. Hanging out with James and Iju was cool, and I'm looking forward to seeing them a little more before I start out on my trip in June.

I've had a little time to play around with the geodesic equations associated with the Schwarzschild metric. I apologize in advance if I misspell Schwarzschild. If you're interested in reading a derivation of the metric and a proof that it is a solution to the Einstein field equations in vacuum, you'll have to look elsewhere.... Anyways, the line element in this metric looks like the following,
$$ds^2 = (1-\frac{r_g}{r})dt^2 - (1-\frac{r_g}{r})^{-1}dr^2 - r^2(d\theta^2 + sin^2(\theta)d\phi^2) $$
where $r_g$ is the Schwarzschild radius. If you're like me and you stop understanding things once $c = G = 1$ then
$$ r_g = \frac{2GM}{c^2} $$
Remember that the line element is related to the metric by the following relationship.
$$ ds^2 = g_{\mu\nu}dx^{\mu}dx^{\nu} $$
We could visualize the metric as a four by four matrix that we contract twice with our differential vectors.
$$ g_{\mu\nu} = \left[ \begin{array}{c} 1-\frac{r_g}{r} & 0 & 0 & 0 \\ 0 & - (1-\frac{r_g}{r})^{-1} & 0 & 0 \\ 0 & 0 & -r^2 & 0 \\ 0 & 0 & 0 & r^2sin^2(\theta)  \end{array} \right] $$
Normally the first thing we do when solving the geodesic equations for this metric is say that $\theta = \frac{\pi}{2}$, but because I'm using Python, it doesn't really matter. The job at hand is to solve the following four differential equations:
$$ \frac{d}{d\lambda}\left( \frac{dx^{\mu}}{d\lambda}  \right) + \Gamma^{\mu}_{\alpha\beta} \frac{dx^{\alpha}}{d\lambda} \frac{dx^{\beta}}{d\lambda}= 0 $$
$\lambda$ is just some parameter. The $\Gamma$ symbol is related to the metric through the following relation.
$$ \Gamma^{\gamma}_{\beta\mu} = \frac{1}{2}g^{\alpha\gamma}(g_{\alpha\beta,\mu} + g_{\alpha\mu,\beta} - g_{\beta\mu,\alpha}) $$
If you're not familiar with the upper versus lower index notation, in this situation, the upper indices on $g$ indicate that we're using the inverse metric. Calculating this looks pretty rough, but I made some Python code that calculates these "Christoffel symbols" with the help of SymPy. Check out this snippet below (I think some of it might get cut off -- just check it out on Github if you're really interested). This little chunk of code makes forming the geodesic equation much simpler. Ultimately, after plugging everything in, we get a set of reasonably nasty looking equations.
$$ \begin{array}{rcl} \ddot{t} &=& -\frac{r_g}{r(r-r_g)}\dot{r}\dot{t} \\
\ddot{r} &=& -\frac{1}{2}\frac{r_g(r-r_g)}{r^3}\dot{t}^2 + \frac{1}{2}\frac{r_g(r-r_g)}{r^3(1-\frac{r_g}{r})^2} + (r-r_g)sin^2(\theta)\dot{\theta}^2 - (r-r_g)\dot{\phi}^2 \\
\ddot{\theta} &=& -\frac{2\dot{r}\dot{\theta}}{r} - cot(\theta)\dot{\theta}^2 \\
\ddot{\phi} &=& -\frac{2\dot{r}\dot{\phi}}{r} \end{array}$$
Solving these equations numerically is cumbersome, but not super hard! We just make the same substitutions I made in my previous post and we get a system of coupled first order ODEs. I ended up just solving this using forward Euler's method, because I didn't want to manually form the Jacobian matrix for this system. That said, I do plan on making a code that will automatically form the Jacobian matrix given some system of equations and set of variables. This system would greatly benefit from backward Euler, as the step size I ended up using was really small, and it took forever to calculate the geodesics. Anyways, below is a picture of one of the geodesics I calculated, assuming that $\theta=\frac{\pi}{2}$. The red circle is a circle with Schwarzschild radius equal to one (the same radius I used in calculating the geodesic). Pretty cool!
I am by no means convinced that this solution is correct, so if you have any suggestions, make a comment!


Saturday, May 23, 2015

Orbits continued

In my last post I mentioned how I've been busy setting up the Lagrangian for a particle in a gravitational field and solving the associated equations of motion. This is my first blog post where I use LaTeX, so bear with me. The Lagrangian for this system is reproduced below. As the gravitational potential energy depends on only on radius, I thought it best to set this up in polar coordinates. Note that solving this numerically in cartesian coordinates is no big either!
$$ L = T - V $$
$$ L = \frac{1}{2} m (r^2\dot{\theta}^2 + \dot{r}^2) + \frac{GMm}{r}$$
$$ \dot{r} = \frac{dr}{dt} $$
$$ \dot{\theta} = \frac{d\theta}{dt} $$
We arrive at the associated equations of motion for $\theta$ and $r$ simply by the applying the Euler-Lagrange equations so as to minimize the action.
$$m\ddot{r} = mr\dot{\theta}^2 - \frac{GMm}{r^2}$$
$$mr^2\ddot{\theta} + 2mr\dot{r}\dot{\theta} = 0 $$
Holy moly this looks like a mess. I don't even know how to start solving this analytically. Luckily, I have a powerful laptop at my disposal, so I can solve this system of couple ODE's numerically. Before I do anything though, I need to turn this into a system of first order ODE's. This is a clever little trick to simplify this problem quite a bit. The way I'll go about this is by creating new variables that correspond to my generalized coordinates $r$ and $\theta$ and their first time derivatives $\dot{r}$ and $\dot{\theta}$. I'll give everything a subscript just to keep track.
$$ r_1 = r ; r_2 = \dot{r}$$
$$ \theta_1 = \theta ; \theta_2 = \dot{\theta}$$
Now, instead of having two 2nd order ODE's, I have a system of four 1st order ODE's. I can thus rewrite my original equations of motion in terms of these new variables $r_1, r_2, \theta_1$ and $\theta_2$. I've gotten rid of the $m$ term in both equations to make things look nice.
\begin{array}{rcl} \dot{r_1} & = & r_2 \\
\dot{r_2} & = & r_1\theta_2^2 - \frac{GM}{r_1^2} \\
\dot{\theta_1} & = & \theta_2 \\
\dot{\theta_2} & = & \frac{-2r_2\theta_2}{r_1}\end{array}
With expressions for the first derivatives, I can now march my initial conditions through time using a simple numerical method for ODE's. I implemented this in Python using forward and backward Euler's method. Backward Euler is much harder to implement, but it ended up being faster than forward Euler (despite having to solve a system of nonlinear equations at each time step) because the time step was considerably (about 2 or 3 orders of magnitude) larger. Instead of writing out $r_1, r_2, \theta_1$ and $\theta_2$, I'll define a vector $\vec{r}$ whose elements are the variables I'm solving for.
$$ \vec{r} = \left[ \begin{array}{c} r_1 \\ r_2 \\ \theta_1 \\ \theta_2 \end{array} \right] $$
Similarly,
$$ \dot{\vec{r}} = \left[ \begin{array}{c} \dot{r_1} \\ \dot{r_2} \\ \dot{\theta_1} \\ \dot{\theta_2} \end{array} \right] $$
With this notation, forward Euler becomes
$$ \vec{r}_{n+1} = \vec{r}_n + h\:\dot{\vec{r}}_n$$
and backward Euler becomes
$$\vec{r}_{n+1} = \vec{r}_n + h\:\dot{\vec{r}}_{n+1}$$
Where $h$ is the time step. Note the implication of writing the $n+1$ subscript in the backward Euler equation; we now have to solve a system of nonlinear equations at every time step. This amounts to a lot of calculations! Luckily SciPy has a really fast nonlinear solver. All I have to do is feed it the jacobian for the system and some good initial guess, and it returns the solution in a very small number of iterations. This is no doubt because the method is based off of Newton's method, and the initial guess I use is the $r_{n+1}$ I would have calculated using Newton's method. If you want to see the code, just hit me up and I'll send it!


Iowa, beer, and orbits

Iowa, the land of $7 six packs and tarmac country roads. Sunny days and rolling green landscapes. The Heartland. My parents moved since the last time I was here, and I admittedly was a little apprehensive about seeing their new house. It's a nice place, and it already feels like their home. It's already starting to smell like a Shaff/Bahr residence, like the house in St. Paul. Yesterday I went on a ride with my dad and some family friends. It was gorgeous. The weather was nice and cool, the sun was beaming, and it felt like we had a tail wind for the whole ride. We stopped for about an hour at a bar and had a couple of beers. It's so nice to sit and chat with people that I've known my entire life. Also, Iowa has a rad local brew scene! One of the highlights of yesterday was the fact that I got to ride my road bike. After rolling around on my Diamondback all semester, the road bike is a dream. It's light, responsive, "laterally stiff and vertically compliant", and it looks bad ass, especially with a port-o-potty in the background.

The crabondale!
 Here's a shot of some of the landscapes I encountered yesterday out riding. Sometimes I feel like plane travel is too fast. Going from the West Village in Manhattan to this in the space of a half day is too fast to process. It's disorienting. I know that in a couple of days the feeling will pass, and I'll settle in to this place, but for the time being I get to revel in the wonder and discomfort that comes with being transported, almost instantaneously, from place to place.



One of my favorite parts of GR was looking at the Schwarzschild metric. As Gruz' said, it makes one think that one knows GR because it allows one to see geodesics in a solution to the Einstein field equations. Instead of jumping in to solving the geodesic equation associated with this problem, I thought it would be fun to start with the classical orbital mechanics problem. We talked about this problem extensively in Mechanics last year, but I never actually sat down and solved the equations of motion associated with this problem. I don't know how to solve these equations analytically, but I do know how to solve them numerically. I'll write more about solving this problem in my next post, once I figure out how to put LaTeX into blog posts. 





Tuesday, May 19, 2015

Last ride in NYC

Yesterday I took my last ride in New York City. Sad times, exciting times. Riding here has been an incredible way to explore the city. As I tell my friends, I've seen parts of the city that I otherwise would never have seen using the subway and walking. Most of the time however I found myself leaving the city in the attempt to find some solitude. I enjoy the sounds of the city, but sometimes it's nice to be in a place where my breathing is the dominant sound around me. Riding along dirt and gravel trails in the woods (or what feels like the woods) has this mesmerizing effect on me. I found myself taking 60 mile rides up the West side of the Hudson just so I could get on that 5 mile stretch of gravel trail that starts south of Piermont and goes right into downtown Nyack. The sound of my Kenda Happy Medium tires rolling against unpaved surfaces is wonderful companion as I fly up and down these trails. Unlike riding road riding, the interface between the bike and the ground is not something you take for granted. One can lose traction while turning on road tires, but its pretty damn hard compared to on gravel. Road tires are also in constant stealth mode; once one throws knobs and bumps on one's tires, they get loud! People can always hear me passing them just by the crunching sound of my tires.

By the way, those tires are awesome. If I know that I'm taking rides that are going to be mostly off road, I keep 35 psi in the back and about 30 in the front and I get insane traction and great mush factor. New York City potholes have nothing against 35 psi in a 40c tire! Sometimes I end up skidding around tight corners, but these tires are pretty easy to control. Unfortunately I've pretty much worn all the tread off the back tire. What blows me away is that my bike came stock with these tires. Usually tires are the first thing manufacturers skimp on when putting together a bike. I'll probably throw on something a little more road specific before I head out across the country.

I don't have any pictures of places that I've been, but I've got one of this super dirty ride I took a couple of days ago. It wasn't raining, but it was super humid, so I was sweating like a pig. Every particle of dust and dirt stuck to my legs. I wasn't cross-racer muddy, but I was happily covered in a layer of dirt and grime. There's nothing quite as satisfying as getting dirty.

Yes, I mostly wear white cotton socks when I go riding. As if my foot wasn't enough, this photo actually contains a bonus foot/shoe combo. 







Friday, May 8, 2015

Friday Ride

I wanted to go out around 8:30 today and ride up to Nyack, but I was feeling supremely uninspired. As a result, I left around 11 after coding, eating, and reading the news. I like drinking loose leaf green tea and reading the news in the morning. It's one of my favorite rituals, in fact. I've been working on this little Python GUI that creates graphs that one can manipulate, like in Mathematica. It's a little frustrating that matplotlib doesn't allow for easy manipulation of parameters in graphs. I thought that it would be cool to build a GUI that allows the user to easily change parameters in their equations via sliders. I also thought it would be cool if the user could enter equations in non Python syntax. Additionally, my GUI also spits out standalone Python/NumPy/Matplotlib code that can be used to generate the plot that is currently being visualized in the GUI. I recognize that this kind of software has been made a million times over, but it's a good learning exercise for me, as I don't have a lot of experience in making GUIs.

Anyways, I've gotten tired of crossing the George Washington bridge during week, as the North walk is open instead of the South walk. The North walk means that I have to go up and down a bunch of stairs, which is a pain the ass with my riding shoes. No doubt this is my fault for buying ultra-stiff ultra-light riding shoes, but hey, they work well when riding. I resolved to cross the Broadway bridge in between Manhattan and the Bronx (called the Manhattan bridge, I think) and head up to Van Cortlandt Park. It was sweet! Van Cortlandt park, unlike many parks in NYC allows cyclists to use the trails. Many of these trails are unpaved and don't seem to see a lot of use. I took some air out of my fatty tires and tore shit up. I'm not very good at riding trails with lots of rocks and roots, so I had to walk some of the steeper climbs, but I think I ultimately did well. I'm excited to go back tomorrow or on Sunday and see how far North some of the unpaved trails go -- many of the trails leave the park and continue on into Westchester county. Below are some pictures of the scenery in Van Cortlandt park. It's hard to believe that I was riding in one of the most densely populated urban areas (if not the densest) in the US.

This trail was just outside of the park, actually

Behind this is a golf course



Sunday, May 3, 2015

100 miles, reverse Autumn

There was a moment yesterday when I was passing by Iona island, right by Bear Mountain, when I felt a rush of longing for the roads I wouldn't be able to ride. I wanted to turn around and keep riding past Bear Mountain, into the mountains north of the city. Realizing that I can only ride so far in one day, I of course kept riding South towards my current home, but that feeling pervades my thoughts today. The Hudson river valley simultaneously reminds me of my first home, in St. Paul, MN and instills in me a sense of wonder at the unknown and dramatic. The valley is dramatic, with its huge sharp cliffs and expansive river. Now that leaves and blossoms are starting to emerge, the valley is more comforting, as it is alive. I wonder how I'll feel when I'm surrounded by nothing but what appears to be the inorganic in the West.

The marshes by Iona Island

I rode 100 miles yesterday! I think that is the first time I've ever ridden more than about 80 miles. I know that my dad and I would some long rides when I was a kid, but never 100 miles. This is a pretty exciting accomplishment for me. The ride was okay until the last 20 miles. I hadn't eaten enough while riding, so I was starting to feel kind of faint as I made my way down familiar stretches of highway 9 in New Jersey. Now I know that a couple of Cliff bars and a puff pastry is not enough to sustain me for such a long ride. Ultimately, I made it back fine. After a ton of food and 10 hours of sleep, I'm feeling great, albeit a little sore. Oh, and my ass. It's feeling a little tender, to put it lightly. 

I get a kick out of riding unpaved trails (hence my bike), and I think that must have ridden about a third of my ride on unpaved trails. While not technically difficult, one of my favorites was the path in Nyack Beach State Park. Instead of going up and over Hook Mountain (which 9w kind of does) you skirt right along the beach. The path is finely crushed rock. My 40c tires make short work of this terrain, so I was just tearing it up. After a section that goes right along the beach, the trail goes up a steep little grade and then rolls and turns along the cliff before ending in Haverstraw. This section was lots of fun, as I was going fast enough to lose a little traction on the turns. This meant that I ended up sliding through the turns. North of Haverstraw there is another trail that goes almost all the way to Bear Mountain State Park. This trail doesn't appear to be as well maintained, so it was a little more technically difficult. I took a little air out of the tires and mooshed through all that gravel. This week I hope to make it to Hook Mountain State Park in order to ride some more cool trails. 

Nyack Beach State Park bike trail

Panorama from Nyack Beach State Park

Another shot of the trail in Nyack Beach