maths

I am a senior in Mathematics at Portland State University, studying topology and abstract algebra.
Syndicate content

Intro to Sage

Sage is…

  • A general purpose symbolic computer algebra system (CAS) like Mathematica, Maple, Magma, etc.
  • Designed to be accessible and useful right away for people with some math background.
  • Accessed through your browser.
  • Powerful, as we shall see…

Why Sage? We have Mathematica…

  • Cost.

Getting my hands dirty with MTH 421 ODEs

The author of my ODE text V.I. Arnold giving the modern (last 50 years) abstract mathematics curriculum a sound flogging. Quite entertaining IMO.


Perfect number finder in python

In the interest of greater openness (sharing my inner life with the world and such), here is a bit of python I just wrote to find perfect numbers. After a few minutes of optimization, it is now quite fast and no longer brings OSX to its knees with memory-hungryness:

from math import *
def is_perfect(a):
	sum = 1 
	for i in xrange(2, floor(sqrt(a))):
		if a%i == 0:
			sum = sum + i + a/i
	if sqrt(a)%1 == 0: sum += sqrt(a)
	return sum == a

def find_perfect(limit):
	results = []
	for i in xrange(1, limit):
		j=2**i*(2**(i+1)-1)
		if is_perfect(j):
			results.append(j)

HW #5: Spherical Coordinates, Duex

This work is borrowed gratefully from Flanders 4.1.

Position in $ \Re^3 $ is given in terms of spherical parameters as:

\[ \vec{r} = &(r\sin{\phi}\cos{\theta}, r\sin{\phi}\sin{\theta}, r\cos{\phi}) \]

with basis $ \{\hat{i}, \hat{j}, \hat{k}\} $. Applying the exterior derivative operator gives:

\begin{align*} d\vec{r} = &(\sin{\phi}\cos{\theta}, \sin{\phi}\sin{\theta}, \cos{\phi})dr \\<br />
&+ (r\cos{\phi}\cos{\theta}, r\cos{\phi}\sin{\theta}, -r\sin{\phi})d\phi \\<br />
&+ (-r\sin{\phi}\sin{\theta}, r\sin{\phi}\cos{\theta}, 0)d\theta \\<br />
= &dr\hat{r} + rd\phi\hat{\phi} + rd\theta\hat{\theta} \\<br />
 \end{align*}

with

\begin{align*} \hat{r} &= (\sin{\phi}\cos{\theta}, \sin{\phi}\sin{\theta}, \cos{\phi}) \\<br />
\hat{\phi} &= (\cos{\phi}\cos{\theta}, \cos{\phi}\sin{\theta}, -\sin{\phi}) \\<br />
\hat{\theta} &= (-\sin{\phi}\sin{\theta}, \sin{\phi}\cos{\theta}, 0) \\<br />
 \end{align*}

Therefore, (answer part (a))

\begin{align*} d\hat{r} = &(0,0,0)dr \\<br />
&+ (\cos{\phi}\cos{\theta}, \cos{\phi}\sin{\theta}, -\sin{\phi})d\phi \\<br />
&+ (-\sin{\phi}\sin{\theta}, \sin{\phi}\cos{\theta}, 0)d\theta \\<br />
= &\hat{\phi}d\phi + \hat{\theta}d\theta \\<br />
d\hat{\phi} = &(0,0,0)dr \\<br />
&+ (-\sin{\phi}\cos{\theta}, -\sin{\phi}\sin{\theta}, -\cos{\phi})d\phi \\<br />
&+ (-\cos{\phi}\sin{\theta}, \cos{\phi}\cos{\theta}, 0)d\theta \\<br />
d\hat{\theta} = &(0,0,0)dr \\<br />
&+ (-\cos{\phi}\sin{\theta}, \cos{\phi}\cos{\theta}, 0)d\phi \\<br />
&+ (-\sin{\phi}\cos{\theta}, -\sin{\phi}\sin{\theta}, 0)d\theta \\<br />
 \end{align*}

HW #3

  1. Hodge Dual in Minkowski Space

    Minkowski 4-space has orthonormal, oriented basis $ \{dx,dy,dz,dt\} $ with volume element (choice of orientation) $ \omega=dx\wedge dy \wedge dz \wedge dt $ and inner product $ g(,) $ defined by

    \begin{align*}<br />
