An interesting article by some researchers from the University College in London describes the equation they constructed and tested that predicts happiness.
A key part of the equation is that it relates happiness to the difference between people’s expectations of rewards and the actual rewards.
… we show that emotional reactivity in the form of momentary happiness in response to outcomes of a probabilistic reward task is explained not by current task earnings, but by the combined influence of recent reward expectations and prediction errors arising from those expectations.
Mark French has an excellent YouTube channel on Mechanical Engineering, including the above video on Math and Music. The video describes the mathematical relationships between musical notes.
Given the sequence of notes: C, C#, D, D#, E, F, F#, G, G#, A, A#, B, C.
Let the frequency of the C note be f0, the frequency of C# be f1 etc.
The ratio of any two successive frequencies is constant (r). For example:
so:
We can find the ratio of the first and third notes by combining the first two ratios. First solve for f1 in the first equation:
solving for f1,
now take the second ratio:
and substitute for f1,
which gives:
We can now generalize to get the formula:
or
where,
n – is the number of the note
From this we can see that comparing the ratio of the first and last notes (f12/f0) is:
Now, as we’ve seen before, when we talked about octaves, the frequency of the same note in two different octaves is a factor of two times the lower octave note.
So, the frequency ratio between the first C (f0) and the second C (f12) is 2:
therefore:
so we can now find r:
Finally, we can now find the frequency of all the notes if we know that the international standard for the note A4 is 440 Hz.
The post below was contributed by Michael Schmidt, our math teacher.
Parabolas can be a daunting new subject for some students. Often students are not aware of why a parabola may be useful. Luckily, nature always has an answer. Most children realize that a ball thrown through the air will fallow a particular arch but few have made the connected this arch to a parabola. Wonderfully, with a little technology this connection can be made.
With Ms. Hahn’s Canon SLR, I had some of my students throw a ball around outside and took a series of quick pictures of the ball in flight. Since my hand is not very steady, I took the pictures and used the Hugin’s image_stack_align program to align each photo so I could stack them in GIMP.
Within GIMP, I layered the photos on top of each other and cut out the ball from each layer then composed those onto one image. Careful not to move the ball since our later analysis will be less accurate. The result will look something like the following:
Now that there is an image for student to see, we can determine the ball’s height at each point using their own height as a reference. We can then use this information to model a parabola to the data with a site like: http://www.arachnoid.com/polysolve/ .
For the more advanced student an investigation of the least-squares algorithm used by the site may be done.
Now, once we have an expression for the parabola, students can compare how fast they sent the ball into the air.
If you throw a soccer ball up into the air and take a quick series of photographs you can capture the motion of the ball over time. The height of the ball can be measured off the photographs, which can then be used for some interesting physics and mathematics analysis. This assignment focuses on the analysis. It starts with the height of the ball and the time between each photograph already measured (Figure 1 and Table 1).
Table 1: Height of a thrown soccer ball over a period of approximately 2.5 seconds. This data were taken from a previous experiment on projectile motion.
Photo
Time (s)
Measured Height (m)
P0
0
1.25
P1
0.436396062
6.526305882
P2
0.849230104
9.825317647
P3
1.262064145
11.40310588
P4
1.674898187
11.30748235
P5
2.087732229
9.657976471
P6
2.50056627
6.191623529
Assignment
Pre-Algebra: Draw a graph showing the height of the ball (y-axis) versus time (x-axis).
Algebra/Pre-calculus: Determine the equation that describes the height of the ball over time: h(t). Plot it on a graph.
Calculus: Determine the equation that shows how the velocity of the ball changes over time: v(t).
Calculus: Determine the equation that shows how the acceleration of the ball changes with time: a(t)
One of my pre-Calculus students convinced me that the best way for him to learn how to work with matrices was for him to program a matrix solver. I helped him create a Gaussian Elimination solver in Python (which we’ve been using since last year).
Gaussian Elimination Matrix Solver by Alex Shine (comments by me).
from visual import *
'''The coefficient matrix (m) can be any sized square matrix
with an additional column for the solution'''
m = [ [1,-2,1,-4],[0,1,2,4],[2,3,-2,2]]
'''Convert the input matrix, m (which is a list) into an array'''
a = array(m,float)
print "Input matrix:"
print a
print
'''Get the shape of the matrix (number of rows and columns)'''
(r,c) = a.shape
rs = (1-r)
'''Solve'''
for j in range(r):
print "Column #:", j
for i in range(r):
if a[i,j] <> 0:
a[i,:] = a[i,:] / a[i,j]
print a
print
for i in range(rs+j,j):
if a[i,j] <> 0:
a[i,:] = a[j,:] - a[i,:]
print a
print
print "Solution"
for i in range (r):
a[i,:] = a[i,:] / a[i,i]
print "Variable", i, "=", a[i,-1]
print
print "Solution Matrix:"
print a
The code above solves the following system of equations:
x - 2y + z = -4
y + 2z = 4
2x + 3y - 2z = 2
Which can be written in matrix form as such:
You use the solver by taking the square matrix on the left hand side of the equation and combining it with the column on the hand side as an additional column:
This is entered into the program as the line:
m = [ [1,-2,1,-4],[0,1,2,4],[2,3,-2,2]]
When you run the above program you should get the results:
The matrix you put in can not have any zeros on its diagonal, so some manipulation is often necessary before you can use the code.
Other notes:
The negative zeros (-0) that show up especially in the solution matrix may not look pretty but do not affect the solution.
The code imports the vpython module in the first line but what it really needs is the numpy module, which vpython imports, for the arrays.
The next step is to turn this into a function or a class that can be used in other codes, but it’s already proved useful. My calculus students compared their solutions for the coefficients of a quadratic equation that they had to solve for their carpet friction experiment, which was great because their first answers were wrong.
Yesterday we used calculus to find the equation for the height of water in a large plastic water bottle as the water drained out of a small hole in the bottom.
Perhaps the most crucial point in the procedure was fitting a curve to the measured reduction of the water’s outflow rate over time. Yesterday, in our initial attempt, we used a straight line for the curve, which produced a very good fit.
The R2 value is a measure of how good a fit the data is to the trendline. The straight line gives an R2 value of 0.9854, which is very close to a perfect fit of 1.0 (the lowest R2 can go is 0.0).
The resulting equation, written in terms of the outflow rate (dV/dt) and time (t), was:
However, if you look carefully at the graph in Figure 1, the last few data points suggest that the outflow does not just linearly decrease to zero, but approaches zero asymptotically. As a result, a different type of curve might be a better trendline.
Types of Equations
So my calculus students and I, with a little help from the pre-Calculus class, tried to figure out what types of curves might work. There are quite a few, but we settled for looking at three: a logarithmic function, a reciprocal function, and a square root function. These are shown in Figure 2.
I steered them toward the square root function because then we’d end up with something akin to Torricelli’s Law (which can be derived from the physics). A basic square root function for outflow would look something like this:
the a coefficient stretches the equation out, while the b coefficient moves the curve up and down.
Fitting the Curve
Having decided on a square-root type function, the next problem was trying to find the actual equation. Previously, we used Excel to find the best fit straight line. However, while Excel can fit log, exponential and power curves, there’s no option for fitting a square-root function to a graph.
To get around this we linearized the square-root function. The equation, after all, looks a lot like the equation of a straight line already, the only difference is the square root of t, so let’s substitute in:
to get:
Now we can get Excel to fit a straight line to our data, but we have to plot the square-root of time versus temperature instead of the just time versus temperature. So we take the square root of all of our time measurements:
Time
Square root of time
Outflow rate
t (s)
t1/2 = x (s1/2)
dV/dt (ml/s)
0.0
0
3.91
45.5
6.75
3.52
97.8
9.89
2.94
140.9
11.87
3.52
197
14.04
3.21
257
16.05
3.01
315.1
17.75
2.81
380.1
19.50
2.53
452.9
21.28
2.23
529.6
23.01
1.92
620.7
24.91
1.69
742.7
27.25
1.45
We can now plot the outflow rate versus the square root of time (Figure 3).
The equation Excel gives (Figure 3), is:
and we can substitute back in for x=t1/2 to get:
Getting back to the Equation for Height
Now we can do the same procedure we did before to find the equation for height.
First we substitute in V=πr2h:
Factor out the πr2 and move it to the other side of the equation to solve for the rate of change of height:
Then integrate to find h(t) (remember) :
gives:
which might look a bit ugly, but that’s only because I haven’t simplified the fractions. Since the radius (r) is 7.5 cm:
Finally we substitute in the initial value (t=0, h=11) to solve for the coefficient:
giving the equation:
Plotting the equations shows that it matches the measured data fairly well, although not quite as well as when we used the previous linear function for outflow.
Discussion
I’m not sure why the square root function for outflow does not give as good a match of the measurements of height as does the linear function, especially since the former better matches the data (it has a better R2 value).
It could be because of the error in the measurements; the gradations on the water bottle were drawn by hand with a sharpie so the error in the height measurements there alone was probably on the order of 2-3 mm. The measurement of the outflow volume in the beaker was also probably off by about 5%.
I suspect, however, that the relatively short time for the experiment (about 15 minutes) may have a large role in determining which model fit better. If we’d run the experiment for longer, so students could measure the long tail as the water height in the bottle got close to the outlet level and the outflow rate really slowed down, then we’d have found a much better match using the square-root function. The linear match of the outflow data produces a quadratic equation when you integrate it. Quadratic equations will drop to a minimum and then rise again, unlike the square-root function which will just continue to sink.
Conclusions
The linearization of the square-root function worked very nicely. It was a great mathematical example even if it did not produce the better result, it was still close enough to be worth it.
Jupiter and Venus have been sitting near the western horizon, shining so brightly that even I have noticed them. Phil Plait explains with some back-of-the-envelope math, why Venus is brighter even though it’s smaller than Jupiter. It’s a nice example of how a little math can do a great job explaining how the world (and others) works.
Calculating the forces between two charged particles (electric force), two magnets (the magnetic force), and two masses (the gravitational force) require remarkably similar equations. But, while electricity and magnetism are directly related (that’s why it’s called electromagnetism), gravity is its own fundamental force. Yet they all depend (inversely) on the square of the distance between the two objects creating the force, so they’re all said to obey some form of the inverse square law.
Gravitational Force (Fg)
The force exerted by two masses on one another is:
where:
G is the gravitational constant (6.67300 × 10-11 m3 kg-1 s-2
m1 and m2 are the masses of the two objects attracting one another.
d is the distance between the two objects.
Electrical Force (Fe)
The force exerted by two electrically charged objects on one another (like a proton and an electron), is:
where:
K is the electrical constant, sometimes called Coulumn’s constant (8.9876 × 109 N m2 C-2
q1 and q2 are the sizes of the charges (in Coulumbs) of the two objects attracting one another.
d is the distance between the two objects.
Magnetic Force (Fm)
The force exerted by two magnets on one another, is: