phystricks
Public Member Functions | Public Attributes | List of all members
phystricks.src.BasicGeometricObjects.GeometricVectorField Class Reference
Inheritance diagram for phystricks.src.BasicGeometricObjects.GeometricVectorField:
Inheritance graph
[legend]
Collaboration diagram for phystricks.src.BasicGeometricObjects.GeometricVectorField:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, fx, fy)
 
def divergence (self)
 
def graph (self, xvalues=None, yvalues=None, draw_points=None)
 
def __call__ (self, a, b=None)
 

Public Attributes

 fx
 
 fy
 
 vector_field
 

Detailed Description

Describe a vector field

INPUT:

- ``f`` - a tupe of function

EXAMPLES::


    sage: from phystricks.BasicGeometricObjects import *
    sage: x,y=var('x,y')
    sage: f1=phyFunction(x**2)
    sage: F = GeometricVectorField( f1,cos(x*y) )
    sage: print F(3,pi/3)
    <vector I=<Point(3,1/3*pi)> F=<Point(12,1/3*pi - 1)>>

Constructor & Destructor Documentation

def phystricks.src.BasicGeometricObjects.GeometricVectorField.__init__ (   self,
  fx,
  fy 
)

Member Function Documentation

def phystricks.src.BasicGeometricObjects.GeometricVectorField.__call__ (   self,
  a,
  b = None 
)
return the affine vector at point (a,b).

INPUT:

- ``a,b`` - numbers.

OUTPUT:
an affine vector based on (a,b).

EXAMPLES::

    sage: from phystricks import *
    sage: x,y=var('x,y')
    sage: F=VectorField(x**2,y**3)
    sage: print F(1,2)
    <vector I=<Point(1,2)> F=<Point(2,10)>>

    sage: P=Point(3,4)
    sage: print F(P)
    <vector I=<Point(3,4)> F=<Point(12,68)>>
def phystricks.src.BasicGeometricObjects.GeometricVectorField.divergence (   self)
return the divergence of the vector field.

OUTPUT:

a two-variable function

EXAMPLES::

    sage: from phystricks.BasicGeometricObjects import *
    sage: x,y=var('x,y')
    sage: F = GeometricVectorField( x , y )
    sage: F.divergence()
    (x, y) |--> 2

The divergence of the gravitational field vanishes::

    sage: G=GeometricVectorField(x/(x**2+y**2),y/(x**2+y**2))
    sage: G.divergence().simplify_full()
    0

The divergence is a function::

    sage: a,b=var('a,b')
    sage: H=GeometricVectorField( x**2,y**3 )
    sage: H.divergence()(a,b)
    3*b^2 + 2*a
def phystricks.src.BasicGeometricObjects.GeometricVectorField.graph (   self,
  xvalues = None,
  yvalues = None,
  draw_points = None 
)
return a graph of self with the given points

INPUT:

- ``xvalues`` - tuple (x,mx,My,n) interval and number of points with respect to X.

- ``yvalues`` - tuple (y,my,My,n) interval and number of points with respect to Y.

- ``draw_points`` - (defaulf : empty list) a list of points.

If xvalues is given, then yvalues has to be given.

OUTPUT:

object VectorFieldGraph.

EXAMPLES::

    sage: from phystricks.BasicGeometricObjects import *
    sage: x,y=var('x,y')
    sage: F=VectorField(x,y).graph(xvalues=(x,-2,2,3),yvalues=(y,-10,10,3),draw_points=[Point(100,100)])
    sage: print F.draw_points[0]
    <Point(100,100)>
    sage: print len(F.draw_points)
    10

Member Data Documentation

phystricks.src.BasicGeometricObjects.GeometricVectorField.fx
phystricks.src.BasicGeometricObjects.GeometricVectorField.fy
phystricks.src.BasicGeometricObjects.GeometricVectorField.vector_field

The documentation for this class was generated from the following file: