I've been playing around with AngularJS, flask and python in order to host a script that I wrote in python. Basically converting decimals into US fractions for measurements is a bit of a pain if you're doing it on paper and calculators don't convert to fractions unless you have the exact number. But if you have the exact number you'll likely remember the corresponding fraction anyway! So for everyday irregular numbers, feel free to use my calculator.
Shorter link for sharing: http://goo.gl/U7b2pO
Example 1: Convert 1.25 into a fraction
Too easy, 0.25 is easily remembered as one quarter or 1/4, so the answer is 1 1/4. No need for any special calculators.
Example 2: Convert 1.544 into a fraction
This one is more interesting, and does not give a round remainder with fractions that have a denominator that is a multiple of 2. If you can live with a remainder of 0.044 then you can say that this equals 1 1/2. If you've memorized the 1/16 series of fractions, you might pick 1.5625 and have a smaller remainder. For even more precision you'd have to use an algorithm to find the closer answer. Using the above linked calculator the answer is 1 35/64 with a remainder of 0.002875.
It should be stated that it is important to notify your rounding method to whoever is using any raw numbers coming off of computer output. For myself the example was precision steel fabrication, and decimals were preferred as they were input into a CNC machine. Using fractions would have introduced unnecessary errors. However for numbers that need to be measured by an operator, fractions were used for convenience.
Civil Life
Wednesday, 3 September 2014
Sunday, 9 March 2014
1D Cutting Stock Optimization
I've made a GWT app that calculates an optimum solution for one dimensional cutting of lengths of bars. It is a pretty simple implementation, in fact the algorithm used is the most naive possible. The algorithm itself is a fun one to study, and there are some interesting ones out there that solve the problem. Later I hope to include 2D plate cuts as those are harder to solve on paper, especially if there is a saw thickness.
This came in handy recently where I needed to purchase set lengths of steel sections, and I've changed the dimensions in places to avoid purchasing 20 feet of bar and using about 4 feet of it and wasting the rest. With "small" orders such as that for my current project, the price can jump about quite a bit for this reason so even just one analysis of what lengths to purchase would influence the price to a significant extent.
Find it here.
This came in handy recently where I needed to purchase set lengths of steel sections, and I've changed the dimensions in places to avoid purchasing 20 feet of bar and using about 4 feet of it and wasting the rest. With "small" orders such as that for my current project, the price can jump about quite a bit for this reason so even just one analysis of what lengths to purchase would influence the price to a significant extent.
Find it here.
Hello World!
This is my first blog post. I am a doctoral student in Civil Engineering, and I like figuring out the way things work. My project is a study on the way steel frames behave in earthquakes. It is great in terms of getting exposed to a range of problem solving techniques, including but not limited to: Finite Element Modelling (continuum and stick models), 3D Computer Models (in place of 2D drawings), automation of design calculations.
Besides Civil Engineering, I do enjoy programming quite a bit. It is a bit of a hammer looking for a nail sometimes though; at times two pages of calculations with a pencil are plenty sufficient. Other times, there is so much repetition and rigid rules that it simply makes more sense to program some subroutines.
The point of this blog is more for me to formally complete and publish any personal projects I like to play around with. They may or may not always have something to do with Civil, but I do hope any calculators or write ups of past experiences are of use to someone.
I'll keep this updated from time to time when I create something of interest, generally as I complete my PhD tasks, some things that I wish I had known before starting become apparent and these stubs of knowledge might be of interest.
This is my first blog post. I am a doctoral student in Civil Engineering, and I like figuring out the way things work. My project is a study on the way steel frames behave in earthquakes. It is great in terms of getting exposed to a range of problem solving techniques, including but not limited to: Finite Element Modelling (continuum and stick models), 3D Computer Models (in place of 2D drawings), automation of design calculations.
Besides Civil Engineering, I do enjoy programming quite a bit. It is a bit of a hammer looking for a nail sometimes though; at times two pages of calculations with a pencil are plenty sufficient. Other times, there is so much repetition and rigid rules that it simply makes more sense to program some subroutines.
The point of this blog is more for me to formally complete and publish any personal projects I like to play around with. They may or may not always have something to do with Civil, but I do hope any calculators or write ups of past experiences are of use to someone.
I'll keep this updated from time to time when I create something of interest, generally as I complete my PhD tasks, some things that I wish I had known before starting become apparent and these stubs of knowledge might be of interest.
Subscribe to:
Posts (Atom)