Finally, relatively easy interactive 3d on the web. You can rotate and zoom into the scene. (Although it may not yet be compatible with all browsers it does work with Firefox at least).
Your browser does not support iframes.
This method uses the three.js Javascript library. Here I use it to show the volume of a rotated surface using the disk method. It’s almost identical to my calculus student’s project, except here I’m finding the volume between x=1 and x=3, using disks that are 0.5 units in height (Δx).
Since the volume of cylinder is:
where r is the radius of the cylinder.
We’re finding the volume created by a function that’s rotated around the x-axis. Using the function:
The radius of each cylinder is the value of the function for that x value, so you could write the radius as:
Therefore the volume of each disk is:
There are four disks and we use the function value at the far end of the disk to draw the disk so the total volume is:
Factoring out the π and the Δx gives:
Since Δx = 0.5, a = 1.0, and b = 3.0, we can define the number of disks as n = 4 then we can rewrite using summation formula:
reverting back to a and b gives the general equation:
Numerical integration is usually used for functions that can’t be integrated (or not easily integrated) but for this example we’ll use a simple parabolic function so we can compare the numerical results to the analytical solution (as seen here).
With the equation:
To find the area under the curve between x = 1 and x = 5 we’d find the definite integral:
For numerical integration, we break the area of concern into a number of trapezoids, find the areas of all the trapezoids and add them up.
We’ll define the left and right boundaries of the area as a and b, and we can write the integral as:
We also have to choose a number of trapezoids (n) or the width of each trapezoid (dx). Here we choose four trapezoids (n = 4), which gives a trapezoid width of one (dx = 1).
So if we define the x values of the left and right sides of the first trapezoids as x0 and x1, the area of the first trapezoid is:
For this program, we’ll set the trapezoid width (dx) and then calculate the number of trapezoids (n) based on the width and the locations of the end boundaries a and b. So:
and the sum of all the areas will be:
We can also figure out that since the x values change by the same value (dx) for every trapezoid, it’s an arithmetic progression, so:
and,
so our summation becomes:
Which we can program with:
numerical_integration.py
# the function to be integrated
def func(x):
return -0.25*x**2 + x + 4
# define variables
a = 1. # left boundary of area
b = 5. # right boundary of area
dx = 1 # width of the trapezoids
# calculate the number of trapezoids
n = int((b - a) / dx)
# define the variable for area
Area = 0
# loop to calculate the area of each trapezoid and sum.
for i in range(1, n+1):
#the x locations of the left and right side of each trapezpoid
x0 = a+(i-1)*dx
x1 = a+i*dx
#the area of each trapezoid
Ai = dx * (func(x0) + func(x1))/ 2.
# cumulatively sum the areas
Area = Area + Ai
#print out the result.
print "Area = ", Area
And the output looks like
>>>
Area = 17.5
>>>
While the programming is pretty straightforward, it was a bit of a pain getting Python to work for one of my students who is running Windows 8. I still have not figured out a way to get it to work properly, so I’m considering trying to do it using Javascript.
Update
The javascript functions for numerical integration:
function numerically_integrate(a, b, dx, f) {
// calculate the number of trapezoids
n = (b - a) / dx;
// define the variable for area
Area = 0;
//loop to calculate the area of each trapezoid and sum.
for (i = 1; i <= n; i++) {
//the x locations of the left and right side of each trapezpoid
x0 = a + (i-1)*dx;
x1 = a + i*dx;
// the area of each trapezoid
Ai = dx * (f(x0) + f(x1))/ 2.;
// cumulatively sum the areas
Area = Area + Ai
}
return Area;
}
//define function to be integrated
function f(x){
return -0.25*Math.pow(x,2) + x + 4;
}
// define variables
a = 1; // left boundary of area
b = 5; // right boundary of area
dx = 1; // width of the trapezoids
// print out output
alert("Area = "+ numerically_integrate(a, b, dx, f));
I’ve added the above javascript code to the embeddable graphs to allow it to calculate and display numerical integrals: you can change the values in the interactive graph below.
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)
Fully loaded, the first stage of the Saturn V rockets that launched the Apollo missions would burn through a liter of fuel for every four centimeters it moved. That’s 5 inches/gallon, which, for comparison, is a lot less than your modern automobile that typically gets over 20 miles/gallon.
We took a school trip to the ski slopes in Hidden Valley. It was the interim, and it was a day dedicated to taking a break. However, it would have been a great place to talk about gradients, changes in slopes, and first and second differentials. The physics of mass, acceleration, and friction would have been interesting topics as well.
This year has been cooler than last year, but they’ve still struggled a bit to keep snow on the slopes. They make the snow on colder nights, and hope it lasts during the warmer spells. The thermodynamics of ice formation would fit in nicely into physics and discussion of weather, while the impact of a warming climate on the economy is a topic we’ve broached in environmental science already.
The website Influence Explorer has a lot of easily accessible data about the contributions of companies and prominent people to lawmakers. As a resource for civics research it’s really nice, but the time series data also makes it a useful resource for math; algebra and pre-calculus, in particular.
To figure out if the climate is actually warming we need to extract from the global temperature curve all the wiggles caused by other things, like volcanic eruptions and El Nino/La Nina events. The resulting trend is quite striking.
I’m teaching pre-Calculus using a graphical approach, and my students’ latest project is to model the trends in the rising carbon dioxide record in a similar way. They’re matching curves (exponential, parabolic, sinusoidal) to the data and subtracting them till they get down to the background noise.