Contents

Aaron Klapheck

% Ch 2. Assignment #5       due 10/3
clear, clc
date
ans =

26-Sep-2007

Problem 32

% Given: Velocity(v) = [0, 10, 0]. Positin(r) = [2, 10t+3, 0], t = time.
% Momentum(L) = m(r cross v).

m = 5
v = [0, 10, 0]
t = [0:0.5:5]
f = 10*t+3
P = [2*ones(length(t),1), f', zeros(length(t),1)]       % a.

% b. I used f(length(t)) because we want to find the location when
% t = 5s, and 5 is the last number in the vector f.
r_at_5s = [2, f(length(t)), 0]

L = m*cross(r_at_5s, v)                                 % c.
m =

     5


v =

     0    10     0


t =

  Columns 1 through 9 

         0    0.5000    1.0000    1.5000    2.0000    2.5000    3.0000    3.5000    4.0000

  Columns 10 through 11 

    4.5000    5.0000


f =

     3     8    13    18    23    28    33    38    43    48    53


P =

     2     3     0
     2     8     0
     2    13     0
     2    18     0
     2    23     0
     2    28     0
     2    33     0
     2    38     0
     2    43     0
     2    48     0
     2    53     0


r_at_5s =

     2    53     0


L =

     0     0   100

Problem 33

% Given: M = (r cross F)*n, where: M is the magnitude of the moment,
% F is a force vector, r is the position vector, and n is the unit
% vector in the dirrection of the line.

F = [10, -5, 4]
r = [-3, 7, 2]
n = [6, 8, -7]

M = dot(cross(r,F),n)
F =

    10    -5     4


r =

    -3     7     2


n =

     6     8    -7


M =

   869

Problem 35

% Area of parallelogram is the magnitude of the cross product of two
% of its sides.

A = [7, 0, 0]
B = [1, 3, 0]

sqrt(sum(cross(A,B).*cross(A,B)))       % Area of parallelogram.

% Simply by looking at the cross product (which is [0,0,21]), it is
% obvious that its magnitude will be 21.
A =

     7     0     0


B =

     1     3     0


ans =

    21

Problem 40

f = [14, 6, 3, 9]
g = [5, 7, 4]

[Quotient, Remainder] = deconv(f,g)
f =

    14     6     3     9


g =

     5     7     4


Quotient =

    2.8000   -2.7200


Remainder =

   -0.0000    0.0000   10.8400   19.8800

Problem 41

f = [8, -9, 0, -7]
g = [10, 5, -3, -7]

% Evaluate each polynomial when x = 5.
f_at_5 = polyval(f,5)
g_at_5 = polyval(g,5)

f_at_5/g_at_5
f =

     8    -9     0    -7


g =

    10     5    -3    -7


f_at_5 =

   768


g_at_5 =

        1353


ans =

    0.5676