The Bucket, Harvey Mudd Style
03 Dec 2007 Quan Quach 1 comment 892 views
This is a project I did for grand daddy stems back when I was at Harvey Mudd in 2004. Might be useful to current mudders since The Bucket Lab has been a long standing tradition at Mudd. You can download the source files here. Hopefully people find this helpful! I didn’t really deal with the formatting and just put it up very quickly. Good luck!

Bucket Simulation User Manual
Janet Lui
Quan Quach
Engineering 205
Design Project 1
November 3, 2004
TABLE OF CONTENTS
1. INTRODUCTION (Getting Started)……………………………………………………………………………………………. 4
1.1. Project Introduction…………………………………………………………………………………………………………………. 4
1.2. Getting Started………………………………………………………………………………………………………………………….. 5
2. Theory and Equations…………………………………………………………………………………………………………………. 8
2.1. Derivation of Equation of Motion…………………………………………………………………………………………. 8
2.2. Equations for Inertia of System…………………………………………………………………………………………….. 9
2.3. Approximating the settling time………………………………………………………………………………………….. 10
3. Simulating the bucket……………………………………………………………………………………………………………… 10
3.1. Simulink model………………………………………………………………………………………………………………………….. 10
3.2. Sample runs………………………………………………………………………………………………………………………………… 11
3.3. Troubleshooting tips for simulation………………………………………………………………………………….. 14
Appendix A: Matlab Code…………………………………………………………………………………………………………………… 17
LIST OF FIGURES
Figure 1: Opening the Program……………………………………………………………………………………………………………………. 5
Figure 2: Bucket Simulation GUI……………………………………………………………………………………………………………….. 6
Figure 3: Example of Bucket Simulation…………………………………………………………………………………………………. 7
Figure 4: Error Prompt………………………………………………………………………………………………………………………………….. 7
Figure 5: Diagram of Bucket and Mass Spring System w/ Damping…………………………………………………….. 8
Figure 6: Simulink Model of the Bucket………………………………………………………………………………………………… 11
Figure 7: Sample Run #1………………………………………………………………………………………………………………………………. 12
Figure 8: Sample Run #2………………………………………………………………………………………………………………………………. 13
Figure 9: Sample Run #3………………………………………………………………………………………………………………………………. 14
Figure 10: Simulink Model…………………………………………………………………………………………………………………………. 15
Figure 11: Relative Tolerances and Solver Methods………………………………………………………………………… 15
1. INTRODUCTION (Getting Started)
1.1. Project Introduction
The angular deflection with respects to time of a cylindrical bucket suspended by a torsion wire is simulated using MatLAB. The bucket can be filled to varying heights (L) using three different types of liquids each with a different viscosity (
). In addition, up to four heavy disks can be loaded on the bucket. The user must choose
, L, and the number of disks to be loaded in order to achieve a settling time of ten minutes after an initial deflection of π radians.
1.2. Getting Started
To run the bucket simulation, open MATLAB and set the current directory to \\Charlie.hmc.edu\Courses\Engineering\E205\Project1\Bucket. Next, make sure that the “current directory” tab is selected in the upper left window. Finally, double click ‘BucketGui.fig‘ in order to start the Matlab GUI for the bucket simulation.

At this point, the following graphical user interface should appear. If it doesn’t, make sure the current directory is set correctly and that the right file is being accessed.

Figure 2: Bucket Simulation GUI
The depth of the liquid inside the bucket (0 to 20 centimeters), viscosity (10-3, 10-2, and 10-1 kgm-1s-1), and the number of disks to be added at the bottom of the bucket (0 to 4) are parameters that can be varied in this simulation. The depth parameter must be entered into the text box while the values for viscosity and number of disks are chosen through a popup menu. Clicking on the popup menu brings down a list of possible choices that can be selected. Once all parameters have been chosen, the simulation is ready to proceed. Pressing the “Plot” button will simulate the angular deflection of the bucket with respects to time. The following figure shows a simulation for a depth of 10cm, viscosity of 0.01, and 2 disks.

Figure 3: Example of Bucket Simulation
If the depth parameter is greater than 20cm, an error prompt pops up when ‘Plot’ is pressed:

The ‘Results’ box stores information on the depth, viscosity, number of disks, and the settling time from previous trials. The parameters of tmin, tmax, θmin, and θmax allow for rescaling of axes. Once the parameters have been changed, the ‘Plot‘ button must be pressed again for the changes to take effect. The amount of time that the bucket is simulated for can also be altered through the ‘Simulation Time’ parameter. Once this parameter is changed, the plot needs to be regenerated. It should be noted that if ‘Simulation time’ is larger than tmax, no data will be displayed after tmax. Thus, it is a good idea to make sure that tmax ≥ ‘Simulation Time’.
2. Theory and Equations
2.1. Derivation of Equation of Motion

