polar_coordinates

<< Click to Display Table of Contents >>

Navigation:  Sample Problems > Usage > Misc >

polar_coordinates

Previous pageReturn to chapter overviewNext page

{  POLAR_COORDINATES.PDE  

 

  This example demonstrates the use of functional parameter definitions

   to pose equations in polar-coordinate form.  The function definitions  

   expand polar derivatives in cartesian (XY) geometry.

}  

 

title 'Polar Coordinates'  

 

Variables  

   u  

 

definitions  

   k = 1  

   u0 = 1-r^2  

   s = 4  

   dr(f) = (x/r)*dx(f) + (y/r)*dy(f) { functional definition of polar derivatives... }  

   dphi(f) = (-y)*dx(f) + x*dy(f)     {... in cartesian coordinates }  

 

equations { equation expressed in polar coordinates  

              (Multiplied by r^2 to clear the r=0 singularity) }  

   U: r*dr(r*dr(u)) + dphi(dphi(u)) + r*r*s = 0    

 

boundaries  

  Region 1  

      start(0,0)  

      natural(u) = 0 line to (1,0)  

      value(u)=u0   arc(center=0,0) angle=90  

      natural(u)=0   line to close  

 

monitors  

  grid(x,y) as "Computation Mesh"  

  contour(u) as "Solution"  

  contour(u-u0) as "Error (u-u0)"  

 

plots  

  grid(x,y) as "Computation Mesh"  

  contour(u) as "Solution"  

  contour(u-u0) as "Error (u-u0)"  

end