Thursday, November 11, 2010

On why I love modelling...

Howdy there sports fans!  =)

I am pleased to report that I have had some great success with a long-time project of mine.  I have simulated a very rough approximation of a tree under forced oscillation!  This is something that I have been pondering how to do for about 10 years...  Boy, to write that down makes it seem, well, like a long time.  First, a little backstory...

A few years into college I began mathematically modeling the shaker head that ENE uses for harvesting prunes, pistachios, etc.  After making a few assumptions and idealizations, tt was a relatively simple set of parametric equations, and served as a wonderful application and exercise of the concepts in calculus that I was learning at the time.  Essentially, those equations parameterize the configuration of the shaker head and predict the output pattern.  With a bit of doing (and a few major mistakes in derivation), I had a reasonable, closed-form approximation of how the shaker head would react to different weights, speeds and arm lengths. 

Below is a plot of the predicted output pattern for the configuration
freq1=10 Hz, freq2=7.14 Hz, arm1=2.5 in, arm2=3.5 in, weight1=40 lbs, weight2=30 lbs.
For a while, I was very enthralled by this set of equations and what they might mean for tuning and understanding harveting better, but I soon realized that the real problem was not what the shaker head was doing, but rather how the tree was responding to what the shaker head was doing.  In short, it is necessary to understand the behavior of the shaker head, but only from the standpoint of guiding it into a behavior that is useful for successfully shaking a tree (e.g. getting fruit off, not damaing the tree, etc, etc.).

Since the orginal equations were derived symbolically they are easy to calculate and easy to analyze, but I could not wrap my head around a good method to symbolically model a tree.  As I progressed through my schooling and various work projects, I spent more and more time in numerical simulations (mostly Finite Element Analysis-type (FEA) and dynamical systems (for control system engineering).  It has taken me a long time to realize that the answer to my problem could be approached in a numerical way, but even after I realized that, I wasn't sure the right software package to use to tackle the problem.

****************   so much for the back-story...  on to the present   *****************

Since while I'm here in Santa Clara, I decided that it was the right time to go to a workshop for a software package called COMSOL Multiphysics.  They have an office in Palo Alto which is only a few minutes from work, so it all worked out beautifully.  My cousin scott was nice enough to come along for moral support and may have just enjoyed himself a little along the way...  =)  As part of the workshop, we recieved a trial license for the software which is a great match for my brand-spankin' new computer...  =)

So that was this Tuesday, and for the past two nights I have spent a few hours trying to figure out how to model a tree and simulate it in a flexible way.  This evening I finally had success and thought it would be fitting to share the results of my labor with you.  Below is a very simple tree's response to the input of the shaker head (given the same configuration as listed above).  Hopefully this video uploads correctly... it took a long time, so I'm not sure if everything got to the server ok...



That is pretty cool I think.  The coolest part about this might be that the solve only took about 2 minutes!  Granted, when I have a tree model that is sufficiently more complicated and takes into account more effects (Such as the damping due to leaves, etc.) that solve will take longer, but this was a simple example and it solved very quickly. 

Another quick little video which breezes through the first 50 (or so) eigen-frequencies and eigen-mode shapes (the natural frequencies and vibration modes of the tree structure).  I would slow this down a bit, but the slowest I could do was 1 frame per second, so just check out the frequencies listed in the upper portion of the screen to get a feel of the frequencies that are causing the shapes...


On top of that, I found the COMSOL environment to be very well thought out and even capable of some post processing tasks that didn't need to go over to MATLAB to handle... namely looking at the pattern input that caused this type of purturbation...  I know what you're thinking, you're thinking, "Hey Gav, hang on.  Just a few paragraphs ago you said that you had closed-form equations that could predict the shaker heads position (and thus the pattern input to the tree)..."  to which I respond, "Yes, that's true, but remember my qualification: "After making a few assumptions and idealizations..."  The first assumption was that the shaker head was "free" and not being affected by anything else.  That isn't quite true, because while the shaker head is big and powerful, it is still affected by the tree...  remember, we can push on the tree, but the tree can push back!  So, without futher ado, I give you thee updated pattern that my simulation yielded after taking into account the tree's "push" back on the shaker head...

There are a few things that need be said here...  first of all, you have to look closely to find that it does have many of the same characteristics of the idealized patter, but the idealizations might have been a bit too much from a rough accuracy standpoint.  Note that I didn't include any mass for the shaker head, so this isn't as accurate as it could be.  Also notice that the new pattern output is not as wide as it is tall...  this I believe to be due to the trees asymmetrical response (which in turn is due to it's asymmetrical topology)..  What we found here was that it was much easier to move the tree in and out vs. moving it left and right, which might make sense when you stop and look at where the branches are on this tree...  =) 

Man I love modelling!

*********
On a more peronsal note, I am doing well and things are moving forward with my thesis.  Slowly but surely.  I will post again soon with more personal things, but I better get some sleep tonight!

Thanks for reading!  =)