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)>>
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