Archive for Math


Plotting data on videos – A useful way to convey qualitative and quantitive information

flameheight_boxscale_cb_rad1



Every once in a while, someone makes an impression on you that lasts for a lifetime. It sticks with you every single time. This is one of those, although a bit on the nerdy side, it is one that can change the way you present information in a very meaningful way.

I was once sitting at the NIST annual fire conference, going about my business, and someone working on a project regarding the structural response aspect of buildings on fire showed a video in their presentation. No big deal, right? Normally, we get cool fire videos, then some plots, and so on. Sometimes the plots are interesting, sometimes they are default from Excel with the ugly legend and all – with no story to tell.

But not this guy. He showed a video with real-time plots superimposed over the video showing the exact real-time structural response of the structure overlaid on the video in a plot. “AMAZING!” I thought. And it stuck with me. A useful way to convey synchronous information. People love videos, why not tell the qualitative AND quantitative story at the same time?

So I started working in grad. school on fire problems, and naturally, soon thereafter, I was scheduled to give a presentation. As most of my real creative coding and writing work happens of hours between the hours of 1 AM and 6 AM, I wanted to make this happen. I REALLY wanted some real-time plotting action in my presentation. No Excel templates for me! So I stayed up for a couple nights and worked on a way to use MATLAB to make this plotting dream a reality: I worked on importing videos, messing with frame rates, tons of images, and so forth. And soon thereafter, it happened. I had a working script.

I used it to show plots of large-scale fire tests with actual and predicted flame heights vs. time as seen here:

You need to a flashplayer enabled browser to view this YouTube video



And I used the script to show the predicted flame heights on a small-scale test in an amazing way that just about anyone can relate to, fire-crazed scientist or not:

You need to a flashplayer enabled browser to view this YouTube video



From anyone who has seen the videos firsthand, the response has been amazing. This is a great teaching and communication tool, and surprisingly enough, I haven’t found any existing program or tool that does this. And so I am sharing the videos and script here for anyone to use to better convey information.

My next steps are: 1) to convert the script to Python (since I am now almost exclusively using Python+numpy+scipy for my graduate research and daily work instead of MATLAB, and 2) to make the script into a cross-platform and easy to use tool.

I’m providing the code in its raw and uncommented and unedited form. It generates a number of images with plots superimposed on them, and then it is trivial to use a program to stitch them together into a video. I used Quicktime’s built in method. Sorry, too much current work going on finishing my MS thesis and Master’s degree to clean up the code, but it’s a brutal use of the “release early, release often” ideal! Hopefully someone can make some use of it.

So, here are the linked .m files:

http://www.koverholt.com/scripts/ssPlotVideo.m
http://www.koverholt.com/scripts/fireplotVideo.m

Enjoy! And please leave your comments or ideas!

No comment »

Passionate and Artful Communication in Science

So there are scientists, and there are artful scientists. Here’s version 0.9999 of the graph from my last post in all of its full and smooth glory. It’s for a homework exercise in my combustion course (go ahead, click for full size – it’s fantastic):

Well, why do you care about my graph? I certainly do. There are many books about conveying information in statistics and how to present data in a very informationally dense format, sure. But let’s think about this graph that I made for a homework assignment. The purpose of the homework was for me to learn, yes? And that nice orange line bought me some extra credit worth 25 points, but that’s another story. I want to learn it inside out, run it amongst others, and in the end communicate great things to many, many people. Every time. With every action.

So I could have left the default Excel settings for the chart, but my soul cannot allow such a thing.

This graph shows relationships, it runs a conversation with itself and lets the numbers drive by each other and say hello. It’s living, and it talks to me. Check out the dark red diamond line called “Mixture Fraction”. This guy drives all of the others. Then the f’s come in. Then we go back to the real quantities like the mass fraction of oxygen (Yo) and fuel (Yf) and we can also grab temperature (in Kelvin) based off of what those f’s are telling each other.

Yes, yes, Kris. You are talking nonsense, I don’t like it. Well, perhaps I’m not as eloquent and direct as this guy (watch this great motivating video, do I ever let you down?):

You need to a flashplayer enabled browser to view this YouTube video

But our messages are the same. Do what you love, and work your ass off at it. All the time. Not the old and dead cliched way of “do what you love” – but the minute by minute, day by day, just got home tired from work but I need more, but I don’t have the time, wake up and do it, it keeps you up and night, but I want to watch TV every day, what you REALLY want to do, an exact thing/action/pursuit every day until you die – kind of way.

