Friday, January 14, 2011

Simulating heat conduction using Scilab

Heat conduction is one of the simplest physical phenomena to simulate as it simply depends on the diffusion equation. I wrote a simple Scilab code that simulates the heat conduction process from a square block using the finite difference method for the spatial discretization and forward Euler (explicit) method for time integration. The code is going to show you how Scilab can be used for simulation and visualization.



  And here you are the code (tested and worked)


//Scilab code for simulating heat conduction to a square block
//Time step
dt=0.05;

//Ambient temperature
T_amb=100;     //degrees in Celcius

//Creat an empty matrix of the temperature
T=[];

//Lower boundary
for i=1:20,
T(i,1)=T_amb;
end

//Upper boundary
for i=1:20,
T(i,20)=T_amb;
end

//left boundary
for j=1:20,
T(1,j)=T_amb;
end

//right boundary
for j=1:20,
T(20,j)=T_amb;
end

for i=2:19,
for j=2:19,
T(i,j)=20;     //Initial condition
end
end

x=1:20;
y=1:20;

show_window(); clf()
f=gcf();
f.color_map=jetcolormap(256);
f.pixmap='on';

colorbar(0,100);
T_new=T;  //use this line to copy boundaries
for counter=1:60,
T=T_new;
for i=2:19,
for j=2:19,
T_new(i,j)=dt*(T(i-1,j)+T(i+1,j)+T(i,j-1)+T(i,j+1)-4*T(i,j))+T(i,j);
end
end
z=T_new;
Sgrayplot(x,y,z, strf="042",rect=[-5 2 25 40], zminmax=[0,100])
show_pixmap();
end

New Curie effect heat engine

I searched a lot for a Curie effect heat engine and found simple layouts that actually can not be called heat engines but toys. I thought about a Curie effect rotational heat engine (not oscillating) and got this result (see figure below). One of the most important features of this engine that it can be driven using concentrated solar energy and so the rotation of the rotor is not going to affect the heat source (like that in the case of using candles).



One important note is when using candles or flames for driving the Curie effect heat engine the magnet itself is going to be affected. Also, the ferromagnetic material used in the engine should have low specific heat and low Curie temperature. I tried to make this engine using a bottle cap and some twist ties and the engine revolved but due to some inaccuracies it did not work later. Also, I faced a problem that we did not have here in Egypt Neodymium magnets. I hope that anyone will use this method will refer to me first (contact me via email).

A method for reversing rotational direction using belts

The following method can be used for reversing rotational direction without using simple gear train (in fact I hate gears as they are costly and require lubrication). I don't think that this method has (or will have) an application, but I expect it may be used in robotic applications where small torques are exist. This method is not going to use the conventional belts but it uses a belt which I call "double-V" belt. The following figures show how to do so.



And the belt is going to be like the following

Sunday, January 9, 2011

Magnetic levitation

Magnetic levitation is an alternative for thrust bearing. That means it counters the axial loads. Very accurate and well-adjusted magnets should be used.
Magnets are mounted on the shaft which is highly polished [fine turning] with a sliding fit with very small clearance. One of the magnets should be fixed in the housing.
Usually magnetic levitation uses [depends on] the repulsion forces between magnets because magnets will not come in contact unless the load is too much.
Magnetic levitation also can use attraction forces between magnets but it has several problems:
v  At low loads, the magnets can come in contact to each other if the load is not quite enough to separate them
v  At high loads, the magnets will be far away from each other which means no magnetic interaction between them
v  It requires both magnets to be fixed, one fixed on the shaft and the other to be fixed in the housing



Generating sine wave tone using Scilab

Scilab is a powerful numerical software. It has different sound handling functions. The following code (as a demonstration) can generate a sine wave tone with different parameters that can be controlled (frequency, tone length, and amplitude). The code also enables you to save the sound file as a wave file.
As a concept, you can also use Scilab to generate noise waves like saw tooth, step, impulse, etc. and then you can say bye bye to all tone generator software.

Here you are the code

//Generating sine wave tone toolbox

txt=['Length in seconds';'Frequency';'Amplitude'];
parameters=x_mdialog('Enter wave properties',txt,['10';'10000';'1']);
frequency=evstr(parameters(2));     //tone frequency
size_x=frequency*evstr(parameters(1));     //number of bits
A=evstr(parameters(3));     //Wave amplitude
x=1:size_x;
y=A*[sin(x);sin(x)];     //sine wave for both left and right channels
file_save=uiputfile("*.wav");     //Saving the wave file
wavwrite(y,frequency, 8,file_save+'.wav')     //Writing the wave file
disp('done')

And this is apture for the toolbox


Friday, January 7, 2011

Unfolding of the helical Savonius blade

Manufacturing of the blade of helical Savonius is not easy or not economic. In our mini-project in the faculty we faced this problem "How to make the blade". We (the team work) thought a lot, and most of the techniques were depending on discretization criteria. Our instructor told us "try to unfold the blade and you may get the help from any mathimatician". I searched over the internet and found a patent named "Helical wind rotor and a method for manufacturing the same". The patent number is US 6,428,275 B1 (you can find it in http://www.freepatentsonline.com/ .

The main problem in this patent that it requires converting the blade profile (section) to parametric equations and  solving simultaneous non-linear partial differential equations.

After a lot of work, I were able to unfold the blade using simple method (some Scilab codes) and the results were convincing and looks like that obtained in the patent.


The previous figure shows the unfolding of the a helical blade of 80 cm height, 30 cm bucket diameter, and 5 cm primary gap.

Tuesday, January 4, 2011

How to mesh your name

To make some thing special with meshing software, here you are the recipe:

1. Open MS Paint and write your name using any font you want
2. Copy the image and paste it in Vector Magic software and convert your name to vector graphics.
3. There is an option in Vector Magic to save your file as DXF file. Save the file as DXF
4. Open the DXF file using Autodesk Inventor and save it as DWG file
5. Open the DWG file and save it as AutoCad DWG file
6. Create a new .ipm file in Autodesk Inventor and import AutoCad DWG
7. Export the file to any cad format supported by the meshing software you use
8. Mesh your name

and this is what I got