g(dx,dx)&=1 \\<br />
g(dy,dy)&=1 \\<br />
g(dz,dz)&=1 \\<br />
g(dt,dt)&=-1 \\<br />
g(d\alpha_i,d\alpha_{j\ne i})&=0 \\<br />
 \end{align*}

    1. Determine the Hodge dual operator * on all forms by computing its action on basis forms at each rank.
      In general, the dual can be computed as (Equation 20, http://oregonstate.edu/~drayt/Courses/MTH434/2007/dual.pdf):

      \[ \ast(\sigma^1\ldots\sigma^p)=g(\sigma^1,\sigma^1)\ldots g(\sigma^p,\sigma^p)\sigma^{p+1}\wedge\ldots\wedge\sigma^n \]

      where $ \sigma^1\ldots\sigma^n=\omega $ is the volume element.
      In particular:

      \begin{align*}<br />
\ast 1=\omega<br />
 \end{align*}
      \begin{align*}<br />
\ast dx &=dy \wedge dz \wedge dt \\<br />
\ast dy &=(-dx \wedge dz \wedge dt) \\<br />
\ast dz &=dx \wedge dy \wedge dt \\<br />
\ast dt &=(-1)(-dx \wedge dy \wedge dz) \\<br />
 \end{align*}
      \begin{align*}<br />
\ast dx\wedge dy &=dz \wedge dt) \\<br />
\ast dx\wedge dz &=(-dy \wedge dt) \\<br />
\ast dx\wedge dt &=(-1)(-dy \wedge dz) \\<br />
\ast dy\wedge dz &=dx \wedge dt) \\<br />
\ast dy\wedge dt &=(-1)(-dx \wedge dz) \\<br />
\ast dz\wedge dt &=(-1)(dx \wedge dy) \\<br />
 \end{align*}
      \begin{align*}<br />
\ast dx \wedge dy \wedge dz &=dt \\<br />
\ast dx \wedge dy \wedge dt &=(-1)(-dt) \\<br />
\ast dx \wedge dz \wedge dt &=(-1)dt \\<br />
\ast dy \wedge dz \wedge dt &=(-1)(-dt) \\<br />
 \end{align*}
      \begin{align*}<br />
\ast \omega = -1<br />
 \end{align*}
    2. How does your answer change if the opposite orientation is chosen, namely $ \omega = dt\wedge dx \wedge dy \wedge dz $?
      The sign of each dual would change, due to the additional odd number (3) of transpositions to the volume element. The sign of the number of transpositions required to transform one volume element into another is an invariant (independent of a particular permutation).
  2. Spherical Coordinates

    Spherical coords in $ E^3 $ with $ \omega = r^2\sin{<br />
\theta}dr\wedge d\theta \wedge d\phi $

    1. Calculate the action of * on the basis elements of each rank.
    2. Compute the dot- and cross-products of 2 arbitrary "vector fields" (1-forms) using the expressions:
      \begin{align*}<br />
\alpha\cdot\beta&=\ast(\alpha\wedge\ast\beta) \\<br />
\alpha\times\beta&=\ast(\alpha\wedge\beta) \\<br />
 \end{align*}

HW #4: Orthogonal Coordinates

Paraboloidal coordinates given as:

\begin{align*}<br />
x &= uv\sin{\phi} \\<br />
y &= uv\cos{\phi} \\<br />
z &= \frac{1}{2}(u^2-v^2) \\<br />
 \end{align*}

We express the Euclidean differential line element in terms of the derivatives (?) of our new coordinate basis:

\begin{align*}<br />
dx &= v\sin{\phi}du + u\sin{\phi}dv + uv\cos{\phi}d\phi \\<br />
dy &= v\cos{\phi}du + u\cos{\phi}dv - uv\sin{\phi}d\phi \\<br />
dz &= u du -v dv \\<br />
ds^2 &= dx^2+dy^2+dz^2 \\<br />
        &= (u^2+v^2)du^2 + (u^2+v^2)dv^2 + u^2v^2d\phi^2\\<br />
        &= (\sqrt{u^2+v^2}du)^2 + (\sqrt{u^2+v^2}dv)^2 + (uvd\phi)^2\\<br />
 \end{align*}

