next up previous contents
Next: Change of Variables Up: Computational Labs in Mathematica Previous: Extrema of Functions

Polar Coordinates

Objectives

In this lab you will explore how Mathematica can be used to work with polar functions

Graphing Polar functions

To graph function given in polar form we will need to load a graphics package into Mathematica first:

       <<Graphics`Graphics`
You will need to type this in exactly as shown. (Note the use of the single left quote mark.)

Now we can use the PolarPlot command to graph polar functions. For example the function tex2html_wrap_inline356 can be graphed as follows:

      r[t_] = 2+3 Sin[t]
      p1=PolarPlot[r[t],{t,0,2 Pi}]
and tex2html_wrap_inline358 can be graphed in Mathematica by
      r2[t_]=2 Cos[t]
      p2=PolarPlot[r2[t],{t,-Pi/2,Pi/2}]
We can overlay these two graphs using the Show command:
      Show[p1,p2,PlotRange->{{-1,3},{-2,2}}]
where we use the PlotRange command to only display the part of the graphs in the region tex2html_wrap_inline360 and tex2html_wrap_inline362 .

From these two graphs, there appears to be a point of intersection at tex2html_wrap_inline364 , r=2, another at the origin and a third at about tex2html_wrap_inline368 . We could try and use the Solve command to find simultaneous solutions, but since this involves solving a transcendental equation of tex2html_wrap_inline316 , Mathematica won't be able to do it. Instead we can use the FindRoot command:

       FindRoot[r[t]-r2[t]==0,{t,0}]
The FindRoot command expects an equation, an independent variable of the equation and a initial guess (like in Newton's Method). Try changing the initial guess to find the other points of intersection.

Center of Mass in Polar

The basic formulas for finding the center of mass are

displaymath372

displaymath373

where tex2html_wrap_inline376 . We could use these formulas and the change of variable formulas to calculate centers of mass given polar functions. For example: find the center of mass of the thin plate inside the graph of tex2html_wrap_inline378 and outside the circle tex2html_wrap_inline380 if the density function is given by tex2html_wrap_inline382 . First a picture:

       p3=PolarPlot[{1,1+Cos[t]},{t,0,2 Pi}]
so the region we want is tex2html_wrap_inline384 , where tex2html_wrap_inline386 . To solve this problem in Mathematica we first need to tell Mathematica the change of variable formulas:
       x = r Cos[t]
       y = r Sin[t]
where we will use t instead of tex2html_wrap_inline316 . We now just have to type in the basic center of mass integrals:
       density = x^2
       dmp = density r
       mass = Integrate[Integrate[dmp,{r,1,1+Cos[t]}],{t,-Pi/2,Pi/2}]
       momentx = Integrate[Integrate[y dmp,{r,1,1+Cos[t]}],{t,-Pi/2,Pi/2}]
       momenty = Integrate[Integrate[x dmp,{r,1,1+Cos[t]}],{t,-Pi/2,Pi/2}]
       xbar = Simplify[momenty/mass]
       ybar = Simplify[momentx/mass]
Notice that we only need to give it the correct limits of integration in polar form. dmp is the incremental mass in polar coordinates, where the r comes from tex2html_wrap_inline394 .

Finally

Use the above to find the center of mass of the thin ring, tex2html_wrap_inline396 , if the density function is tex2html_wrap_inline398 . You should only have to change the limits of integration and density.


next up previous contents
Next: Change of Variables Up: Computational Labs in Mathematica Previous: Extrema of Functions

James Powell
Fri Feb 14 12:47:33 MST 1997