Figure 5: Diagram of Bucket and Mass Spring System w/ Damping
The bucket can be modeled as the more familiar mass spring system with damping. The equation of motion for a mass spring system with damping is derived by summing the forces and setting it equal to zero. Thus, the equation of motion for the mass spring system with damping is simply:
, where m is the mass, c is the damping constant, and k is the spring constant.
Since the bucket is essentially the same system, the equation of motion for the bucket will be very similar:
, where I is the moment of inertia of the system, c is the damping constant, and k is the torsional spring constant of the wire. There are two main differences between the two equations. First, the displacement is now measured in terms of angular displacement rather than positional displacement. Second, the moment of inertia of the system is used instead of the mass.
To reiterate, the equation of motion of the bucket is:
with initial conditions:
(1)
In canonical form, the equation of motion is:
where
(2)
Also, the damping coefficient c is given by the equation:
(3)
where L is the depth of the liquid inside the bucket,
is the viscosity of the liquid,
is the density of the liquid, and R is the radius of the bucket.
2.2. Equations for Inertia of System
The inertia of the bucket itself is given as Ib = 8*10-4 kgm2. In deriving the equation for the inertia of the system, two assumptions are made. The first assumption is that the liquid within the bucket moves a negligible amount at the boundary of the bucket. Thus, the liquid is assumed to be stationary and the effects of the liquid sloshing during the angular displacement can be ignored. The second assumption made here is that the liquid’s mass is much smaller than the bucket’s mass, meaning that it can also be excluded from the equation. The only thing left to consider are the disks. Since the disks are loaded on the same axis of rotation of the bucket, the moment of inertia of the disks can simply be added to the moment of inertia of the bucket. When disks are added, the general equation for the inertia of the system is found to be:
Isystem = Ib + ½ mR2 (4)
where m is the total mass of the disks loaded and R is the radius of the disk.
2.3. Approximating the settling time
The settling time is the time required for the response to stay within a defined error band. The error band used in this simulation is 10%. A conservative approximation of the settling time is to calculate the time at which the envelope of the response reaches the values within the error band.
error band = 0.10
Solving for
, we get the following equation:
![]()
This equation is accordingly used in the simulation to approximate the settling time with a 10% error band.
3. Simulating the bucket
3.1. Simulink model
The angular deflection of the bucket with respects to time is modeled using Simulink, a program within MatLAB. The equation of motion of the bucket is directly translated into a block diagram and run in Simulink. The calculated values of theta are then stored in the MatLAB workspace and used to plot the response of the bucket in the GUI. The Simulink model is directly controlled by an M-file (refer to appendix A to see the Matlab code).

Figure 6: Simulink Model of the Bucket
3.2. Sample runs
Three sample runs were conducted. The following figures show what happened on each of the sample runs on the GUI. All three plots exhibit behavior expected from a second order damped system as the response is decaying to zero over time.



3.3. Troubleshooting tips for simulation
Any second order system with damping should eventually decay to zero. Angular deflection of the bucket not decaying to zero is a significant problem that may arise during simulation of the bucket. Changing the relative tolerance or the integration method should help. To change this parameter, open the Simulink model used to model the bucket. Click on ‘Simulation’ and select ‘Simulation parameters’.

Next, reduce the relative tolerance in order to decrease simulation error. This should help the response of the bucket approach zero, but will not entirely fix the problem. Other alternatives include experimentation with other solvers to see if they provide better results.

Figure 11: Relative Tolerances and Solver Methods
As with any new program, there are bound to be bugs. If the program crashes, simply restart it.
%———————————————
%parameters
%———————————————
R = 0.08; %meters
height = 0.2; %meters
k = 0.015; %Newton-meters
mass_disk = 3; %kg
diameter_disk=0.12; %meters
I_bucket = 8*10^-4; %kg*meters^2
p =1000; %kg*meters^-3
%———————————————
%input
%———————————————
h =gcf;
handles = guihandles(h);
% num_disk = str2double(get(handles.num_disk, ‘String’));
%
Lcm = str2double(get(handles.L, ‘String’));
xmin = str2double(get(handles.xmin, ‘String’));
xmax = str2double(get(handles.xmax, ‘String’));
ymin = str2double(get(handles.ymin, ‘String’));
ymax = str2double(get(handles.ymax, ‘String’));
simTime = str2double(get(handles.simTime, ‘String’));
L = Lcm./100;
indexVis = get(handles.u, ‘Value’);
u = str2double(get(handles.u, ‘String’));
index_disk= get(handles.num_disk, ‘Value’);
num_disk = str2double(get(handles.num_disk, ‘String’));
vis= u(indexVis);
numberDisk = num_disk(index_disk);
I=I_bucket + 1/2*numberDisk*mass_disk*(diameter_disk/2)^2;
omegaN = (k/I)^.5;
c = 1.5* ( vis/p/omegaN/R^2)^.5 * (p*omegaN*R^5)*L/R;
zeta = c / (2*(k*I)^.5);
sim(’bucket_sim’);
tss = (4 / (zeta*omegaN));
tsm = tss/60;
% send results to ListBox
resultstr = get(handles.results,’String’);
if strcmp(resultstr,’Listbox’)
resultstr = []
end
set(handles.results,’String’, [resultstr; num2str(Lcm, '%6.2f'), ' ', ...
num2str(vis, '%5.3f'), ' ', num2str(numberDisk), ' ', ...
num2str(tsm, '%3e')])
resultstr = get(handles.results,’String’);
plot(tout,theta);
title(’Bucket Simulation’);
ylabel(’\theta (rad)’);
xlabel(’time (s)’);
axis([xmin xmax ymin ymax]);
grid on;
if L > .2 || L < 0
Ltext = ‘You have entered an invalid liquid depth. 0m < L < .2m)’;
msgbox(Ltext, ‘error’)
end
if tsm > 100
tsmText = ‘Your settling time is too big!! Want 10 minutes!’;
msgbox(tsmText, ‘error’)
end.
One Response to “The Bucket, Harvey Mudd Style”
Leave a Reply
Include MATLAB code in your comment by doing the following:
<pre lang="MATLAB">
%insert code here
</pre>


So I’ve been using this site to improve my Matlab skills on personal projects, and I saw this page and never realized you went to Mudd. I went to Mudd and know the bucket lab very well. They have since discontinued it with last year’s sophomore class.