If I wasn’t here loving my graphs at 2:34 AM in the morning and pondering the million things I just learned from this 4 day exercise, I’d quit. If I doubted for a second (as the guy in the video says), I’d do us all a favor and leave here. But I want this knowledge, and these relationships so very badly. And when the end-result comes along, I have a sick urge to spend so much time and detail on things so that others may benefit. Make your life, thoughts, and business public, and see what happens to it. It skyrockets.

Now do you see why I care about my graph? I’m proud of what it represents. Now go off and care about your own graph. For the rest of us.

No comment »

More fire more flames

I just finished the longest problem that I think I’ve ever worked on in my life. It took about 14 hours to complete this one problem in my combustion homework, but damn was it satisfying to finish and solve!


There is a serious amount of knowledge being learned here by all, and it does take time, sure; but it is very satisfying work. I could tell you about all of the above data points and how the mixture fraction of the fuel is a localized and conceptual version of the mass fraction or how the Shvab-Zel’Dovich parameters help to make such analysis possible, but I’ll leave that for you to learn in the combustion class if you take it.

Instead of that kind of talk, I was driven last night to my stove. I often get distracted while reading about fire and start fantasizing of ways that it actually connects to real life – I want to see it. And it just so happened that I was reading about the subject of diffusion flames.

Understandibly, I still have many unanswered questions about the love of my life: fire. Things like why it looks at me how it does with different colors representing how efficient the flame is burning or how much carbon is being produced and thereby how much radiant heat energy is being lost (I’m looking at you, sleek yellowy flame on the left).


So I was led to removing the cover panel on my gas stove last night and equipped only with a wet towel, I wanted some answers right then and there. Long story short, after 30 or so minutes of messing with the disassembled stove at midnight, I had a much better understanding of diffusion vs. premixed flames. For you, just know that there is an amazing amount of philosophy, fire dynamics, and fluid mechanics going on as soon as you turn the knob on your stove to on. Enough there for me to spend my whole life pondering about with passion, even.

In other news, on the opposite of my topic, it is quickly getting cold up here in MA. Tonight it’ll hit around 45 F before the sun peeks around the roof shingles. Life is good. Cool weather, good friends, and lots and lots of dedication to studies. And a bit of fun, come on now.

Well, I’m off for a much needed break. Take over on tackling your passion for me.

Peace.

No comment »

Why Do I Chase Fire? (and video)

Three fire engines and a ladder truck just blared by my house going southbound on the street and stopped about two blocks away. What a beautiful sound of the QO2 siren screaming by on a chilly city night. It takes me back to a few years ago, hearing the fire dispatch alert going out, gearing up in seconds at the station with 45 pounds of firefighter bunker gear, and peeking around each street corner as the truck leaned away from the turn – not knowing if there would be a small car fire or a huge commercial building fire. Terrified people waiting with nobody left to turn to as their family members are endangered by the power of fire. Their life history, photo albums, accomplishments, and material possessions having flames licked at them and could be vaporized into an ashtray within only a minute.

That blaring sound is why I do what I do. And people ask me, why do I like this field so much? Fire is mesmerizing, fire is better understood each day that passes by, but still greatly misunderstood. Fire is extremely useful. Fire is extremely devastating. Fire has context to define its will.

To me, understanding the dynamics of a fire dancing and licking around can be like trying to understand the psychology of billions of different humans. It can be like trying to catch something running away by using differential equations and fluid dynamics. It can be like painting a picture for hours or days and the end product is something that sticks with you every day for the rest of time.

It is like playing on a sports team and working with your family when working in the lab. We work for 3 hours on setting up temperature sensors and calorimeters and even more hours discussing and brainstorming in a room boiling over with a mental flood of science, passion, logic, deduction, and induction. All about fire. Then we burn our creation in 1.73 minutes and forever destroy it, releasing yet another drop in the endless pool of ongoing knowledge.

Here is a video that exhibits a very successful test burn from today. The box is filled with small plastic cups and packed like one that would be shipped. We set up instruments inside to measure the fire size, temperature inside at different places, cameras to record the flame standoff distance, and a ton of other information.

You need to a flashplayer enabled browser to view this YouTube video

I guess in my version of 1984, things make sense in this way: fire is knowledge, community is power, and intuition is freedom.

This is why I do what I do.

No comment »

The Big Move to MA

WPI

Welp, I’ve been accepted to start my M.S. and eventually start my Ph.D. at Worcester Polytechnic Institute this fall! I will be studying fire protection engineering, a continuation of my bachelor’s degree. The school is populated with just under 4,000 students and it is a private engineering school. Not only does this school house one of the top fire protection engineering programs in the US, but the faculty and their work align closely with my values and passions in life.

