Uncategorized

Replacing some wall sconces. Electrical surprise!

October 3, 2020 Uncategorized No comments , , ,

We had some wall sconces in the second floor hallway.  One of them sputtered and we didn’t trust it.  Sofia found some nice replacements a few weeks ago, and today was installation day.

I was rather surprised when I took off the old light and found a wiring hairball.  Here’s a picture after taking off (all but one of) the merretts:

I’d never seen anything like this, not even at my last house, where the previous owner (Mr. C) never found a ground wire that he didn’t like hanging loose.  You can’t really see into the back of the box in that picture, but all the wires are loose (no wiring clips securing the wires to the back of the box). none of the sheathing has been removed, and all the connections were jammed into a single tight cubic inch in an impossibly tangled mess.  The grounds were all tied, but Mr C would have been proud, as none of them were connected to the ground screws at the back of the box.  You can see things a bit better after a bit of unraveling:

Of these wires, I hadn’t yet identified which was switch, which went to the second sconce, and which was the supply.  I’m not sure about other locales, but the Ontario electrical handbook specifies that white is hot at the switch, so looking at this, I think the guess should be that the switch wire is the top left (i.e. when the switch is on, we have supply through the white, to and through the switch, and back through the black where it will power the load.)  That didn’t make sense since the switch is on the right down about a foot.  The only logical wire for the switch would be that bottom one.  I decoupled everything so that I could test the lines (carefully) with the power back on, warning everybody in the house to keep clear:

My tester showed that the top left was the supply, leaving the top right and the left as candidates for the switch and the other sconce.  A couple more trips to the breaker box, and some temporary connections verified what was what, and I was ready to start reconnecting things.  First step was stripping the sheathing off the wires.   I couldn’t use a standard stripping tool, since everything was already in the box, but had to carefully do that with a knife:

I’d never seen anybody not take the sheathing off, which was the major source of the hairball wiring.  This wire was either 12 gauge or just really old, but it was very stiff and hard to handle.  With all the sheathing still on, whoever wired this up originally must have had a hell of a job.  I got the switch’s white connected up to the supply black, and put in some clamps at the back of the box and secured the grounds all physically to the box.

I left one ground long to potentially connect to the new light, but it turned out that the ground wire on the new light was super long, so I ended up trimming that one back and direct connecting it to the back off the box with all the rest, instead of using a merrett for the ground.

Special bonus.

It seemed prudent to open up the switch too, and found that the ghost of Mr C was haunting that too.  Check out the nice floating ground lurking in the switch:

This single pole switch doesn’t have a ground screw, but it just seems really sloppy not to connect that ground to the back of the box.  This wire was also not clamped, so I did that too, and put in a brand new switch while I was at it.

 

EDIT: Before:

After:

Small update to “Basic Statistical Mechanics” is now live.

August 8, 2020 Uncategorized No comments

A new version of these notes is now posted, available on amazon, leanpub, and as a free pdf:

phy452.V0.1.12.pdf, Wed Aug 5, 2020 (commit 7bbcdf66b26e950fa01ae6cbae86f987bc2c8d49)

  • Fix hyphens in listing, typos in bio.
  • Remove appendix part so that the index and bib aren’t grouped with the appendix.
  • Tweak the preface and backcover
  • Group intro probability text together, and expand on probability distribution definition.
  • Remove singlton part heading so that chapters are the highest level.
  • Fix pdfbookmarks for contents and list of figures (so that they don’t show up under the preface)
  • Streamline FrontBack specialization.

These are mostly cosmetic changes, where my primary objective was to correct the bash listing that shows the reader how to make their own git clone of the book text.

 

Leanpub editions of my books.

August 5, 2020 Uncategorized No comments ,

I’d had a leanpub version of my geometric algebra book available for a while and have now added editions of all my older class notes compilations that I have on amazon.  My complete leanpub selection now looks like:

I believe that leanpub essentially provides a pdf to the purchaser (I haven’t tried buying a copy to verify), and I give the pdfs away for free, so you (and I) might ask why somebody would opt to buy such a copy?

