Skip to main content

Posts

Showing posts with the label engineering

Arduino map function decimal places (floating point numbers)

The programming library available with the Arduino has an interesting interpolation function, the  map  function. Sadly, it returns only integers. As you might want to interpolate floating point numbers for some instrumentation routines, this limitation with integers may lend you to some low-resolution results. Fortunately, Arduino supports method overloading, and we can rewrite another  map  function to support floating point numbers. The new  map  function could be like this: float map(int x, double in_min, double in_max, double out_min, double out_max){  return (float)(x - in_min) * (out_max - out_min) / (float)(in_max - in_min) + out_min; }

CAD Tutorials

The Mechanical Engineering Department from the Carnigie Mellon University has placed some good tutorials on how to use the PTC Pro/Engineer CAD software . It is an excellent material and is based on Pro/Engineer Wildfire 3, the last one with a Linux version. It also includes Sheet Metal and Surfaces design and Finite Element Analisys using the Pro/Mechanica module.

Numerical Linear Algebra Packages on Linux

As a control engineer, I am always needing to use some numerical linear algebra software, usually Matlab or GNU Octave, but now that I have to write some C code using MPI for solving some linear algebra problems. There are some software packages for that so. Jochen Voss has a nice tutorial on BLAS and LAPACK at http://seehuhn.de/pages/linear I was also googling around looking for something on sparse matrix with C. I've found this thread at a forum: http://forums.aspfree.com/programming-help-33/c-initializing-a-sparse-matrix-236415.html

Engineer Honoris Causa

We always think of an engineer as a guy who has a college degree. But, in the case o William Kamkwamba , who build an windmill from scrap in his village on Malawi (Africa) we just got back to what really powers engineering: Inspiration, Motivation, Information and Dedication. He had the Information available at a library, on how a windmill works, he had the Inspiration to see the windmill would fulfill the necessity of electric power his village had and those factors gave him the Motivation and with Dedication he did accomplish his windmill. William Kamkwamba spoke at TED And has a blog now . This is a good example of a talented engineer. College degrees give us Information , but if we don't have the Inspiration , Motivation and Dedication , we will never be a real engineer. The College degree also legitimates the engineer but in William's case, his windmill legitimates his engineering skills.

PHP + GNU Octave to build a web based pump dimensioning system

During my undergrad studies, when I was doing the fluid dynamics class, we had to dimension pumping systems. The work involved in doing that used to be laborious, many coefficients, constants, etc, and we had to use only our scientific calculators. To check our answers when in home, everybody used to wrote their own spreadsheet. As a FLOSS enthusiast and long time PHP programmer, I decided to write a web based pump dimensioning system. As we calculated the fluid density depending on watter temperature, and we had used small numbers (E-5) which lead to underflow errors when the calculations were did using only PHP statements. In other hand, when using GNU Octave, the precision was great and things were much easy, because I didn't really needed to care about precision, was just type the calculations, press enter and get the right answer. So I wrote a PHP function that calls the exec command to run GNU Octave and get back the Octave output into one PHP variable. That way I got all cal...