The big move will look something like this in 8 weeks:


Some cool info about the school includes the fact that Robert Goddard went there and graduated in 1908 – he was the gradnfather of modern rocketry with the first liquid fueled rocket. Also, the fire protection engineering department has about 150 masters of science students and 4 (!) doctoral students. This is quite the opportunity I smell.

What I did during the summer of 2008

So far this summer I’m being funded by UHD as a last request to make a catalog of fire models for various textbooks. The work is very refreshing and I love to work when I learn much more than I expected. :) Another cool side effect of this work is that I can include the FDS models and example writeups on my website, free for anyone else in the world to see and learn from. The technical writeup is located here and it gets updated automatically anytime I change a single word in there. Eventually it will have links to FDS files for FDS users and students around the world to download and use on their own – I love technology.

FDS MESH Size Calculator tool

Finally, to finish off a nice post about fire protection engineering and FDS: I updated my FDS Mesh Size calculator on my other website to include some awesome and never-before-done functionality! It now takes in x, y, and z dimensions and an expected heat release rate and gives the user three MESH lines (coarse, moderate, and fine) to guide them on making an FDS file that has an adequately resolved MESH.

The tool can be found here on my FDS/sciency website and the nice folks at NIST gave me a link on their third-party tools page of the FDS website: http://fire.nist.gov/fds/thirdparty.html

—–

I know I post out-there stuff like this on my blog here sometimes, but this is what is on my mind and taking up my mental cycles and daily days. Jump in and read the linked pages or play with the tools of my creation!

No comment »

18 minutes with an agile mind – video

Ok, I think I just found a new role model in the teeming world of science. I realize that every day I learn feel closer and closer to the mind of this man that I have just discovered. Watch this 18 minutes of video, and I think you will enjoy it very much. He is an eccentric man, yes, but listen. His words and final thoughts are aligned with the subtitle of my blog, “Communicating the greatest possible growth”.

Stuff like this gives me a warm feeling of why I am so attracted to the fields of science that I am. Something tells me that this man doesn’t fret too much about the trivial stuff that we sometimes get trapped up in day to day. Click on the picture to watch. Enjoy.

tedastron.jpg
http://www.geeksaresexy.net/2008/04/09/must-watch-18-minutes-with-an-agile-mind/

By the way, watch out for loose gravel! – I wiped out on my motorcycle gracefully right at this spot near UHD. Everything is okay with me minus a brake pedal that needs to be bent back into shape and a slightly bent handlebar that with bother my OCD.


View Larger Map

No comment »

Mac-Corrected Numerical Analysis Fortran Programs

I am taking a numerical methods course and using the textbook Numerical Analysis 8th edition by Burden and Faires:

Numerical Analysis

The book is good and has nice pseudocode examples throughout. It also has a companion website with all of the algorithms programmed in C, FORTRAN, Pascal, Maple, MATLAB, and Mathematica. For our assignments, we can use any program that we want, and I have been using MATLAB, FORTRAN, and Python as those make the most sense to me thus far in my computing experiences and are the most useful for my work.

However, the FORTRAN 77 programs on the website are programmed in such a way that they only work when using a FORTRAN compiler in Windows. At this time, my primary machine is an Apple Macbook Pro laptop, and I am using the Intel Fortran Compiler version 10.1 on OS X Leopard. When I try to compile the programs from the textbook website, I get errors. So, I went ahead and fixed the files so that they would work on with the Intel compiler on the Mac, and hopefully Linux as well.

The two problems were that:

a) The programs were trying to read and write to ‘CON’, which is a Windows specific way of writing to the command window console.

b) The programs had an extra line at the end and would crash the Intel compiler.

So, I fixed these errors in all of the programs and you can download the corrected files in .zip format from me and follow the instructions below to compile.

The original files are freely available from the author’s website here

Step 1: Download the above linked zip file of the corrected FORTRAN 77 programs

Step 2: Unzip the FORTRAN files. You will find several files with the .FOR extension.

Step 3: Run the Intel FORTRAN compiler using the command: ifort -f77rtl -o <outputname> inputfilename.
For example, to compile example 12.1: ifort -f77rtl -o alg121 ALG121.FOR.

Step 4: Make the output file executable with: chmod +x alg121

Step 5: Run the file with ./alg121

Step 6: Be sure to answer the first Y/N question with the y or n character in quotes, such as “y” or “n”

Step 7: Have fun learning numerical methods and dissecting the FORTRAN programs!

No comment »