There are a few possible reasons that I can think of:

  1. Many of the leanpub purchases have been above the minimum price, so at least some of the purchasers are compensating proportionally to their personal valuation of the material, and aren’t strictly trying to buy for the minimum price.
  2. A leanpub purchase is subscription like.  Anybody that purchases a copy will automatically receive any updates made without having to check for a new version manually.
  3. There is a per-book forum available for each of the books (if the author enables it.)  I didn’t realize that feature was available, and have now enabled the forum for my geometric algebra book.  I’ve also enabled a forum for each of the class notes compilations as I configured them.
  4. The purchaser did not know that I also offer the pdf for free, and found the title in leanpub search, not through my website where I make that obvious.

I’ve been putting all my leanpub proceeds into my kiva loan portfolio, so if somebody had the bad luck to buy a copy of my book because of (4) above, I don’t feel very guilty about it.

Shon Hopwood’s “Law Man” book.

March 22, 2020 Uncategorized No comments , , ,

I’d heard Shon Hopwood interviewed on the Rubin report quite a while ago.  Now that I’m living in Toronto, I have the Toronto Public Library at my disposal (which has a far superior selection to the Markham Public Library).  They had Hopwood’s book, which I’d been meaning to read for a while, and luckily was able to pick it up before the current coronavirus mass hysteria shut down the library and most of the world:

The story in this book is really amazing.

Part of the book describes life in prison.  What I know of prison comes from a couple sources.  The first of those sources is the most unreliable (movies), the second is an old childhood friend who I saw after he’d served some time (*), and the last is a family member who is now a guard in the US prison system.  This book added a bit more color to my understanding of that very different world.  There are probably lots of prison memoirs, but this is one that is exceptionally well written.  I really loved the way it starts by telling a story right off the bat.

The improbability of Shon’s story is truly phenomenal and inspiring.  The subset of Shon’s life that is described in this book ends with him starting as a law student, but I knew from the Rubin interview and Wikipedia others that he completed that schooling and went on to work as both a lawyer and a law professor!  In his book Shon ends up, somewhat reluctantly, attributing some of his miraculous story to a higher power.  Perhaps a higher power was at work, but so was a lot of very hard work.

I’d highly recommend this book.  It provides a glimpse of prison life, some peeks of aspects of injustice of the US justice system (which is probably mirrored by Canadian law), and shows how Shon managed to avoid the trap of perpetually cycling through iterations of prison and crime with a with a combination of hard work and luck.  Along the way, it tells a very entertaining and inspiring story.

Footnotes:

(*) I had a friend who had the misfortune to end up dating the daughter of one the Toronto Chinese mafia kingpins when we were both in high school.  Things didn’t go well for him after that dating selection, to say the least, and it’s been over 25 years since I heard from him.  He did tell me all about guards on the take, butt smuggling of drugs and cigarettes into prison, and the absurdity of airport security theater given how many airport staff were effectively paid mafia employees.  I’m sure that airport mafia payroll is still essentially the same, despite airport security theater now being far worse than it was in the 90s — criminals can still get the guns and drugs through the system easily, but we have to throw away our toothpaste and finger nail clippers, and dangerous too-big water bottles.

Kitchen reno progress: Cabinets are installed!

March 19, 2020 Uncategorized No comments , ,

Our kitchen installers, Umair and Khazir, worked really hard for four very long days, and wrapped up their work today.  Their work was superb, with lots of attention to detail, and I’m really happy with the result.

Our cabinets (and appliances) were purchased from IKEA.  Think of this as the IKEA assembly from hell, producing enough waste cardboard to completely fill our RAV to the ceiling twice.  Here is the end result:

Here’s a little video, panning the kitchen:

IMG_1150

What’s still TODO:

  • Electrical box and outlet in the cupboard above the microwave+range hood.
  • Countertop selection and installation.
  • Plumbing (sink and dishwasher connections.)
  • Electrical connection for the dishwasher.
  • Take the wrapping off the appliances, plug in and test.
  • Clean the (drywall) dust off the fridge and stove.
  • Backsplash.
  • New casing for the window.

For the countertop selection, take a look at this view of the floor tile:

and compare that to the following possible stone:

That stone is pricey, and we have about 34 square feet of counter to put in, so the cost will add up if that’s what we choose, but it would look really classy.

