In my spring semester of junior year, I got really into programming since I realized it can be very helpful. My materials lab had us test hundreds of samples of various materials in a tensile tester, and we needed to graph every single test. I figured it would be very difficult, tedious, and time-consuming to do manually in Excel, so I created a few different tools in Matlab to automate the process. Some of those tools are below.
First, the program asks the user to choose a batch of files to use for the stress strain graphs. In this example, I am plotting all the blowtorch tests for 4130 steel together.
The program then asks the user for the cross-sectional areas and original lengths of the samples, which were measured before testing.
Next, the program shows each plot one by one, and asks the user to click 2 points that define the range that will be used to fit a line to in order to calculate the modulus of elasticity.
After the user has gone through every graph, it plots them all together in a clean graph, with the modulus of elasticity for each test displayed on the figure along with a legend so you can tell which curve belongs to which test.
For some materials and safe temperatures, we used an extensometer to get even more accurate reading of displacement. The problem with the extensometer, however, is that not all the data we record is good, since we have to take it off before the sample breaks. This means it is important to only graph what happens before the extensometer is removed. This program is similar to the one above, except it shows the force over time graph first, so the user can see and choose where the extensometer was removed.
Much like the last program, first the user is asked to choose the batch of files from the tensile tester.
What's different about this program, is that it then brings up each tests force over time graph. When the extensometer is taken off, the stretching, or displacement, is paused. This causes a clearly visible sudden change in the graph where the force becomes constant over time. The user clicks right before this change, and the data after the clicked point is ignored.
The program then follows the same process of the last one, asking the user to input areas and lengths, choose region for modulus of elasticity, and then it graphs them all.
The data collected was not always great, so I wanted an easy way to go through all the files and confirm if they were good or bad. I made this program that lets you open a large batch of files and shows each ones stress strain graph individually, assuming certain values for area and original length, as changing these values would mostly just change magnitudes and not the general shape of the graph. If the graph looks good, you click the right side and the file is moved into a "verified" folder. If you click the left side, it keeps the file where it is.
Bad data example, this is where you would click left
Good data example, this is where you would click right
One of our labs included taking lots of pictures of various samples under a microscope. These samples had different compositions of bismuth and tin, and the goal was to use microscope images to be able to guess what composition the samples were based on the images. This was done by turning the contrast of the image up, and then changing the image to a "binary" image, meaning it is only black or white, no gray. Then, the percent that is black is α, the percent white is β. We were supposed to use imageJ for this, but I found the software confusing and slightly tedious, and I knew I could do every sample in the click of a button using Matlab.
Using Matlab's image processing toolbox, I made it so you can select a large batch of files and then it will go through and increase the contrast, switch the image to binary, then count the amount of black pixels and white pixels and turn those into percentages that are shown on the output image. Some examples of the outputs are below.