Navigation:  Sample Problems > usage >

vector_functions

Print this Topic Previous pageReturn to chapter overviewNext page

{ VECTOR_FUNCTIONS.PDE  

 

 This example illustrates the vector functions

 

 VECTOR

 MAGNITUDE

 DOT

 CROSS

 NORMAL

 TANGENTIAL

 

}

title

"vector functions"

select

 elevationgrid=500

{no variables}

definitions

 u= exp(-x^2+ y)               { A scalar potential, perhaps }

 f= grad(u)                   { F = grad(u)  is a vector }

 df= div(f)                   { Divergence of F is a scalar}

 cf= curl(f)                   { Curl of F is a new vector }

 vx= -sin(y)   vy= 2*sin(x)   { vector components }

 v= vector(vx,vy)             { Another vector }

 mv= magnitude(v)             { Magnitude of v }

 cv= curl(v)

 ccv= curl(curl(v))

{no equations}

{plot domain -- required}

boundaries

region 1

  start "Outer" (-1,0)

  line to (1,0) to (1,1) to (-1,1) to close

feature

  start "inner" (-1/2,1/2) line to (1/2,1/2)

plots

vector(f)

elevation(normal(f)) on "Outer"

elevation(tangential(f)) on "inner"

contour(df)   as "Div F"

contour(mv)   as "Magnitude V"

contour(dot(v,vector(x,0)))

contour(zcomp(cross(f,v)))

contour(zcomp(cv))   as "Curl V"

vector(ccv)   as "Curl Curl V"

end

 


Page url: index.html?usage_vector_functions.html