A few people asked me if they can have the source code files to following project:
http://scientificcomputingco.blogspot.com/2013/02/automatic-greenhouse-control-system.html
The code files can be found here:
https://www.dropbox.com/sh/ip306uavm7jpekg/xQuoUjSmEJ/Green%20house%20control
Unfortunately there comes little to no documentation with the file, thus one have to dig through the source code files to understand the program.
You can contact me for further questions.
Thursday, June 20, 2013
Thursday, April 25, 2013
Spatial Element Offset Normal To Surface
![]() | |||
Finite element model of a mouse (2D elements). Left: Original mesh; Middle: Offset mesh; Right: Original and offset mesh (via overlay) |
1) Equivalence your surface mesh (remove duplicated nodes).
2) Calculate the smooth node normals:
--Calculate the element (face) normals.
--Add the element normal to every node that is shared by the element.
3) Normalize the normals at the nodes (unit vectors, pointing away from the surface).
4) Multiply the normal vectors with the desired offset.
The results of this procedure can be seen in the image above.
If anybody is interested in the code (written Pyton) I can send it via email.
Friday, February 22, 2013
Automatic greenhouse control system
My brother is a farmer and he owns a couple of green houses.
The greenhouses are computer controlled; depending on light intensity and temperature in each green house, the computer system lifts or closes the window panels to keep
the temperature constant and safes the plants from too much heat or cold. The
control system my brother uses is a very well established system. The only
drawback is, that it costs a fortune. So my brother came up to me and asked me,
if I can figure out a cheaper solution. Well, and there we go with my concept
that is less than 100USD...
Micro-controller board used in this concept project; Arduino Leonardo |
Ok,
so how does it work? I am using temperature sensors (LM35) and light sensors
(LPR) to detect the actual temperature and light intensity in the greenhouses. -
In the current example I am controlling two greenhouses and therefore there are
two light sensors and two temperature sensors-. The electronic signals are sent from the sensors to the micro-controller board (Adruino Leonardo). The board processes the
signals and sends the data to the computer that is connected via USB micro
plug.
![]() |
GUI showing actual temperature and light values as well as temperature and light criteria used in the algorithm to control the greenhouse window panel and ensure constant temperature in the greenhouse |
I
have used Python to create a Graphic User Interface (GUI) that presents the
sensor values and the history of the sensor values via Diagram.
![]() | |
|
LEDs
are used to simulate the window panel control.
|
Wednesday, February 6, 2013
F2PY on 64bit Windows (python2.7)
I am writing this post because after hours of frustration I want to share the solution that I found to get F2PY running on a 64 bit windows machine. Ok, here is how it worked out for me,...
If you have old python stuff on your computer, than entirely remove it and download and install components in the following order:
.) Python 2.7.3 Windows X86-64 Installer under http://www.python.org/getit/
.) numpy-unoptimized-1.6.2.win-amd64-py2.7.exe under http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
Then download and extract
.) mingw-w64 under http://sourceforge.net/projects/mingw-w64/
From the extracted directories copy mingw to your c:\mingw
After that, go to your environment variables (under System) and add
.) C:\Python27\Scripts
.) C:\mingw\bin
to the PATH variable
Add also .py to the PATHEXT variable.
To use F2PY now write:
f2py -c --fcompiler=gnu95 --compiler=mingw32 -m yourmodulename yourfortranfile
Important note:
I still got an error on my system saying:
"File "C:\Python26\lib\site-packages\numpy\distutils\fcompiler\gnu.py", line 331, in get_libraries raise NotImplementedError("Only MS compiler supported with gfortran on win64") NotImplementedError: Only MS compiler supported with gfortran on win64"
I solved the problem absolutely randomly:
I changed C:\Python27\Lib\site-packages\numpy\distutils\fcompiler\gnu.py line 331 to:
pass #raise NotImplementedError("Only MS compiler supported with gfortran on win64")
Basically I un commented the NotImplementedError and it worked fine!! GEZUZ!!
If you have old python stuff on your computer, than entirely remove it and download and install components in the following order:
.) Python 2.7.3 Windows X86-64 Installer under http://www.python.org/getit/
.) numpy-unoptimized-1.6.2.win-amd64-py2.7.exe under http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
Then download and extract
.) mingw-w64 under http://sourceforge.net/projects/mingw-w64/
From the extracted directories copy mingw to your c:\mingw
After that, go to your environment variables (under System) and add
.) C:\Python27\Scripts
.) C:\mingw\bin
to the PATH variable
Add also .py to the PATHEXT variable.
To use F2PY now write:
f2py -c --fcompiler=gnu95 --compiler=mingw32 -m yourmodulename yourfortranfile
Important note:
I still got an error on my system saying:
"File "C:\Python26\lib\site-packages\numpy\distutils\fcompiler\gnu.py", line 331, in get_libraries raise NotImplementedError("Only MS compiler supported with gfortran on win64") NotImplementedError: Only MS compiler supported with gfortran on win64"
I solved the problem absolutely randomly:
I changed C:\Python27\Lib\site-packages\numpy\distutils\fcompiler\gnu.py line 331 to:
pass #raise NotImplementedError("Only MS compiler supported with gfortran on win64")
Basically I un commented the NotImplementedError and it worked fine!! GEZUZ!!
Monday, December 3, 2012
Drug delivery modeling: analyzing model parameters
![]() |
Images showing vasculature (magenta) reconstructed from tumor imaging data and a graph illustrating the drug dye concentration in the vascular and extra vascular compartment. |
Drug delivery of tumor therapies can be modeled via ordinary differential equations (ODE). The delivery depends on different tumor parameters such as tumor and vascular geometry, vascular permeability and transit time. To estimate the parameters I reconstructed the vascular geometry based on fluorescent-microscopy imaging data and analyzed the time dependent dye concentrations in the vascular- and extra vascular compartment. Based on the data I was able to calculate the parameters required for drug delivery modeling.
Thursday, November 15, 2012
Animated flag via OpenGL
![]() |
Animated flag of the Fresh Water Pirates |
OpenGL and the GL Shading Language can be used to create realistic graphic animations. In this example I've used a quad mesh and bound a 2 dimensional texture (image) to it. (© Fresh Water Pirates ). A time-dependent sinus function modifies and updates the mesh coordinates every 0.05 seconds. The vertex normals are calculated for every update. Lighting effects are computed on the GPU
A video of the flag animation can be found at:
Like the pirates on facebook:
Monday, November 12, 2012
MUSC HCC Retreat
My poster for MUSC HCC Retreat event |
Subscribe to:
Posts (Atom)