\( \newcommand{\blah}{blah-blah-blah} \newcommand{\eqb}[1]{\begin{eqnarray*}#1\end{eqnarray*}} \newcommand{\eqbn}[1]{\begin{eqnarray}#1\end{eqnarray}} \newcommand{\bb}[1]{\mathbf{#1}} \newcommand{\mat}[1]{\begin{bmatrix}#1\end{bmatrix}} \newcommand{\nchoose}[2]{\left(\begin{array}{c} #1 \\ #2 \end{array}\right)} \newcommand{\defn}{\stackrel{\vartriangle}{=}} \newcommand{\rvectwo}[2]{\left(\begin{array}{c} #1 \\ #2 \end{array}\right)} \newcommand{\rvecthree}[3]{\left(\begin{array}{r} #1 \\ #2\\ #3\end{array}\right)} \newcommand{\rvecdots}[3]{\left(\begin{array}{r} #1 \\ #2\\ \vdots\\ #3\end{array}\right)} \newcommand{\vectwo}[2]{\left[\begin{array}{r} #1\\#2\end{array}\right]} \newcommand{\vecthree}[3]{\left[\begin{array}{r} #1 \\ #2\\ #3\end{array}\right]} \newcommand{\vecdots}[3]{\left[\begin{array}{r} #1 \\ #2\\ \vdots\\ #3\end{array}\right]} \newcommand{\eql}{\;\; = \;\;} \newcommand{\dv}[2]{\frac{#1}{#2}} \newcommand{\half}{\frac{1}{2}} \newcommand{\mmod}{\!\!\! \mod} \newcommand{\ops}{\;\; #1 \;\;} \newcommand{\implies}{\Rightarrow\;\;\;\;\;\;\;\;\;\;\;\;} \definecolor{dkblue}{RGB}{0,0,120} \definecolor{dkred}{RGB}{120,0,0} \definecolor{dkgreen}{RGB}{0,120,0} \)


Module 4: Simulating Continuous Systems


4.1   Simulating a simple chemical reaction

 

We'll start by modeling a simple reaction involving three molecules:

 
Exercise 1: Download and unpack this ZIP file into a new directory. Upon unpacking, you will see that it creates a new subdirectory called VirtualReactor. Go into that subdirectory and execute VirtualReactor. This will bring up a window. Here's what you do:
 
Now let's explain how the software works:
 
Exercise 2: Suppose you have ten A molecules and five B molecules. Now run the simulation very slowly by clicking on the "Step" button. (Note: Each time you start, remember to hit the "Reset" button.)
 
Next, we will examine long-term behavior:
 
Exercise 3: Study the long-term behavior (starting with 100 molecules of A, 50 molecules of B):
 
Let's examine how the simulation was written:
 
Exercise 4:
 


4.2   A more detailed model

 

How closely does our model correspond to reality?

 
We'll now model spatial detail:
 
Exercise 5: Use the "Model" menu and switch to the spatial model. Using the same numbers of molecules as above, see what happens when you run for about 100 time units and plot.
  • What do you observe? Why are there more fluctuations?
  • Next, look at the last row of controls. Set EndTime=100 and NumRuns=10. Then click the "simulate" button. What do you observe?
  • Try the same with NumRuns=100. What do you see?
  • For comparison, try NumRuns=10 and NumRuns=100 in the standard simulation.
 
On randomness in the model:
 
 
Exercise 7:
  • If the spatial model doesn't use concentration, why then is the behavior like the standard model?
  • Find the place in the code that has the "distance" parameter. What is the distance parameter set at? Double it and see what you get. Can you explain? What is "doubling" the distance equivalent to in terms of using other values for \(p\) and \(q\)?
 


4.3   A less detailed model

 

What we desire in a model:

 
Consider this deterministic model:
  • Let $$\eqb{ A(t) & \eql & \mbox{ concentration of A at time } t\\ B(t) & \eql & \mbox{ concentration of B at time } t\\ C(t) & \eql & \mbox{ concentration of C at time } t\\ }$$

  • Now, focus on \(A(t)\):
    • Consider the concentration a few moments later at time \(A(t+s)\) where \(s\) is a small value.

    • In the time period, \(s\), that has elapsed, what affects the concentration of A?

    • Let's consider the change in concentration, \(A(t+s) - A(t)\).

    • \(A(t+s) - A(t)\) could decrease because A molecules react with B molecules
           \(\Rightarrow\) the amount of this occuring depends on \(A(t)\) and \(B(t)\)
           \(\Rightarrow\) The more of \(A(t)\) \(B(t)\), the more that reaction will happen.

    • \(A(t+s) - A(t)\) could increase because of C molecules that break down.
           \(\Rightarrow\) the amount of this occuring depends on \(C(t)\)
           \(\Rightarrow\) The more of \(C(t)\), the more this break down occurs.

    • Thus, in that small time period:
                \(A(t+s) - A(t)\) decreases in proportion to \(A(t) B(t)\) (the product of these concentrations)
                \(A(t+s) - A(t)\) increases in proportion to \(C(t)\)

    • Now, the total amount of change also depends on the length of the time-period, \(s\).
           \(\Rightarrow\) the more \(s\) is, the more the change (because there's more time to allow more reactions).

    • Putting this all together: $$ A(t+s) - A(t) \; \propto \; s (C(t) - A(t)B(t)) $$

  • We could write this as an equation: $$ A(t+s) - A(t) \eql s (C(t) - A(t)B(t)) $$

  • By the same reasoning, $$ B(t+s) - B(t) \eql s (C(t) - A(t)B(t)) $$

  • The change in concentration of C over this small period is different:
    • \(C(t+s) - C(t)\) increases with more \(A(t)\) and more \(B(t)\).
    • And it decreases in proportion to \(C(t)\).
    Thus, $$ C(t+s) - C(t) \eql s (A(t)B(t) - C(t)) $$

  • One small but important modification:
    • It may be that the the forward reaction (A+B → C) is more likely than the reverse.
    • To adjust, we'll introduce multipliers for the two terms.

  • Thus, our revised model is: $$\eqb{ A(t+s) - A(t) & \eql & s \; (K_c C(t) - K_{ab} A(t)B(t)) \\ B(t+s) - B(t) & \eql & s \; (K_c C(t) - K_{ab} A(t)B(t)) \\ C(t+s) - C(t) & \eql & s \; (K_{ab} A(t)B(t) - K_c C(t)) }$$
             
    This way, we can use a high value of the constant \(K_{ab}\) to indicate that the forward reaction is more likely, or happens at a faster rate.

  • Thus, we have a way to calculate the changes in concentrations as we go forward in time. $$\eqb{ A(t+s) & \; \leftarrow \; & A(t) \; + \; s \; (K_c C(t) - K_{ab} A(t)B(t)) \\ B(t+s) & \; \leftarrow \; & B(t) \; + \; s \; (K_c C(t) - K_{ab} A(t)B(t)) \\ C(t+s) & \; \leftarrow \; & C(t) \; + \; s \; (K_{ab} A(t)B(t) - K_c C(t)) }$$

  • How?
    • Suppose we know the starting concentrations at time \(t=0\), that is, we know \(A(0), B(0)\) and \(C(0)\).
    • Suppose, for example, that \(s=0.01, K_{ab}=1.0, K_c=0.5\).
    • We can now compute $$\eqb{ A(0+0.01) \eql A(0) \; + \; 0.01 \; (0.5 C(0) - 1.0 A(0)B(0))\\ B(0+0.01) \eql B(0) \; + \; 0.01 \; (0.5 C(0) - 1.0 A(0)B(0))\\ C(0+0.01) \eql C(0) \; + \; 0.01 \; (1.0 A(0)B(0) - 0.5 C(0)) }$$
 
Exercise 8: Suppose \(s=0.01, K_{ab}=1.0, K_c=0.5\), and \(A(0)=3.0, B(0)=2.0, C(0)=1.5\). Compute the concentrations of \(A(t), B(t), C(t)\) at times \(t=0.01, t=0.02, t=0.03\) as follows:
  • First, calculate \(A(0.01), B(0.01), C(0.01)\).
  • Then, use these values to calculate \(A(0.02), B(0.02), C(0.02)\).
  • Then, use the values at 0.02 to calculate \(A(0.03), B(0.03), C(0.03)\).
 
Exercise 9: Write a Java program to compute concentrations using this model. Start by using this template. Then, modify the code to change the end-time to 1.0. What do you observe as the final concentrations of A, B and C? Plot a graph of how the concentrations change with time, and compare with previous models.
 
Exercise 10: How would one go about writing the code so that it's recursive? That is, our goal is to compute \(A(T), B(T), C(T)\) for some large \(T\), which we could do recursively in terms of \(A(T-s), B(T-s), C(T-s)\), which in turn can computed from \(A(T-2s), B(T-2s), C(T-2s)\) ... etc. Write a recursive version and compare the number of arithmetic operations in the recursive approach vs. the iterative one.
 
How is this simulation (model) different from the others?
  • We have abstracted molecules away:
    • We don't count numbers of molecules.
    • Instead, there's this "quantity" called concentration, defined by a single number.
    • This shouldn't come as a surprise because, even though we modeled individual molecules earlier, the "stats" panel and the plots showed concentrations (one number each for A, B and C).

  • We have abstracted away all randomness:
    • No longer do we worry about how molecules move.
    • The concentrations change deterministically.

  • This is of course a further approximation.

  • Are there benefits to this?
    • It's faster to compute. This works for any number of molecules, including realistic values (trillions, gazillions).
    • It's a simpler model. The code is only a few lines.

  • Any downsides?
    • There are new parameters, which might be hard to measure in practice.
    • There may be something to learn from the detailed molecular level that might be lost in this model.
 
Exercise 11: In general, how accurate should a model be? Consider this Physics experiment:
  • Suppose, from atop a 300-foot building on campus you fix a point on a protruding rod where you can drop a heavy (so that wind won't have an effect) object to observe where it lands on the ground.
  • From that same drop-point, you let down a plumb-line and mark the spot where the plumb line touches the ground.
  • Now you drop the heavy object.
  • You expect the dropped object to hit the marked spot dead on, right?
Discuss with your neighboring students/team, whether:
  1. The object hits the marked spot dead-on.
  2. The object lands a little to the West.
  3. The object lands a little to the East.
  4. The object lands a little to the North.
  5. The object lands a little to the South.
  6. Something else. (What?)
The answer to this question, it turns out, has had tremendous historical significance.
 


4.4   What is a differential equation?

 

Consider our reaction example:

  • Recall how we compute the concentrations evolving over time: $$\eqb{ A(t+s) & \eql & A(t) \; + \; s \; (K_c C(t) - K_{ab} A(t)B(t)) \\ B(t+s) & \eql & B(t) \; + \; s \; (K_c C(t) - K_{ab} A(t)B(t)) \\ C(t+s) & \eql & C(t) \; + \; s \; (K_{ab} A(t)B(t) - K_c C(t)) }$$

  • The form of these equations is
              Next value \(A(t+s)\) = current value \(A(t)\) + \(s \;\times \;\) (some terms involving current values of various variables)

  • Equivalently, the equations specify an iterative algorithm to compute the functions \(A(t), B(t), C(t)\).

  • The fact that we compute in the way time evolves makes this a simulation.
 
Now consider the following:
  • Rearrange the terms in this way: $$\eqb{ \frac{A(t+s) - A(t)}{s} & \eql & K_c C(t) - K_{ab} A(t)B(t) \\ \frac{B(t+s) - B(t)}{s} & \eql & K_c C(t) - K_{ab} A(t)B(t) \\ \frac{C(t+s) - C(t)}{s} & \eql & K_{ab} A(t)B(t) - K_c C(t) }$$

  • This is merely a re-statement that doesn't change anything
              Except: it is no longer suitable for computation.

  • Next, consider the limit as \(s \to 0\):
    • For fixed \(s\), \(\frac{A(t+s) - A(t)}{s} \) is a function.
    • Let's give these a name: Define the function $$A_s(t) = \frac{A(t+s) - A(t)}{s}$$
    • Then the sequence of functions \(A_s\) possibly has a limit as \(s \to 0\).
    • That limit is itself a function.
    • Let's give it a name: \(A^\prime(t)\)
                \(\Rightarrow\) Called the derivative (function) of function \(A(t)\)

  • If we do this for each of \(A(t), B(t), C(t)\), we get $$\eqb{ A^\prime(t) & \eql & K_c C(t) - K_{ab} A(t)B(t) \\ B^\prime(t) & \eql & K_c C(t) - K_{ab} A(t)B(t) \\ C^\prime(t) & \eql & K_{ab} A(t)B(t) - K_c C(t) }$$ Which is sometimes written in slightly different notation as: $$\eqb{ \frac{dA}{dt} & \eql & K_c C(t) - K_{ab} A(t)B(t) \\ \frac{dB}{dt} & \eql & K_c C(t) - K_{ab} A(t)B(t) \\ \frac{dC}{dt} & \eql & K_{ab} A(t)B(t) - K_c C(t) }$$

  • Notice the following:
    • The equations specify complex relationships involving six functions
                \(\Rightarrow\) Three derivative functions in addition to \(A(t), B(t), C(t)\).
    • These relationships are free of \(s\).
                \(\Rightarrow\) We don't have to worry about whether \(s\) is small enough or too small.
    • The left sides are all derivative functions.
    • The right sides are all regular functions.

  • Such a collection of equations is called a system of differential equations.

  • Note: we usually call these Ordinary Differential Equations (ODEs) to distinguish them from other kinds (like partial differential equations).
 
What good are they?
  • In the days without computers, one had to reason about these systems
              \(\Rightarrow\) Recall, limits usually result in simplification (no \(s\) term)

  • ODE's are the basis for analyzing scores of real systems.

  • Some ODE's can be solved analytically.

  • Many more can be analyzed for properties (stability, long-term behavior etc) even if they can't be explicitly solved.

  • There are many powerful existence results that can be proved with great generality.
 
Relationship to computation:
  • Most ODE's are mathematically constructed with finite \(s\) and then taken to the limit

  • But leaving the equations with finite \(s\) gives us an algorithm for solving the system
              \(\Rightarrow\) The Euler algorithm

  • When the free variable \(t\) describes time, we could call this a simulation.
              \(\Rightarrow\) A simulation computes a system evolving over time.

  • Generally, for many systems, the Euler algorithm is sufficient
              \(\Rightarrow\) More accurate algorithms exist (e.g., the Runge-Kutta algorithm)
 


4.5   An unusual "reaction"

 

Consider the Rabbit-Lynx "reaction":

  • Rabbit=prey, lynx=predator

  • Although this is not a chemical reaction, it almost is (mathematically).

  • We will model a population of rabbits and lynxes living in an environment with sufficient grass for the rabbits to thrive. The lynxes, of course, eat the rabbits to thrive.

  • Already, we can sense the proportions involved:
    • The rabbits grow at a certain rate.
    • The rabbits die at a rate, proportional to how many rabbits there are and how many are being devoured by lynxes.
    • The lynxes proliferate based on their consumption of rabbits, and die in numbers proportional to their population.

  • We will model this system:
    • Let $$\eqb{ X(t) & \eql & \mbox{ the number of rabbits at time } t\\ Y(t) & \eql & \mbox{ the number of lynxes at time } t }$$
    • Now consider a particular time interval from \(t\) to \(t+s\):
    • \(X(t+s) - X(t)\) is the change in the number of rabbits.
                \(X(t+s) - X(t)\) will increase from new rabbits born
                \(X(t+s) - X(t)\) will decrease from rabbits dying naturally
                \(X(t+s) - X(t)\) will decrease from rabbits killed by lynxes
                \(X(t+s) - X(t)\) is also proportional to \(s\).
    • Thus, we can write $$ X(t+s) - X(t) \eql s \; (k_1 X - k_2 X Y) $$
    • Similarly, $$ Y(t+s) - Y(t) \eql s \; (k_2 X Y - k_3 Y) $$ because the rabbits that are killed are the ones that "generate" the lynxes.

  • Note: we won't worry about the fact that actual numbers of rabbits are integers, and that \(X(t)\) can take a value like \(0.3\). Assume that we are counting in the "thousands", in which case \(0.3\) makes sense.

  • Now, we don't need anything further (other than the constants \(k_1, k_2, k_3\) to solve this computationally.

  • For illustration, let us write the differential equations: $$\eqb{ X^\prime(t) & \eql & k_1 X - k_2 X Y \\ Y^\prime(t) & \eql & k_2 X Y - k_3 Y }$$
 
Exercise 12: Run the VirtualReactor program and select the "Rabbit-Lynx" model. Use these values: \(X(0)=1.5, Y(0)=1.0, k_1=2.4, k_2=4.2, k_3=5.1, endTime=10\). (Ignore the \(k_4\) parameter.) You should observe something quite interesting.
 
About the Rabbit-Lynx model:
  • We see that there is a natural oscillation in the populations of rabbits and lynxes:
    • The populations don't ever "settle".
    • Oscillation is "built in" to the model.
    • We could hardly have predicted this by staring at the equations or through intuition.

  • The population growth of lynxes lags that of rabbits slightly as intuition would suggest.

  • If we think of rabbits and lynxes as interacting "molecules", the "reactions" could be written as:
              grass + rabbits → 2 rabbits
              rabbits + lynxes → 2 lynxes
              lynxes → dead lynxes       (degradation)

  • This model has been frequently studied, in all kinds of variations, in ecology.

  • The model is called a Lotka-Volterra population model.
 
One wonders: is there a chemical reaction that displays oscillation?
  • Indeed, there is.

  • The B-Z reaction :
    • In 1951, the Russian chemist Belousov discovered a chemical reaction involving citric acid, acidified bromate and ceric ions displayed spectacular oscillations: turning yellow, then colorless, then yellow, in turn.
    • Belousov couldn't publish his result because nobody believed it.
    • Later, a student called Zhabotinsky resurrected the work and convinced others, too late unfortunately for Belousov, who died in 1970 before receiving the prestigious Lenin Prize posthumously in 1980.

  • Type "BZ reaction" in Google to see some pictures of the BZ reaction.

  • The differential equations, after some simplification, turn out to be: $$\eqb{ X^\prime(t) & \eql & q Y(t) - X(t)Y(t) + X(t)(1 - X(t))\\ Y^\prime(t) & \eql & \frac{1}{e} (-q Y(t) - X(t)Y(t) + f Z(t))\\ Z^\prime(t) & \eql & X(t) - Z(t) }$$
    There are three variables, depicting three concentrations.
 


4.6   Even stranger behavior

 

Next, we'll look at a slightly different type of population model:

  • The Ricker model is: $$ x(n+1) \eql r \, x(n) \, e^{-x(n)} $$

  • Here, time is modeled as discrete time steps, where $$ x(n) \eql \mbox{population at step \(n\)} $$

  • There is a growth part modeled on the right by $$ x(n+1) \eql r \, {\bf x(n)} \, e^{-x(n)} $$ and a decline modeled by $$ x(n+1) \eql r \, x(n) \, \bf{ e^{-x(n)}} $$

  • Thus, one might expect the sequence $$ x(1), x(2), x(3), \ldots, $$ to converge to a "stable" population, called an attractor.

  • For each \(r\), it seems plausible that we'll get a different stable population for large enough \(n\).

  • What we'll do:
    • For a given \(r\), run the sequence and compute a histogram of all the \(x(i)\) values obtained.
    • If the sequence does in fact stabilize, we should see a single convergence point show up in the histogram.
    • We'll plot any convergence point that shows up more than once, after ignoring \(x(1),\ldots, x(50)\) (to allow convergence).

  • Thus, we will have a collection of attractor points for any fixed \(r\).

  • We'll plot the attractors for different values of \(r\).
 

Exercise 13: Download and execute RickerModel.java. You will also need DrawTool.java.
 

What do we learn from these examples?

  • A changing system can be mathematically modeled in many ways, the most common of which are:
    • Fully continuous: using differential equations.
    • Fully discrete: for example, Boolean circuits and graphs.
    • Mixed discrete and continuous, as in the Ricker model.
         ⇒ Typically, time is discrete

  • Some systems have attractors or attractor cycles, while others exhibit the phenomenon of chaos.

  • In general, it is very hard to predict the behavior of dynamical systems just by staring at the governing equations.
    • For some parameters, a system might behave "well"
    • For others, one might get wild oscillations or chaos.
 


4.7   More examples

 

Motion along a straight line:

  • Let's revisit InclineSimulator.java:
    	while (true) {
    	    // Update time.
    	    t += delT;
    
                // Increase velocity accordingly.
    	    v = v + delT * a;
    
                // Increase distance according to velocity.
                d = d + delT * v;
    
    	    if (t >= stopTime) {
                    break;
    	    }
    	}
         

  • Note: the straight line, in this case, is along the incline.

  • Clearly, the differential equations are: $$\eqb{ v^\prime(t) & \eql & a\\ d^\prime(t) & \eql & v }$$
 
Exercise 14: Download and execute Missile.java. Examine the code and write down the differential equations. How many variables (functions) are involved?
Next, let's write down the differential equations for the Dubin car:
  • Recall: the Dubin car has two wheels, each of whose angular velocity is separately controlled.

  • Define the following:
              \((x,y)\) = center of the axle between the two wheels.
              \(\omega_L, \omega_R\) = angular velocities of left and right wheels
              \(R\) = radius of wheel
              \(L\) = length of axle
              \(\theta\) = current orientation

  • Consider movement from center at \(C\) to \(C'\) below in a small interval of time \(\Delta t\):

    • The distance \(CC = \half (AA' + BB')\).
    • Consider a small interval of time \(\Delta t\). Then, $$\eqb{ AA^\prime & \eql & \omega_L R \Delta t \\ BB^\prime & \eql & \omega_R R \Delta t }$$

  • Thus, $$\eqb{ x^\prime(t) & \eql & \half R (\omega_L + \omega_R) \cos(\theta)\\ y^\prime(t) & \eql & \half R (\omega_L + \omega_R) \sin(\theta)\\ }$$
    Exercise 15: Why is this true?

  • The only other variable is the orientation \(\theta(t)\)
              \(\Rightarrow\) We need a differential equation \(\theta^\prime(t) = ... \)
    • Consider the case that only the left wheel moves:

    • The distance moved $$AA' \eql \omega_L R \Delta t$$
    • Thus, the angle \(AB-AA'\) is: $$ \Delta\theta \eql \frac{\omega_L R \Delta t}{L} $$
      Exercise 16: Why is this true?

    • Thus, $$ \theta^\prime(t) \eql \frac{\omega_L R}{L} $$
    • In general, with both wheels moving, the rate at which the turn occurs in the clockwise direction is $$ \theta^\prime(t) \eql \frac{(\omega_L - \omega_R) R}{L} $$
 
Exercise 17: Write pseudocode for a Dubin car simulator based on these equations.
 
Exercise 18: What additional equation is needed for an accelerative version of the Dubin car?
 
Exercise 19: Write down the equations for the Simple-Car which has two controls: forward-velocity \(v\) and steering angle \(\phi\). Implement a simulator for the Simple-Car in CarSim. (To draw one, merely draw a circle).
An example with rotational motion:
  • Consider a weight attached to a winch:

  • Define the following variables for the wheel:
              \(R\) = radius of wheel
              \(\tau\) = torque
              \(\theta(t)\) = angular displacement at time \(t\)
              \(\omega(t)\) = angular velocity
              \(\mu(t)\) = angular acceleration
              \(m_w\) = mass of wheel

  • Define the following variables for the cable:
              \(T\) = tension in the cable

  • Define the following variables for the load:
              \(m\) = mass of load
              \(y(t)\) = vertical displacement of load
              \(v(t)\) = vertical velocity of load
              \(a(t)\) = vertical acceleration of load

  • Now apply Newton's laws to each component. Let's start with the wheel:
    • The wheel has torque generated from the winch's motor: \(\tau\)
    • The tension in the cable pulls the other way, and creates a reverse torque of \(TR\)
    • Thus, the difference is what determines the angular motion of the wheel: $$m_w R^2 \mu \eql \tau - TR$$
      Note: we've used moment of inertia (mass analog for angular motion)

  • Now the load:
    • The upward force is the cable's tension: \(T\)
    • The downward force is the weight \(mg\)
    • The difference explains the motion:
                $$ma = T - mg$$

  • What are the differential equations?
    • First, the obvious ones relating acceleration, velocity and displacement for the wheel: $$\eqb{ \omega^\prime(t) & \eql & \mu(t)\\ \theta^\prime(t) & \eql & \omega(t) }$$
    • The same for the load: $$\eqb{ v^\prime(t) & \eql & a(t)\\ y^\prime(t) & \eql & v(t) }$$

  • Observe that \(a(t) = R\mu(t)\)
    Exercise 20: Why?

  • Finally, let's relate these through the tension:
    • From the wheel: $$T \eql \frac{(\tau - m_w R^2 \mu)}{R} $$
    • From the load: $$ T \eql mR\mu - mg $$
    • Equating the two and solving for \(\mu\): $$ \mu \eql \frac{\tau - mgR}{mR^2 + m_w R^2} $$

  • Thus, the equations that describe the system are: $$\eqb{ \mu(t) & \eql & \frac{\tau - mgR}{mR^2 + m_w R^2}\\ \omega^\prime(t) & \eql & \mu(t)\\ \theta^\prime(t) & \eql & \omega(t)\\ y(t) &\eql & R\theta(t) }$$

  • The equations provide a means of computing the values of these variables in a simulation.
 
Exercise 21: Download and examine Winch.java.
  • Identify the code corresponding to the differential equations we derived earlier.
  • Handcode different values of torque to see what value is sufficient to lift the load. Is there a value that will lift the load and yet avert a collision with the winch?
 
Exercise 22: Set isVertical=false in the program and execute. You should see a version without gravity (as if the load were on a frictionless surface). What value of torque is sufficient to pull the load?


© 2008, Rahul Simha