UMBA 2.0

Click here for the GitHub link This new version contains a model for the seam shifted wake. Before I get into it I want to make a couple of things clear. First, there is a quote from statistician George E.P. Box, “All models are wrong but some are useful.” I hope that this one is useful but I know it is not perfect. Second, we are still very early in the discovery of the behavior of the SSW. I think we have a good idea about what is happening but a lot of testing and revising (especially pertaining to gyro) needs to be done before I would say this tool is definitely always accurate. Third, fluid/aerodynamics is difficult. Fundamental equations that can tell us the end if we know the beginning are almost always impossible to solve. When they are solvable they require an insane amount of computing power. Instead, we often use approximations and statistical approaches to get near a useful answer. The point is, while I believe these results show that we are on the right path, it’s not perfect. The goal moving forward for Barton’s lab (and hopefully others as well) is to get the margin of error as small as possible. One last caveat. I am an engineer, not a computer scientist, and am self-taught on Python. I am, however, interested in making the code more elegant, efficient, simple, and versatile. So, if you look through it and see a better way of doing things please let me know. The addition of the SSW model is the most significant part of this update. It works in a similar fashion to the lift and drag models that are already in the code. The implementation of the model is a bit different. The first step was identifying which seams are active seams at any given moment. Active seams are any seams that are causing boundary layer separation at the seam. This is non-trivial. Much of the work we have done over the last two years is precisely that. In fact, the modeling I’ve done of the SSW effect so far would not be possible without the data we’ve collected. Seams only cause early separation in a specific region and under specific circumstances. There still remains plenty of work to nail down every case for which this could happen. Active seams only occur in the area around the hemisphere plane. The hemisphere plane is perpendicular to the velocity of the ball and goes through the center of the ball. In other words, the hemisphere plane passes through all the points of the ball where the air moves parallel to the surface of the ball. The hemisphere plane is not fixed but moves based on the current trajectory of the ball. This is important because the SSW effect may become more or less strong as the ball changes direction.
Video 1. In this view from the side the hemisphere plane (green line) adjusts to be perpendicular to the velocity (blue arrow). This case shows the movement of the hemisphere plane as the ball’s velocity changes from flying horizontal and begins to sink.
The region where seams matter relative to the hemisphere plane is shown below. A seam in the green area is “active”. For the sake of the simulation, I created a volume that extends from the hemisphere plane both forward and back to contain the green area all around the ball. Note that we have anecdotal evidence that the plane slants in the direction of spin if the ball is spinning on an axis sticking out of the page.
Once the active seams are identified, the effect the seams would have on the ball is determined. The goal is to reproduce the results from post 49 and post 45. That goal can be achieved by varying several different parameters (knobs). These parameters are:
  • The locations where seams can cause early separation
    • Size of the volume in which the seam can cause early separation
    • Location (front to back) of the area in which the seam can cause early separation
    • The slant of the area in which the seam can cause early separation due to spin
  • Strength of the force from a seam causing separation (similar to a coefficient of lift)