Of all the stones I saw today in my quick trip to the decimated Markham Home Depot, it was obviously and immediately clear that the one above was the best match.  It happens to also be the stone that we used for our master bathroom counter too, so I can simply bring some left over kitchen tile up to the bathroom next time I’m at the house to see how they look together.

Lines and planes in geometric algebra.

January 30, 2020 Uncategorized No comments

[Click here for a PDF of this post with nicer formatting]

Motivation.

I have way too many Dover books on mathematics, including [1], which is a nice little book, covering all basics, plus some higher level material like gamma functions, Fourier series, and Laplace transforms. I’d borrowed this book from the Toronto Public Library in my youth. I’ve been meaning to re-read it, and bought my own copy to do so (too long ago.)

Perusing the chapter on vectors, I saw his treatment of lines, specifically the distance from a point to a line, and realized I’d left that elementary geometry topics out of my book.

Let’s tackle this and the similar distance from a plane problem here.

Distance from a line.

Given a point \( \Bx \) on a line, and a direction vector \( \Bu \) for the line, we can parameterize all points \( \By \) on the line by
\begin{equation}\label{eqn:lineAndPlane:20}
\By(t) = \Bx + a \Bu.
\end{equation}
In particular, the vector \( \Bx – \By \) is directed along the line if
\begin{equation}\label{eqn:lineAndPlane:40}
\lr{ \Bx – \By } \wedge \Bu = 0.
\end{equation}

While \ref{eqn:lineAndPlane:40} holds in \(\mathbb{R}^2\) (and in fact \(\mathbb{R}^N\)), this relationship is usually written in the \(\mathbb{R}^3\) specific dual form
\begin{equation}\label{eqn:lineAndPlane:60}
\lr{ \Bx – \By } \cross \Bu = 0.
\end{equation}
Given a vector \( \Bs \), representing a point, not necessarily on the line, we can compute the (shortest) distance from that point to the line.

Fig 1. Distance to line.

Referring to fig. 1, it’s clear that we want this distance is just the rejection of \( \Bu \) from \( \Bd = \Bx – \Bs \). We can decompose \( \Bd \) into components parallel and perpendicular to \( \Bu \) using the usual trick
\begin{equation}\label{eqn:lineAndPlane:260}
\begin{aligned}
\Bd
&= \Bd \Bu \inv{\Bu} \\
&=
\lr{ \Bd \cdot \Bu }
\inv{\Bu}
+
\lr{ \Bd \wedge \Bu }
\inv{\Bu},
\end{aligned}
\end{equation}
where the first component is the projection along \( \Bu \), and the last is the rejection. This means that the
directed distance to the line from the point \( \Bs \) is
\begin{equation}\label{eqn:lineAndPlane:80}
\BD = \lr{\lr{\Bx – \Bs} \wedge \Bu } \inv{\Bu}.
\end{equation}
Should we want the conventional cross product formulation of this vector, this product may be expanded within a no-op grade-1 selection, applying the duality relation (\(\Bx \wedge \By = I \lr{ \Bx \cross \By }\)) twice
\begin{equation}\label{eqn:lineAndPlane:100}
\begin{aligned}
\Bd \wedge \Bu \inv{\Bu}
&=
\gpgradeone{
\Bd \wedge \Bu \frac{\Bu}{\Bu^2}
} \\
&=
\inv{\Bu^2}
\gpgradeone{
I (\Bd \cross \Bu) \Bu
} \\
&=
\inv{\Bu^2}
\gpgradeone{
I (\Bd \cross \Bu) \cdot \Bu
+
I (\Bd \cross \Bu) \wedge \Bu
} \\
&=
\inv{\Bu^2}
\gpgradeone{
I^2 (\Bd \cross \Bu) \cross \Bu
} \\
&=
\frac{\Bu \cross (\Bd \cross \Bu)}{\Bu^2}.
\end{aligned}
\end{equation}

Distance from a plane.

Given two linearly independent vectors \( \Ba, \Bb \) that span a plane, and a point \( \Bx \) in the plane, the points in that plane are parameterized by
\begin{equation}\label{eqn:lineAndPlane:140}
\By(s,t) = \Bx + s \Ba + t \Bb.
\end{equation}
We can form a trivector equation of a plane by wedging both sides, first with \( \Ba \) and then with \( \Bb \), yielding
\begin{equation}\label{eqn:lineAndPlane:160}
\lr{ \Bx – \By } \wedge \Ba \wedge \Bb = 0.
\end{equation}
This equation is satisfied by all points \( \Bx, \By \) that lie in the plane

