






























Estude fácil! Tem muito documento disponível na Docsity
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Prepare-se para as provas
Estude fácil! Tem muito documento disponível na Docsity
Prepare-se para as provas com trabalhos de outros alunos como você, aqui na Docsity
Encontra documentos específicos para os exames da tua universidade
Prepare-se com as videoaulas e exercícios resolvidos criados a partir da grade da sua Universidade
Responda perguntas de provas passadas e avalie sua preparação.
Ganhe pontos para baixar
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
chapter 8 maxima
Tipologia: Manuais, Projetos, Pesquisas
1 / 38
Esta página não é visível na pré-visualização
Não perca as partes importantes!































In this chapter we present examples of vector arithmetic, vector
algebra, and vector analysis using Maxima.
Vector arithmetic in Maxima
A vector in Maxima can be simply defined as a list. Typically, physical vectors
(representing, for example, position, velocity, acceleration, force, moment, momentum,
angular velocity, angular acceleration, etc.) are three-dimensional vectors. Therefore,
physical vectors can be represented by a list of three elements, e.g., the vectors
u = -2 i + 3 j +8 k and v = 3 i -2 j -4 k can be represented, in Maxima , as follows:
Addition, subtraction, multiplication by a scalar, and linear combinations of vectors are
straightforward, as illustrated in the following examples:
NOTE : Use of the traditional multiplication (*) and division (/) symbols with two vectors,
such as u and v , results in a term-by-term operation that produces a list. The resulting
lists, in these cases, have no physical meaning. The following examples illustrate the use
of the term-by-term multiplication and division operations:
Scalar (dot) and vector (cross) products
The scalar, or dot , product of two vectors is accomplished by using a period between the
vectors, e.g.,
Since the dot product of a vector with itself represents the square of the vector's
magnitude (or Euclidean length), the magnitude of a vector can be calculated as the square
root of the dot product of the vector with itself, i.e.,
u
u ⋅ u. For example, the
magnitudes of vectors u and v will be calculated as:
A unit vector in the direction of u is calculated as
e
u
u
∣ u ∣
. Using Maxima, this can be
accomplished by the following commands:
The angle between two vectors is calculated as
=cos
− 1
u ⋅ v
∣ u ∣∣ v ∣
. Thus, using Maxima , the
angle, in radians, between vectors u and v is calculated as:
Determining the equation of a plane using the dot product
The figure below shows a plane containing a point P 0
( x 0
,y 0
,z 0
) with normal vector n. If one
selects an arbitrary point P( x,y,z ) in the plane, one can form the vector
r = P
0
0
and use the fact that n ⋅ r =∣ n ∣∣ r ∣cos 90
o
= 0 to determine the equation of the plane.
Consider, for example, a plane containing point P 0
(-2, 5, 3) normal to the vector n =
3 i +5 j +2 k. First, we define the vector n and points P 0
and P :
Next, we use the dot product to produce the equation of the plane:
It's easy to verify that point P 0
belongs in the plane by using:
Using function solve we can solve for z out of the equation EQ , and define a function f( x,y )
that can be used to plot the plane:
To produce the plot you can use the wxMaxima menu option plotting>plot3d... which
produces the following input form. The options used to produce the plot, as well as the
resulting plot, are shown in the figure below:
The multiple-line input box for this command will look as follows:
Figure 8.2. Multiple-line input box for the command used in Figure 8.1, above.
A second example of plotting vectors is shown in Figure 8.3, which shows the plot of vectors
u = 2 i + 3 j , v = 3 i + 2 j , and their sum, w = u + v. Notice the use of different colors to
indicate the different vectors involved. All the vectors use the same head_length,
head_angle, and base point [0,0].
Figure 8.3. Use of function wxdraw2d to plot multiple vectors.
Function draw3d can be used to plot three-dimensional vectors as illustrated in the
following example. The result is shown in Figure 8.5.
Figure 8.4. wxMaxima input for plotting 3 three-dimensional vectors and multiple-line input
box command with the plotting command.
Figure 8.5. Plot of 3 vectors in three-dimensions using function draw3d.
Any of these functions can be evaluated for different values of t , e.g., using the option
Algebra > Make list … , results in the following:
Scalar functions, such as the magnitudes of the position, velocity, and acceleration vectors,
mag_r(t), mag_v(t), and mag_a(t) , can be plotted using function wxplot2d , e.g.,
Integrals of vector functions. Function integrate, or the option Calculus>Integrate... , can
be used to calculate indefinite or definite integrals for a vector function. For example,
given a velocity v(t) = sin(t) i + cos(t) j + t k , the position vector can be calculated as an
indefinite integral, r t = ∫
v t dt C. Maxima does not include the integrating constant
automatically, therefore, in the Maxima command, we include the constant ourselves in the
command:
Suppose that the initial conditions are r (0) = [2,-3,4], which we will re-write as an equation
Eq = r(0)-[2,-3,4], and use the command solve to calculate the constants Cx, Cy, and Cz :
The user can then substitute the values of the constants Cx, Cy, and Cz into the different
components of the vector r(t) , namely, r(t) [ 1 ] , r(t) [ 2 ] , and r(t) [ 3 ], respectively. Finally,
the vector function r(t) gets re-defined:
Plots of vector functions. To plot vector functions we can generate a list of vectors by
evaluating the vector functions at different values of the parameter t. For example, for
the following position r(t) and velocity v(t) functions:
we can define the following functions r2df(t) and v2df(t) that will create the vectors for
plotting:
To illustrate the application of function wxdraw2d to the lists created above, we use
function apply to function wxdraw2d and to each list:
To plot the curve and the two sets of vectors we combine the three lists into one using
append, and then use function apply with function wxdraw2d as follows:
Consider now a three-dimensional vector plot including position, velocity, and acceleration
vectors for a space curve. First, we define the vectors as follows:
Next, we define functions to put together the vectors for plotting:
The next step is to create lists of vectors for position, velocity, and acceleration:
Differential geometry of curves
A curve C in space can be defined by a triad of parametric equations x = x(t), y = y(t), and
z = z(t). Notice that the parameter t may or may not represent time. If it does, then the
curve represents the trajectory of a particle undergoing motion. If the parametric
equations are written in terms of a parameter s representing the arc length of the curve,
(measured from an arbitrary point on the curve), then we can define the unit tangent
vector T as
d r
ds
Also, the principal (unit) normal vector is defined by the expression
d T
ds
where κ is the curvature of curve C at a given point. Since | N | = 1, the curvature is
calculated as:
∣
d T
ds
∣
The radius of curvature is defined as
The center of curvature of C at a given point is found by measuring a distance ρ along the
direction of N. A circle of curvature can be traced for every point in a curve. The
curvature of a space curve is illustrated in Figure 8.6(a).
Figure 8.6. Curvature and vector triad for a space curve.
A unit binormal vector can be calculated using vectors N and T as
The unit vectors T , N , and B constitute a local system of orthogonal axes known as the
vector triad at any point on the curve C. The plane defined by vectors T and N is known as
the osculating plane
1
. The plane defined by vectors B and N is known as the normal plane.
The plane defined by vectors B and T is known as the rectifying plane. Figure 8.6(b)
illustrates the vector triad and the osculating, normal, and rectifying planes associated
with a point P in a space curve.
Since, in most cases, it is difficult to determine the dependency of the position vector r on
the curve length s, we can write the parametric equations in terms of another parameter,
say, t, so that r (t) = x(t) i + y(t) j + z(t) k. In this case the calculations to perform to find the
curvature parameters as well as the vector triad are as follows. First, the unit tangent
vector is calculated as:
d r
ds
d r / dt
ds / dt
d r / dt
∣ d r / dt ∣
since ds =∣ d r ∣. Also, to calculate d T /ds, curvature, radius of curvature, unit normal
vector, and binomial unit vector use, respectively:
d T
ds
d T / dt
ds / dt
d T / dt
∣ d r / dt ∣
∣
d T
ds
∣
, and
d T
ds
Finally,
Example of a vector triad calculated using Maxima
Consider the parametric equations that define a curve C in space, namely, x(t) = 3 sin(2t),
y(t) = 3 cos(2t), z(t) = t/2 , where s is the distance measured along the curve from point
0
(0,3,0), i.e., s= 0. Thus, the position vector corresponding to curve C is given by:
First, we calculate d r /dt ( drdt ):
1 From the Latin word osculare (to kiss), i.e., the osculating plane is the kissing plane.
The curvature κ of the curve C,
∣
d T
ds
∣
, is calculated as follows:
To check the sign of the curvature, compare the vectors
d T
ds
and ∣∣ N
Since
d T
ds
, then the correct sign for κ is a positive sign, i.e.,
The radius of curvature
is, therefore,
The normal vector is calculated as
d T
ds
, i.e.,
By inspection we can see that the magnitude of N is 1. If you have any doubts, try the
following:
The binormal vector is calculated using the cross product B = T × N :
To find the vector triad at point P 0
(0,3,0), for t = 0 , we use the following commands:
We can check that the ( T , N , B ) triad is orthogonal by calculating the dot products: N • T , T • B ,
and B • N , which should all be zero: