Wishful Coding

Didn't you ever wish your
computer understood you?

The Church of Science

The church of science

This, ladies and gentleman, is the University of Twente. To the left you see a church of god, submerged in water, that I see as a representation of the opinion of science towards the religions of god. To the right you see a bell tower that I affectionately call the church of science, representing the beliefs of scientists.

This desire to drown a religion should sound familiar to you. It is a common trait to most religions to make a claim to the truth and declare all other religions false.

To call science a religion might raise some eyebrows, so let me explain. There are three concepts that I will talk about:

The first is god. God by itself is not true or false. It is simply the concept of an omnipotent being. This concept is internally consistent and valid as a concept.

The second is math. Like god, math is simply a concept. It is a set of rules and symbols that are internally consistent.

The final one is observations. It is not until you apply these concepts to observations that they become meaningful. It is when you say there are two birds and god created them, that you apply these concepts to observations.

All of math, god and observations are true in themselves. It is when you say that your observations are explained by your concepts that they become models that can be correct and accurate or not.

You could say that a bird is so perfect it could only have been designed by an omnipotent being. You could say that because the field of a point charge decays with one over the radius squared exactly to one part in a billion, the electric field must be explained by math.

But they are still just concepts applied to observations. Models that help us think about our universe. But the map is not the territory, which for me means that a model should not be judged by its accuracy, but by how useful it is to think about a problem.

Ancient Greek medicine, which centered about balancing the four bodily humours, often lead to treatments that would do the right thing for what we currently consider the wrong reason. It must have been a very useful model that saved countless lives up until after the middle ages despite its inaccuracy.

Maxwell’s equations might describe the whole domain of electromagnetism very accurately, but using it to design an electric circuit is impractical. The equations of Ohm and Kirchhoff will serve you better.

One day science might make a map that is the territory (they seem to be trying very hard at least), but it will not help you think about ethical and moral dilemma or the meaning of life. The stories told in your spiritual book of choice are much more practical for those kinds of problems.

Published on

Ball launcher

My friends studying Industrial Design are currently doing a “smart product” project where they have to make an active 2-player game out of LEGO using the NXT and a launcher of some sort.

If I had to make such a game, I’d probably make a Twister robot that carefully calculates impossible positions and shoots at you while you’re struggling. Sounds fun, right?

But I don’t have to make such a game, so I can just have some fun making a launcher.

https://youtu.be/H4YltWUmE2U

Published on

Power Supply Riddle

Problem

In a hall, two rows of 5 10W 12V lamps are connected in parallel over a distance of 10m, powered by two different 12V power supplies. The setup is like below.

lamps schematic

The one is a big good old transformer that outputs 12VAC at 50Hz. The other is a switching mode power supply with a switching frequency of 100KHz.

The string of lamps powered by the transformer have an equal brightness, while the string powered by the switching mode power supply diminishes, with the 5th lamp only glowing dimly.

What is going on here? Answers below, but think about it for a minute.

Investigation

The first thing I did when I saw these lamps is connect an oscilloscope to the output of the supplies.

The transformer outputs a 50HZ 12VAC sine wave as expected. The other supply appears to be a switching supply. It outputs a 100KHz square wave with some high-frequency ringing. If you zoom out, it has a 50Hz envelope.

SMPS output

Solution

Since the only difference between the two setups is the frequency, the resistance of the wires is apparently negligible and the only thing that could have influence is the inductance of the wire.

Using an online calculator, I found that the inductance of 4m (10m back and forth divided by 5) copper wire is 3μH, and the resistance of the lamps follows from their rated voltage and wattage.

\[\begin{aligned} W&=VI=\frac{V^2}{R}\\ R&=\frac{V^2}{W}=14.4\Omega \end{aligned}\]

So a more accurate representation of the situation is below.

lamps schematic

From this the AC voltage for any of the lamps can be calculated. For a single lamp at the end of a 10m wire, it would mean

\[\begin{aligned} V_{n1}(j\omega)&=\frac{V_{in}R_1}{j\omega L_5+R_1}\\ V_{n1}(j\cdot 2\pi 100000)&=\frac{12\cdot 14}{j\cdot 628318 \cdot 30\cdot 10^{-6}+14}\\ V_{n1}(j\cdot 628318)&=\frac{168}{j\cdot 18+14}\\ \left|V_{n1}(j\cdot 628318)\right|&=\frac{168}{\sqrt{18^2+14^2}}=7V\\ \end{aligned}\]

For all 5 lamps it gets a bit hairy.

\[\begin{aligned} V_{n1}(j\omega)&=V_{n2}(j\omega)\frac{R_1}{j\omega L_5+R_1}\\ V_{n2}(j\omega)&=V_{n3}(j\omega)\frac{R_2//(R_1+j\omega L_5)}{R_2//(R_1+j\omega L_5)+j\omega L_4}\\ V_{n3}(j\omega)&=V_{n4}\frac{\ldots}{\ldots+j\omega L_3}\\ V_{n4}(j\omega)&=V_{n5}\frac{\ldots}{\ldots+j\omega L_2}\\ V_{n5}(j\omega)&=12V \end{aligned}\]

But simulation gives the following result, only 4V on the lamp at the end.

lamps simulation

Published on