We are used to seeing the equation of a plane in dot product form, utilizing a normal. That \(\mathbb{R}^3\) representation can be recovered utilizing a dual transformation. We introduce a bivector (2-blade) representation of the plane itself
\begin{equation}\label{eqn:lineAndPlane:180}
B = \Ba \wedge \Bb,
\end{equation}
and then let
\begin{equation}\label{eqn:lineAndPlane:200}
B = I \Bn.
\end{equation}
With such a substitution, \ref{eqn:lineAndPlane:160} can be transformed
\begin{equation}\label{eqn:lineAndPlane:220}
\begin{aligned}
0
&= \lr{ \Bx – \By } \wedge B \\
&= \gpgradethree{
\lr{ \Bx – \By } B
} \\
&= \gpgradethree{
\lr{ \Bx – \By } I \Bn
} \\
&= \gpgradethree{
I \lr{ \Bx – \By } \cdot \Bn
+
I \lr{ \Bx – \By } \wedge \Bn
} \\
&=
I \lr{ \Bx – \By } \cdot \Bn,
\end{aligned}
\end{equation}
where the last wedge product could be discarded since it contributes only a vector grade object after multiplication with \( I \), and that is filtered out by the grade three selection. Multiplication of both sides with \( -I \) yields
\begin{equation}\label{eqn:lineAndPlane:240}
\lr{ \Bx – \By } \cdot \Bn = 0,
\end{equation}
the conventional form of the equation of an \(\mathbb{R}^3\) plane.
If we want a more general representation, then we are better off using the wedge product form of this equation
\begin{equation}\label{eqn:lineAndPlane:280}
\lr{ \Bx – \By } \wedge B = 0,
\end{equation}
where we use \ref{eqn:lineAndPlane:180} to drop the references to the original spanning vectors \( \Ba, \Bb \). As with rotations, in geometric algebra, it is more natural to encode the orientation of the plane with a bivector, than to use a spanning pair of vectors in the plane, or the normal to the plane.

For the question of shortest distance from a point to our plane, we want to compute the component of \( \Bd = \Bx – \Bs \) that lies in the plane represented by \( B \), and the component perpendicular to that plane. We do so using the same method as above for the line distance problem, writing
\begin{equation}\label{eqn:lineAndPlane:300}
\begin{aligned}
\Bd
&= \Bd B \inv{B} \\
&=
\lr{ \Bd \cdot B } \inv{B}
+
\lr{ \Bd \wedge B } \inv{B}.
\end{aligned}
\end{equation}
It turns out that these are both vector grade objects (i.e. there are no non-vector grades that cancel perfectly). The first term is the projection of \( \Bd \) onto the plane \( B \) whereas the second term is the rejection. Let’s do a few things here to get comfortable with these components. First, let’s verify that they are perpendicular by computing their dot product
\begin{equation}\label{eqn:lineAndPlane:320}
\begin{aligned}
\lr{ \lr{ \Bd \cdot B } \inv{B} }
\cdot
\lr{ \lr{ \Bd \wedge B } \inv{B} }
&=
\gpgradezero{
\lr{ \Bd \cdot B } \inv{B}
\lr{ \Bd \wedge B } \inv{B}
} \\
&=
\inv{B^4}
\gpgradezero{
\lr{ \Bd \cdot B } B
\lr{ \Bd \wedge B } B
} \\
&\propto
\gpgradezero{
\lr{ \Bd \cdot B } B^2
\lr{ \Bd \wedge B }
} \\
&\propto
\gpgradezero{
\lr{ \Bd \cdot B }
\lr{ \Bd \wedge B }
} \\
&=
0,
\end{aligned}
\end{equation}
where we first used \( B^{-1} = B/B^2 \), then \( \lr{ \Bd \wedge B } B = \pm B \lr{ \Bd \wedge B } \) (for \(\mathbb{R}^3\) \( B \) commutes with the wedge \( \Bd \wedge B \) is a pseudoscalar, but may anticommute in other dimensions). Finally, within the scalar selection operator we are left with the products of grade-1 and grade-3 objects, which can have only grade 2 or grade 4 components, so the scalar selection is zero.

