Home Profile Projects Articles

The Integrator!

Wednesday, 9 of January , 2008 at 10:04 am

I found the coolest webapp the other day from Mathematica which solves integrals. To be honest, I was very surprised that webapps like this exist. Mathematical computations are very cpu intensive and would put a huge load on a server. Considering the server load and the relatively small demand for online mathematical computation, I thought that mathematical software would be shackled to the desktop for awhile. Apparently I was wrong. It will be interesting to see how online mathematical software evolves.

Leave a comment

Category: Announcement, Calculus

Answer: Optimize Material Cost of an Ice Tray

Saturday, 24 of November , 2007 at 11:54 am

Answer: The simplest way to calculate the optimal dimensions of the ice tray will be to use Lagrangian Multipliers which states that the extrema of a function f(x,y,z), which is subjected to constraints g(x,y,z), will satisfy the following conditions:

\nabla f(x,y,z) = \lambda \nabla g(x,y,z)

In this example, the function f(x,y,z) will be the cost function:
f(x,y,z) = xy +3xz + 7yz

In order to construct g(x,y,z), it is a little more complicated. Since the volume of each compartment needs to be 12 cm^{3}, we can represent this constraints with the following formula: V = \frac{x}{6}\frac{y}{2}z = 12. Therefore g(x,y,z) would be:
g(x,y,z) = \frac{x}{6}\frac{y}{2}z - 12 = 0

Since the horizontal cross-section is a square, we can use the constraint \frac{x}{6} = \frac{y}{2} to simply the equations. The equations will be reduced to:
f(x,z) = \frac{x^{2}}{3} + \frac{16}{3}xz

g(x,z) = x^{2}z - 432 = 0

Now we use the relation,
\nabla f(x,z) = \lambda \nabla g(x,z)

to calculate the optimal dimensions of the ice tray.
\nabla f(x,z) = \lambda \nabla g(x,z)

\nabla (\frac{x^{2}}{3} + \frac{16}{3}xz) = \lambda \nabla (x^{2}z - 432)

\begin{pmatrix} \frac{2x}{3} + \frac{16}{3}z =  \lambda 2xz \\ \frac{16}{3}x = \lambda x^{2} \end{pmatrix}

\lambda = \begin{pmatrix} \frac{1}{3z} + \frac{8}{3x} \\ \frac{16}{3x}  \end{pmatrix}

Therefore,
\frac{1}{3z} + \frac{8}{3x} = \frac{16}{3x}

16 = \frax{x}{z} + 8

8z = x

Next, insert this relation in g(x,z).
g(x,z) = x^{2}z - 432 = 0

g(x,z) = (8z)^{2}z - 432 = 0

z = \frac{3}{2} \sqrt[3]{2}

Therefore, using the relationships we calculated above:
\begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} 12 \\ 4 \\ \frac{3}{2} \end{pmatrix}\sqrt[3]{2}

Leave a comment

Category: Answers, Calculus

Question: Optimize Material Cost of an Ice Tray

Sunday, 18 of November , 2007 at 9:10 pm

Question: The ice tray, shown below, is made from material that costs 1 cent/cm^{2}. Minimize the cost function f(x,y,z) = xy +3xz + 7yz subject to the constraints that each of the 12 compartments is to have a square horizontal cross section and that the total volume (ignoring the partitions) is to be 12 cm^{3}.

Leave a comment

Category: Calculus, Questions

Answer: Brachistochrone Problem

Saturday, 10 of November , 2007 at 5:13 pm

Question: A particle starts from rest and slides down a smooth curve under gravity. Find the shape of the curve that will minimize the time taken between two given points.

Answer: First, we need to find the distance dl of two neighboring points on the curve f(x).

dl = \sqrt{dx^{2} + dy^{2}} = \sqrt{dx^{2} (1 + \frac{dy^{2}}{dx^{2}})} = \sqrt{1 + \frac{dy^{2}}{dx^{2}}}dx

We can then use the relationship dt = \frac{dl}{v} to determine the time required to travel the distance dl. If we integrate dt over the entire path of f(x), we will obtain the function we want to minimize.

t = \oint \frac{dl}{v} = \int \frac{\sqrt{1 + \frac{dy^{2}}{dx^{2}}}dx}{v}

In order to obtain the value v, we can use the fact that energy is conserved. Therefore the following relation will hold:
\frac{1}{2}mv^{2} = mgy   \rightarrow   v = \sqrt{2gy}

We can now insert this relationship into our integral to get the following:
t = \int \frac{\sqrt{1 + \frac{dy^{2}}{dx^{2}}}dx}{\sqrt{2gy}}

In order to minimize t, we will need to minimize the following function
\Psi(x,y) = \frac{\sqrt{1 + \frac{dy^{2}}{dx^{2}}}}{\sqrt{2gy}}

This function, according to Calculus of Variations, will be an extrema when the Euler-Lagrange differential equation is satisfied.
\frac{\partial\Psi}{\partial y} -  \frac{\partial}{\partial x}\partial\frac{\Psi}{\partial \dot{y}} = 0

If we insert \Psi(x,y) into the Euler-Lagrange differential equation, we obtain the following differential equation (with a little bit of algebra).
2\ddot{y}y + \dot{y}^{2} + 1 = 0

With a little more manipulation, we can reduce this differential equation into something more manageable.
2\ddot{y}y + \dot{y}^{2} + 1 = 0

2\ddot{y}y + \dot{y}^{3} + \dot{y} = 0

\frac{\partial}{\partial x}(y\dot{y}^{2}) +  \frac{\partial y}{\partial x} = 0

\frac{\partial}{\partial x}(y\dot{y}^{2} + y) = 0

If we integrate this differential equation, we get the following:
y\dot{y}^{2} + y = C

\dot{y} = \sqrt{\frac{C - y}{y}}

This equation is solved by the parametric equations:
x = \frac{C}{2}(\theta - \sin{\theta})

y = \frac{C}{2}(1 - \cos{\theta})

which is a cycloid.

Leave a comment

Category: Answers, Calculus, Classical Mechanics

Question: Brachistochrone Problem

Sunday, 4 of November , 2007 at 10:52 pm

The brachistochrone problem was one of the earliest problems which started the development of calculus of variations. In 1696, Johann Bernoulli posed question to the readers of Acta Eruditorum. Isaac Newton was able to solve the problem the very next day.

Question: A particle starts from rest and slides down a smooth curve under gravity. Find the shape of the curve that will minimize the time taken between two given points.

Leave a comment

Category: Calculus, Classical Mechanics, Questions