$ \{\sqrt{u^2+v^2}du, \sqrt{u^2+v^2}dv, uvd\phi\} $ is an orthonormal basis for $ \bigwedge^1\Re $ (the square of the line element is the product of the squares of the basis elements). The change-of-basis matrix from $ \{dx,dy,dz\} $ to our new basis thus has determinate one. To save typing we will make the substitution $ \sqrt{u^2+v^2}=\eta $. We choose the oriented volume element:

\[ \omega=\eta du\wedge\eta dv\wedge uvd\phi. \]
  1. Compute the gradient of an arbitrary function $ f $by the expression

    \begin{align*} \nabla f  &=df \\<br />
df &= f_udu+f_vdv+f_\phi d\phi \end{align*}
  2. Compute the Laplacian of $ f $ by the expression
    \begin{align*}<br />
\Delta f  &= \nabla\cdot\nabla f = \ast d\ast df \\<br />
&=\ast d(\frac{f_u}{\eta}\ast(\eta du) + \frac{f_v}{\eta}\ast(\eta dv) + \frac{f_\phi}{uv}\ast{uv d\phi}) \\<br />
&=\ast d(f_u uvdv\wedge d\phi + f_v uvdu\wedge d\phi + \frac{f_\phi}{uv}\eta^2 dudv) \\<br />
&=(vf_u+uvf_{uu}- uf_v-uvf_{uu}+\frac{f_{\phi\phi}}{uv}\eta^2)\ast(dudvd\phi) \\<br />
&=(vf_u+uvf_{uu}- uf_v-uvf_{uu}+\frac{f_{\phi\phi}}{uv}\eta^2) \\<br />
 \end{align*}

Homework #1: Decomposable Forms

  1. Let $ \vec{u}  $ be an ordinary vector in $ \Re^3  $, so that
    \[ \vec{u} =  A\hat{i} + B\hat{j} + C\hat{k} \]

    Find $ \vec{v} $ and $ \vec{w} $ such that

    \[ \vec{u} = \vec{v} \times \vec{w} \]

    We observe that the cross product is an alternating linear function, uniquely determined by its action on the basis,

    \begin{align*}<br />
\hat{j} \times \hat{k} &= \hat{i} \\<br />
\hat{k} \times \hat{i} &= \hat{j} \\<br />
\hat{i} \times \hat{j} &= \hat{k}<br />
 \end{align*}

    and also that $ \times $ is antisymmetric and distributive. Bring this all together, we can express $ \vec{u} $ as a product of two vectors:

    \begin{align*}<br />
\vec{u} &= A\hat{j} \times \hat{k} + B\hat{k} \times \hat{i} + C\hat{i} \times \hat{j} \\<br />
&= A\hat{j} \times \hat{k} + (B\hat{k} - C\hat{j})\times \hat{i} \\<br />
&= (A + B) \hat{j} \times \hat{k} + B \hat{k} \times \hat{j} + (B\hat{k} - C\hat{j})\times \hat{i} \\<br />
&= -C \frac{(A + B)}{-C} \hat{j} \times \hat{k} + B \hat{k} \times \hat{j} + (B\hat{k} - C\hat{j})\times \hat{i} \\<br />
&= (B\hat{k} - C\hat{j})\times (\hat{i} + \hat{j} - \frac{(A + B)}{C}\hat{k})  \end{align*}

    Notice that if $ C=0 $, the answer is undefined. One, of A,B,C must be nonzero, however, in which case a symmetric argument will suffice. $ \square $


Oregon State

Hey, long-time no blog. Well, I’ve moved to Corvallis (Heather too) and Monday was my first day of classes at OSU. Pretty smooth transfer from Portland State, the only sting being another $300 matriculation fee. Oh well. I've got my schedule worked out now, I think. I'm taking:


Math Forum

I've been operating a forum site for my topology class. I'm planning to commercialize it. I just need a domain and a few additional features. I'm planning to update and improve the latexrender module to work properly with 4.7. It provides a filter to convert inline latex math text into images. This will of course be extremely useful for a math forum.

Update!

Daniel Gutekunst has picked up a google summer of code project to develop thorough LaTeX integration for Drupal. He calls his module Drutex. Cute :)


Rubiks Cube

My Rubik's CubeThis is an interactive rubiks cube puzzle which I wrote while studying its symmetry groups for an independent study at PSU. Attached below is the package, which depends on

These packages are available on Linux, Mac, Windows, etc.

Planned features:

  • an automatic solver