To confirm the guess that \( \lr{ \Bd \cdot B } \inv{B} \) lies in the plane, we can expand this object in terms of the spanning vector pair \( \Ba, \Bb \) to find
\begin{equation}\label{eqn:lineAndPlane:340}
\begin{aligned}
\lr{ \Bd \cdot B } \inv{B}
&=
\lr{ \Bd \cdot \lr{ \Ba \wedge \Bb} } \inv{B} \\
&=
\lr{
(\Bd \cdot \Ba) \Bb

(\Bd \cdot \Bb) \Ba
} \inv{B} \\
&\propto
\lr{
u \Ba + v \Bb
}
\cdot \lr{ \Ba \wedge \Bb} \\
&\in \setlr{ \Ba, \Bb }
\end{aligned}
\end{equation}
Similarly, if \( \lr{ \Bd \cdot B } \inv{B} \) has any component in the plane, dotting with \( B \) should be non-zero, but we have
\begin{equation}\label{eqn:lineAndPlane:360}
\begin{aligned}
\lr{ \lr{ \Bd \cdot B } \inv{B} } \cdot B
&=
\gpgradeone{ \lr{ \Bd \cdot B } \inv{B} B } \\
&=
\gpgradeone{ \Bd \cdot B } \\
&= 0,
\end{aligned}
\end{equation}
which demonstrates that this is the component we are interested in. The directed (shortest) distance from the point \( \Bs \) to the plane is therefore
\begin{equation}\label{eqn:lineAndPlane:380}
\BD
=
\lr{ \lr{ \Bx – \Bs } \wedge B } \inv{B}.
\end{equation}
There should be a dual form for this relationship too, so let’s see what it looks like. First note that for vector \( \Bd \)
\begin{equation}\label{eqn:lineAndPlane:400}
\begin{aligned}
\Bd \wedge B
&=
\gpgradethree{
\Bd I \Bn
} \\
&=
I (\Bd \cdot \Bn),
\end{aligned}
\end{equation}
so
\begin{equation}\label{eqn:lineAndPlane:420}
\begin{aligned}
\BD
&=
I \lr{ \lr{ \Bx – \Bs } \cdot \Bn } \inv{I \Bn} \\
&=
\lr{ \Bx – \Bs } \cdot \Bn \inv{\Bn}.
\end{aligned}
\end{equation}
This would conventionally be written in terms of a unit vector \( \ncap \) as \( \lr{\lr{ \Bx – \Bs } \cdot \ncap} \ncap\).

Summary.

We can write the equation of a line, plane, (volume, …) in a uniform fashion as
\begin{equation}\label{eqn:lineAndPlane:440}
\lr{ \By – \Bx } \wedge V = 0,
\end{equation}
where \( V = \Bu_1, \Bu_1 \wedge \Bu_2, \Bu_1 \wedge \Bu_2 \wedge \cdots \wedge \Bu_n \) depending on the dimenion of the desired subspace, where \( \Bu_k \) are linearly independent vectors spanning that space, and \( \Bx \) is one point in that subspace.

The (directed) distance from a vector \( \Bs \) to that subspace is given by
\begin{equation}\label{eqn:lineAndPlane:460}
\BD = \lr{ \Bx – \Bs } \wedge V \inv{V}.
\end{equation}
For the \(\mathbb{R}^3\) special case of a line, where \( V = \ucap \) is a unit vector on the line, we showed that this reduces to
\begin{equation}\label{eqn:lineAndPlane:480}
\BD = \ucap \cross \lr{ \lr{ \Bx – \Bs } \cross \ucap },
\end{equation}
For the \(\mathbb{R}^3\) special case of a line, where \( V = I \ncap \) is a unit bivector representing the plane, we found that we could write \ref{eqn:lineAndPlane:460} as a projection onto the normal to the plane
\begin{equation}\label{eqn:lineAndPlane:500}
\BD = \lr{ \lr{ \Bx – \Bs } \cdot \ncap } \ncap.
\end{equation}
Again, only for \(\mathbb{R}^3\) we were also able to write the equation of the plane itself in dual form as
\begin{equation}\label{eqn:lineAndPlane:520}
\lr{ \By – \Bx } \cdot \ncap = 0.
\end{equation}
These dual forms would also be possible for other special cases (like the equation of a volume in \(\mathbb{R}^4\) and the distance from a point to that volume), but should we desire general relationships valid in all dimension (even \(\mathbb{R}^2\)), we can stick to \ref{eqn:lineAndPlane:440} and \ref{eqn:lineAndPlane:460}.

