Homework 4, due September 20, 2006

Due Wednesday, September 20, 2006.
Post Reply
goodwine
Site Admin
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

Homework 4, due September 20, 2006

Post by goodwine »

We love the system illustrated in the following figure so much that we are going to solve every reasonable permutation of it. The reason we love it so much is, of course, that it is so broadly applicable to many important engineering problems that entire text books are devoted to it.
    • Image
Unless otherwise indicated, assume there is no gravity and that x is measured from the unstretched position of the spring. In this case, the equations of motion are
    • Image
  1. For the case where
    • Image
    1. Show that
      • Image
      as long as
      • Image
    2. Determine the solution in the case where
      • Image
    3. Plot the solution for the problem in part (b). A hand sketch is adequate as long as it is qualitatively accurate.
    4. When the forcing frequency is very close, but not exactly equal, to the natural frequency which solution (the solution you just determined or the one from class) is correct? Plot the solution. Again, a hand sketch is adequate as long as it is qualitatively accurate.
  2. Assume for this problem that there is gravity.
    1. Derive the equations of motion when x is measured from the unstretched position of the spring.
    2. Show that the equation of motion for the system is
      • Image
      when y is measured from the static equilibrium of the system, i.e., under gravity the weight of the mass would stretch the spring by an amount x=mg/k so y=x-mg/k.
    The significance of this is that even if there is gravity, we can neglect is as long as the position of the mass is measured from the position of static deflection of the spring due to the weight of the mass.
  3. For damped unforced (F(t)=0) oscillations, we showed in class that the (homogeneous) solution to the equation given at the top of the page is
    • Image
    as long as
    • Image
    1. Determine the (homogeneous) solution when
      • Image
    2. Determine the (homogeneous) solution when
      • Image
  4. For the damped unforced oscillation case where
    • Image
    plot the solution for
    • Image
    for the time interval t=0 to t=10. Plot all the curves on the same plot.
  5. Find the general solution for
    • Image
    where
    • Image
    You may assume that the damping ratio is between zero and one.
  6. Write a computer program to determine an approximate numerical solution to the system in the previous problem for the case where
    • Image
    Plot the exact solution (from the previous problem) versus the numerical solution for various time step sizes. Indicate what the minimum time step seems to be to provide an accurate solution up to t = 50.
Bill Goodwine, 376 Fitzpatrick
pschluet

Problems 2 and 6

Post by pschluet »

Problem 2: I tried drawing a free-body diagram and summing of the forces to obtain the following: F(t) + mg - bx' -k[x - (mg)/k] = mx'' , but this doesn't seem to be getting me anywhere. I am not really sure where to start on this problem.

Problem 6: I have no experience with Fortran, so I am having a very difficult time understanding the example computer programs you put up in class. Could you post some kind of a commented example explaining what each command and/or line in the program does? That would be very helpful. Thanks very much.
goodwine
Site Admin
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

Re: Problems 2 and 6

Post by goodwine »

pschluet wrote:Problem 2: I tried drawing a free-body diagram and summing of the forces to obtain the following: F(t) + mg - bx' -k[x - (mg)/k] = mx'' , but this doesn't seem to be getting me anywhere. I am not really sure where to start on this problem.
You are suppoed to determine the equation of motion in terms of y, not x. All you need to do to finish the problem is to substitute the expression for y that is provided in the problem. You will see that the terms due to gravity then cancel.
Problem 6: I have no experience with Fortran, so I am having a very difficult time un/derstanding the example computer programs you put up in class. Could you post some kind of a commented example explaining what each command and/or line in the program does? That would be very helpful. Thanks very much.
I'm sure you can probably interpret most of the lines. If you have specific questions regarding some of the lines, post them and I'll explain exactly what they do.
Bill Goodwine, 376 Fitzpatrick
pschluet

Problem 6

Post by pschluet »

I do not know what the following lines in one of your example programs do. Could you please explain?

double precision x(2), t, dt, f(2)
integer n
open(unit=13, file="output.d")

do 10 t =0, 30, dt

write (13,*) t, x(1), x(2)

Also, I am not sure which columns the following commands start in (I assume all the other commands from this example start in column 7?):

program eulerexample

do 10 t=0, 30, dt

10 continue
goodwine
Site Admin
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

Re: Problem 6

Post by goodwine »

pschluet wrote:I do not know what the following lines in one of your example programs do. Could you please explain?

double precision x(2), t, dt, f(2)
integer n
These lines "declare" the variables to be a certain type: "double precision" means it's a real number. The double part means to use twice as much space in memory to store it so that it has better (double) the precision of a real number. "Integer" means to store it as in integer.
open(unit=13, file="output.d")
This means open a file named "output.d" and give it a label of 13. Later when there is a write statement with a 13 in it, it means to put the stuff in this file. That way you can open multiple files to write at the same time.
do 10 t =0, 30, dt
This means to have t start at 0 and as long as t is less than 30, do everything between this line and the line with the label 10 on it, and each time through increment t by the value of dt.
write (13,*) t, x(1), x(2)
This means to write the values of the three variables to the file with the label "13", in this case "output.d".
Also, I am not sure which columns the following commands start in (I assume all the other commands from this example start in column 7?):
I don't recall all the rules, but all the commands start in line 7. Something in the first column indicates that the line is a comment. The "10" that occupies the second and third column for the continue statement is the label that goes with the "do" loop.

More information regarding fortran 77 and its syntax can be found here.
Bill Goodwine, 376 Fitzpatrick
tscherbe

Prob 4

Post by tscherbe »

You said to let you know of any problems I was having with matlab. I keep getting this error message when I enter for my plot:

??? Error using ==> mtimes
inner matrix dimensions must agree


My code is:

plot(t, (cos(t)+0.2*sin(t))*exp(t.*-0.2))
goodwine
Site Admin
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

Re: Prob 4

Post by goodwine »

tscherbe wrote:You said to let you know of any problems I was having with matlab. I keep getting this error message when I enter for my plot:

??? Error using ==> mtimes
inner matrix dimensions must agree


My code is:

plot(t, (cos(t)+0.2*sin(t))*exp(t.*-0.2))
I'd try a .* between the closing parenthesis and the exp. Let me know if that works.
Bill Goodwine, 376 Fitzpatrick
Post Reply

Return to “AME 30314 Homework 4”