Saturday, October 29, 2016

Cantilever beam finite element analysis using open source software

     In this video I'm modeling, meshing and computing a cantilever beam using open source software. For the model and mesh, I've used Salome7, and the finite element computations were carried out with Calculix. This is meant to be an practical introductory video to free fea software. Theres an insane amount of theoretical books about this subject out there, take a look on them before designing your own cranes (LoL). 



The code for the calculix input deck:

Cheers!

Friday, October 28, 2016

Plotting Beam Diagrams with Python

     Today I'm sharing how to plot Beam Diagrams using python. More specifically the code is about a cantilever beam subjected to gravity load, a special case of uniformly distributed load. There's a bunch of cool python features in this post, like the very convenient use of "x>" to evaluate a function, or part of it, only after a specified value in the array.

For example, the code: (my blog font shows this symbol =, as equals, this is a minus -)

import numpy as np
x=np.linspace(1,10,10)
y=2*x*(x>5)
print x
print y

returns these two arrays.

[  1.   2.   3.   4.   5.   6.   7.     8.   9.    10.]
[  0.   0.   0.   0.   0.  12.  14.  16.  18.    20.]

     Values with "false" boolean condition returned 0, and the values with "true" condition were evaluated. This is very useful when computing singularities functions, also known as Macaulay method, due to the British mathematician William Herrick Macaulay.  Oddly this method was first proposed by the German mathematician Alfred Clebsch. 

    Other features that worth take a look is how to make very neat plots using matplotlib subplots method.

The code:



The plot:


See ya!

Monday, September 19, 2016

Running old C 'Marv Klotz' programs in Linux

      In a video about springs in youtube channel "this old tony" he recommends (at 4:35) a program that calculates mandrel sizes to make springs. The suggested program is written by Marv Klotz, and can be found in 


      Looking at Marv Klotz website I found a lot of interesting programs that can help in the shop. The drawback is that the programs runs in 32bit DOS. 
      Now, Is this a big problem ? Well, not a all. To run the programs in Ubuntu linux is pretty easy. 

First open the terminal ( Crtl + Alt + T ), then type: 

sudo apt-get install dosbox

      Put your password, and you'll install a DOS emulator in your computer. Now lets suppose you want to run the "bend" program, and you've downloaded and extracted it into the "download" folder.  With DOSbox  application open, type:

mount c /home/user/downloads

and then, 

c: 

        Know you have a virtual c: drive in downloads folder, in wich you can run the program typing the *.exe name, in the case of the example, BEND. 
        A final note: user is your computer name. As you can see in the print screen, using my computer as example, I've typed "mount c /home/eddie/downloads" 


Finally, a print screen of the BEND program running: 



Tuesday, September 13, 2016

Testing Fusion 360 - A Wine Rack

     At the moment I'm moving to switzerland and It's been a long time (3 months) without my desktop computer. The laptop computer I'm using runs windows, so, as always, I'm trying design softwares that fit the operational system and my tastes.
     This time I did some testing in autodesk fusion 360. I found it to be friendly, from the interface, to being free for low budget engineers. I like the team project features and the work versioning. The drawbacks is that I found it to be slow. At least in my computer the screen is always freezing for some time, which is annoying. 
     Veridict: It's cool, mainly if you're going to do some teamwork.


The simple project I did to test the software: A wood wine rack.


Of course I needed to bring this to real life. Not that hard, but not that easy with just a $10 saw, and a rock as a hammer. 

     Final word: I still prefer some opensource CAD programs out there. 
     I still need to test drive Onshape, though. I really think this cloud plataform is promissing, because we can use it in windows or linux both, and besides, it has teamwork features as well.  

Friday, July 15, 2016

Car, motorcycle and bicycle energy comparison graph using Matplotlib

     Everytime I met bike enthusiasts there's a lot of fuss about the bicycle being more efficient than cars and motorcycles. So I thought in making a graph comparing cars, motorcycles and bicycles . Of course here Is shown a mechanical stand point about the subject.

     The simplest energy equilibrium equation goes like this:



     F_t is the traction force 
     F_r is the resistance force
     F_i is the inertial force
     F_a is the aerodynamic drag force
     F_r is the rolling resistance force
     F_g is the gravitational force
     V is speed

     The power that makes the vehicle goes forward equals the speed times the its traction power. That power has to overcame the resistance forces in the opposite direction of the traction. 
     The resistance forces can be model as, inertial forces, aerodynamic drag forces, rolling resistance forces, and gravity resistance forces.  Roughly the inertial force deals with speed variations, the aerodynamic drag is the drag imposed by the air, the rolling resistance is deals with the mechanical friction between parts and the gravitational forces is the tangential forces caused by gravity, helping you in downhill, and making your life harder in hillclimbs. Mathematically they can be written as bellow. 



      C_d is a dimensionless parameter called drag coefficient.


     C_r is a dimensionless paramenter called coefficient of rolling resistance.


      I is the steepness of the hill (rise/run)

      To plot the graph I'm using an amazing python library called matplotlib. See the script.

    
     And here is the graph plotted:


     One final word, a very cool site doing an interactive version of this calculations only for bike) can by found in Mr. Steve Gribble website.


Once again, thanks for reading. 

Eddie. 

Friday, July 8, 2016

Pressure vessel FEA using Calculix and Salome 7 - Part 3 (Simulation)

In the last part of the Calculix + Salome 7 FEA, I've shown how to run a Calculix ccx Input deck.

The video:


The code:

Thanks !

Eddie

Friday, June 24, 2016

Pressure vessel Finite Element Analysis using Calculix and Salome 7 - Part 2 (Mesh)

     In the part 2 (of 3), I've shown how I made the mesh for the finite element analysis of the can using Salome 7 software. One of the problems we face using Salome+Calculix is that Salome7 don't export the mesh in *.inp format needed for calculix. Our solution to the problem is to export the mesh in *.unv and convert it using a python script. 


     More information on these extension conversion scripts can be found in the following sites:


     Or you can download the one that I already fixed here (.tar.gz) or here (.zip).