While I say that these are parameters that can change, you may ask (if you’ve been paying attention), “don’t you know where the separation is occurring?” The answer is yes, we do know. The problem is that the effect the location has on the strength of the force is unknown. So, for simplicity, we assumed a uniform force (for this iteration of the model) and an volume somewhat smaller than the volume where seam separation can occur. The locations where seams can cause early separation is something that, with additional study, we can nail down. The strength of the force from a seam is calculated using a coefficient of seams similar to a coefficient of lift or drag. I looked at several different options for how to implement this force but settled on treating every seam that is activated like a little wing. There are several things that I will test to see if they improve results. First, I will make the strength of the force to vary with seam position up or downstream on the ball (seams at or in front of the hemisphere line likely play a much bigger role than those further back). Second, messing with the implementation of the force. There are a lot of options for how to do it and I’d like to find out which is best. I also added seams to the code. Obviously, if we’re looking at SSW than we need to know where the seams are. I created seams using the information on this site and display plots of the seam locations periodically over a single rotation to ensure that the ball is oriented and spinning the way you want. This requires two additional inputs. Explanations of these inputs can be found in post 51 and at this site. We are, for lack of a better name, calling the angles that describe seam orientation, Y-angle and Z-angle (these translate to Top and Front respectively on the TexasLeaguers site). Figure 2 shows the output of the seams.
Figure 2. Red dots show regular seams, green dots show activated seams where flow separation is occurring. The blue line shows the spin axis and the black arrow shows the velocity direction
I am very interested in hearing how this matches up with any of your personal experiences. We have a few pitchers and coaches that have seen it in some of their pitches and it is exciting to see the SSW effect in action. If you think you have one of these pitches please let us know and tell us if they match what the simulator predicts. Lastly, I added a new way of inputting the data into the simulator. The new script is called the NQ stands for no questions. UMBANQ is nice because you can run a list of conditions all in rapid succession or a single case without having to go through all the questions. The code could be run as is shown in figure 2 to test a range of efficiencies, as shown in figure 3 to test a range of Z-angle variations, or as shown in figure 4 to run one case.
Figure 2. An example of how to run the code to look at 4 different efficiencies
Figure 3. An example of how to run the code to look at 4 different Z-angle variations
Figure 4. An example of how to run the code for a single case
To run the code you must download the and files along with or Once the files are downloaded simply follow the instructions in or I am running all my code on Anaconda’s Spyder app which has all the libraries I use built in. If you are new to coding I would recommend also using Spyder. Otherwise, you probably know more about it than I do. Figures 5, 6, and 7 show the results of a pitch with the same speed, spin rate, spin direction, release conditions but with a varying orientation in the z-angle. With a normal Magnus-based model these pitches all end at the same point. However, with the SSW model built-in, you can see results that match those of our experimentation (see post 49).
Figure 5 shows the top down view of three pitches with only the seam orientation changing
Figure 6. The catcher’s perspective of three pitches with only the seam orientation changing
Figure 7. the side view of three pitches with only the seam orientation changing

Related Post

5 thoughts on “UMBA 2.0

  1. Hi Andrew,

    Hope all is well. I’m reaching out because I am having trouble recreating your visuals at the bottom of this page:

    I believe I am using the same parameters, but for whatever reason, getting different results. I keep getting that -38 and 38 both have greater horizontal break than 0, but I believe I should be getting 38 as having less horizontal break than 0. Am I doing something wrong? Thanks for the help! See below for my inputs:

    variable = [-38,0,38]
    iters = len(variable)
    for i in range(iters):
    print(i, ‘out of ‘,iters)

    x = 0 #initial x location ft
    y = 6 #initial y location ft
    z = 6 #initial z location ft
    v = 90 #initial velocity mph
    vRelAng = -0 #initial vertical release angle deg
    hRelAng = 0.0 #initial horizaontal release angle deg
    rpm = 1200 #initial spin rate
    tHrs = 3 #initial Tilt in hours
    tMin = 0 #initial tilt mins
    eff = 100 #efficiency as a percentage
    Yang = 0 #initial seam orientation y angle
    Zang = variable[i] #initial seam orientation z angle
    LorR = ‘r’ #if efficiency is less than 100% which poll should be forward l or r
    seamsOn = True
    FullRot = False

    1. Zach,
      Thanks for reaching out. You are not doing anything wrong. I made some changes to the code to try and line it up with some results we’ve been seeing. This makes is so the plots you’ll get now are different than the ones I originally posted.

      1. Thanks for the quick response. So even when shifting between the bottom and top loop (-38, 38 orientation), both have more horizontal break than with a 0 orientation? Rather than the original example when one of them actually resulted in less horizontal break?

        1. This is probably a bad result and is an example of the imperfectness of the model at this stage. A lot of research still needs to be done to really identify how the system works and what the mathematical models should be.

Leave a Reply