References

[1] David Vernon Widder. Advanced calculus. Courier Corporation, 1989.

Modern errata done right: a git merge request

June 7, 2019 Uncategorized No comments , ,

All the sources for my book, Geometric Algebra for Electrical Engineers, are available on github.  Theoretically, that means that instead of sending me an email when errors are found (and I’m sure there are many), you can simply fork the repo, fix the error to your satisfaction, and submit a merge request.  I didn’t expect that to actually happen, but it did:

Tim Put gets the credit for the first direct non-Peeter contribution to the GAelectrodynamics repository.

Thoughts about Ayn Rand’s Anthem

May 26, 2019 Uncategorized No comments , , ,

Many libertarian podcasts talk about Ayn Rand positively, sometimes even lovingly.  On the other hand, Rand seems to invoke the worst venom and hate from some on the left.

I found the book Anthem, by Rand, at the local recycling depot, which has a community take a book, leave a book bookshelf.  That presented an opportunity to see for my self what the Rand fuss was about.

It turned out that Anthem is a really tiny book, more of a pamphlet than a book.  The copy that I now have is a two in one, with the 2nd edition at the front half of the book, and Rand’s marked up version of her first edition at the back.

The book has a very 1984 like spirit, set in a dystopian alternate (presumed future) reality, where collectivism has been taken to the extreme.  Sexual distinctions have been eliminated, men and women aren’t allowed to be attracted to each other, outside of a proscribed annual mating ritual, kids are taken away from parents at an early age and raised by the state, and most of the knowledge of the past has been obliterated.

An amusing aspect of the book is that gender specific pronouns have been eliminated, as have all personal pronouns.  This is amusing given the current trend towards exactly that in our modern time, where there is an annoying trend to use words like “they” used instead of he/she.  I found “they” for he or she annoying because I happen to think there is value distinguishing between singular and plural.

The focus of the book is to highlight the evil of collectivism.  It’s therefore no surprise why Rand is hated so thoroughly by the left.  There wasn’t much more in this book that I’d imagine would be objectionable, other than the fact that it shows what communism might look like in the extreme.  That might make it unappealing to those that insist “communism works in theory” despite the fact that communism obliterated millions of their own people last century.

There is bit of a revolutionary bent to the story as well.  At the end, once our protagonist has discovered himself, he plans to educate a selection of potential compatriots and establish a little cell against the system.

As I read this book, I realized a little bit in that I’d read it already eons ago. I’m wondering if I read this in some sort of dystopian or sci-fi collection.  I think that I read it without any idea of who Ayn Rand was, so in retrospect, I didn’t even know that I’d read anything by her.

I enjoyed the discovery aspect of this book. There’s been many a sci-fi book that I’ve read that had a dystopian context where the characters are in the situation of having to rediscover the mysteries of the previous civilization. It’s fun to imagine oneself in such a context, knowing how much there is to learn, and the idea of being able to share everything that you discover.

Electromagnetic theory notes

February 19, 2019 Uncategorized No comments

I’ve posted a minor update (tweaking some of the figures) of my PDF notes from electromagnetic theory (ECE1228H), such as they are.  You can also find links to Mathematica notebooks, and instructions for cloning the git repositories to build the PDF.

Despite my love of the subject, this course was mediocre, and I’d rate my notes for it the same way.

 

Small update to old notes for phy450, Relativistic Electrodynamics

February 9, 2019 Uncategorized No comments

I’ve updated the pdf for my old phy450 notes (Relativistic Electrodynamics) from the current latex sources.  Also included on that page are a contents listing, and instructions for forking the git repos.  That should allow for building the pdf from the latex, so if somebody had changes they’d like to make, either for themselves or as feedback, they should be able to do so.