I nstructions for Extra Credit Assignment

home | Go to Java program SpringTest2

spring program I n the Java program SpringTest2, you will be able to work with a  simulation of an ideal spring system. In real life, you always have friction, the spring always has mass, and the motor does not necessarily put out a sinusoidal force. Another words, you can't control many aspects of the experiment. In this simulation you can control every aspect of the spring system, from the spring constant k to the amount of friction in the system (the damping constant), as well as the amplitude and frequency of a perfect motor. You could have done the driven oscillations experiment without even leaving the comfort of your own home with this program! Of course, it is vital to see what kinds of problems you experience in real life experiments, but I think you should also be allowed to play with the ideal case. So here's your assignment:

Please print this page so that you can follow the instructions while using the program.

1) Natural Oscillations:
-Turn off the damping (frictional force) by setting the damping constant to zero. Type 0.0 in the Damping Constant text box. When this is done, the "water" will no longer exert any force on the ball.
-Turn off the motor by typing 0.0 in the Driving Amplitude text box. (The Driving Force is a force which drives the spring system; it has the form A cos (w*t) ).
-Press the "GO!" button to observe what would happen to this ideal spring system without any external forces. The program starts the spring at -1.0 m, stretching the spring from its unstretched position. (If it didn't, the spring would sit at the unstretched position forever!)
-Observe the oscillations and allow the program to draw the graph completely.
-Print out the screen (See printing instructions below).

2) Damped Oscillations
-Turn on the damping (frictional force) by setting the damping constant to 0.1. When this is done the "water" will now exert a damping force on the ball, and it will retard the motion of the ball.
-The motor should still be off (The driving amplitude should be 0.0).
-Press "GO!" to observe what would happen to this ideal spring system with a small damping force. The spring will again start at -1.0 m.
-Observe the oscillations and allow the program to draw the graph completely.
-Print out the screen (See printing instructions below).
-Repeat the experiment, but now add a bigger damping force by setting the damping constant to 0.5 (Again, print the screen)
-Repeat the experiment for an extreme damping force of 1.0 (Again, print the screen)
3) Driven and Damped Oscillations
-Turn on the damping by setting the damping constant to 0.5. (You can even turn it off if you wish, since you can't break this glass or this motor! But for the assignment purposes, you should have some damping, so that we can see driven and damped oscillations)
-Turn on the motor by setting the driving amplitude to 1.0.
-Set the driving frequency to 0.5. (This means the driving force exerts a force F(t) = (1.0 N) cos (0.5 rads/s * t) )
-Press "GO!" to observe what would happen to this ideal spring system with a damping force and a driving force.
- Observe the oscillations and allow the program to draw the graph completely. The graph will not plot immediately. It takes a few moments for the "transient" behavior to subside. The behavior we are interested in is the "steady state" behavior, the behavior of the spring after many oscillations have passed. In a sense, it takes the spring awhile to "get used to" the driving force.
-Repeat the experiment for the driving frequencies 1.0, 1.5, 2.0, and 2.5.  You do not need to print out the screen for any of these frequencies.

-Make a response curve A(w) versus w for this driven damped linear oscillator. A(w) is the amplitude in meters. w is the driving frequency (0.5 rad/s, 1.0 rad/s,.... ,2.5 rads/s). Turn in this plot. (You may turn in a hand drawn plot. It does not require error bars).

Printing Instructions:
The Java program will not print from your browser. To print, you must do a "screen dump". This is a very useful technique for capturing the image on a screen for any program. (E.g. printing out your high score on your favorite game!) This information is for Windows users. Mac users, please consult Mac help.
-Press and hold down Alt and then press PrintScreen. Print Screen is a button usually located at the upper right hand corner of your keyboard. This puts the image of the entire screen or window onto the clip board.
-Go to a graphics program such as MS Paint. MSPaint is located on your start menu under Programs --> Accessories--> Paint. You can also use Word, WordPerfect, or any graphics or word processing program.
-Get the image from the clipboard by going to the Edit menu and selecting Paste.  (Or CTRL-V)
-You can now print out the screen by going to the File menu and selecting Print.
Note! You can only keep one such image on your clipboard at a time, so do this for each graph then go back and do the rest of the assignment.

Known problems:
Occasionally, the screen may black out or stop drawing the water and motor. This occurs due to some other thread interrupting the program, and causing an unscheduled repaint of the screen. This is not a critical error, and it is not essential to see the picture of the water and the motor for the program to run properly. However, if the graph does not draw (and the program does not display "please wait a moment...."), shut down your browser and shut off all other programs. Then restart your browser. If this does not help, then restart your computer and then play the program again.