Tuesday, July 9, 2013

I Saw, I Learnt

When I was a kid my mother used to switch off the lights and fans of the rooms we were not using. I used to wonder what is the big deal if we switch it off for an hour and two. Then one day she made me calculate the hours we save in a year and then I realised the importance of saving the resources we take for granted. Slowly I developed this habit and learnt my lesson.



My dad is a doctor and when I was a kid I used to ask him why doesn't he worship God like others do.
Do you not believe in him?
He told me he does and that he worships his work. Being a doctor the best worship you can do is my saving lives and he did it everyday.
That day I learnt a great lesson.




I am sharing what 'I Saw and I Learnt' at BlogAdda.com in association with DoRight.in.

Sunday, July 7, 2013

Python Software Foundation - SfePy : GSoC 2013 : Week 3



Hi Pythonistas,

This week kicked off with the hunt for a robust Navier-Stokes solver for SfePy.
I went through huge amount of resources.

To summarise the journey:

For our Navier-Stokes currently we use the Newton method with backtracking line-search. in OpenFoam and most of the CFD code the linearization approach is based on Patankar's SIMPLE algorithm.[1][2]
I talked to my professor who told me that SIMPLE is used in commercial softwares like FLUENT too.

I found few papers which tells us some other approaches:

[1]: http://www.cfd-online.com/Forums/openfoam-solving/60167-how-nonlinear-discretised-equations-linearised-openfoam.html
[2]: http://web.cecs.pdx.edu/~gerry/class/ME448/notes/pdf/SIMPLEslides.pdf


I did some more digging from the implementation point of view and came across some interesting things:

This tutorial demonstrates the solution of Incompressible Navier-Stokes Equations using Fenics. it uses Chlorin's method[3] to solve the problem.
http://fenicsproject.org/documentation/dolfin/1.2.0/python/demo/pde/navier-stokes/python/documentation.html

Other Implementations:

Here is a list of Open Source CFD codes. Maybe we can fork a repo and use it or learn from it:
http://www.cfd-online.com/Wiki/Codes

According to people iNavier and dolphyn are promising:
http://www.cfd-online.com/Forums/main/13529-colver-code-c-c.html

Someone was using PyAMG to develop Jacobian-Free Newton-Krylov code to solve the Navier Stokes equations : https://groups.google.com/forum/#!topic/pyamg-user/HXrXTyvXPpw

[3] http://en.wikipedia.org/wiki/Projection_method_%28fluid_dynamics%29

This is everything I could harness this week. There is a lot of things to take care to lock the final solver to be used which I would do the current week. Also I am currently narrowing down and rigorously searching a way to implementing SIMPLE in the FE context.

On a side note I have also been working on a SfePy version for Python 3 and benchmarking the simulation results.

This journey is surely turning out to be awesome!

Cheers!

Tuesday, July 2, 2013

Python Software Foundation - SfePy : GSoC 2013 : Week 2



Hi Pythonistas,

After developing more understanding of SfePy I moved towards implementation.
The first phase of my project involved implementation of convective-diffusive equations.

So with the help of my mentor R (Robert. He is awesome!), energy equations were implemented.

The sample problem taken was:

r"""
Steady Axial convection and diffusion in slug flow with velocity :math:`U _0`
in an insulated pipe.
It is subjected to specified temperature at the entry and exit lengths -
:math:`T _0 for x \leqslant 0`
:math:`T _1 for x \geqslant L`
:math:`\alpha \frac {\partial T}{\partial n} = 0 on the lateral surface of the pipe`
Find :math:`T` such that:
.. math::
        \int_{\Omega} c \nabla v \cdot \nabla T =
        - \int_{\Omega_L} (\vec{u} \cdot \nabla T) v
"""

Now the results were pretty interesting :




The results were in accordance with the Peclet number graph which predicts the Temperature distribution in a convective-diffusive case. 

We have realised that a robust Navier-Stokes solver is necessary for the project compared to the present solver so our next task is to get that in place and then move ahead with the coupling of the two equations.

Cheers!

Up Next: Navier-Strokes Eq. Solver

Python Software Foundation - SfePy : GSoC 2013 : Week 1



Hello Pythonistas,

I am Ankit and this week I kickstarted my GSoC 2013 Project - Enhancing the solver to simulate solid-liquid phase change phenomenon in convective-diffusive situations. I am a dual-degree undergrad pursuing my masters in phase-change material simulation.


Previously I had worked on the post processor of Abaqus, a commercial software, in my internship and always dreamed of working on a solver. Surely it was an honour when I was given a chance to work on SfePy as my GSoC project.

This project is pursued under :



"Briefly, SfePy is a software for solving systems of coupled partial differential equations (PDEs) by the finite element method in 2D and 3D. It can be viewed both as black-box PDE solver, and as a Python package which can be used for building custom applications. The word 'simple' means that complex FEM problems can be coded very easily and rapidly."

This week ended with:
  • Finalizing the weak form of the equations to be implemented.
  • Tinkering with the examples and code-base to know the entire architecture which is very modular and powerful.
I realised that lots of challenges are awaiting ahead, but the interesting part is that SfePy falls under the umbrella organisation - Python Software Foundation 

And you know I Love Python!

So the adventure has already begun ... 

Up Next: Energy Equation Implemented

Monday, June 10, 2013

2779 AD: Extinction

Adam Elevator Space Base | 62,137 miles above sea level | 2779 AD



Bruce sighed while waiting at the cargo bay for the elevator's arrival. He had been following the same schedule for last 10 years – collecting the cargo sent by his associates on Earth which usually included new test equipments and some belongings sent by his family and friends living below. A taut carbon nanotube composite ribbon was anchored to the platform. It continued a few thousand miles above into the space and finally hooked into a trapped asteroid which acted as a counterweight. He could sense the dampened vibrations of the approaching elevator. He was feeling a bit upset today as on this fateful day, five years back, his dear friend Luke had vanished mysteriously.

Tycho Crater | 100 miles from SpaceX Colony, Moon | 2774 AD

Luke drove his rover through the Lunar highlands covered with regolith, a mixture of fine dust and rocky debris, and reached the source of the strange signal he detected today. He slid down the gentle slope of the crater and started leaping towards its centre. After walking a few miles the dusty terrain started turning smooth and shiny like an ice-floor. He inserted his probe and started examining the floor closely. It turned out to be a super-cooled liquid glass.
“What is this glass lake doing in this crater?” He wondered.
He turned his head upwards and gazed at his home planet. It was looking serene and beautiful.
Suddenly a thought clicked in his mind.
He took his receiver and plugged it into his suit. He told Lina, the computer built into his spacesuit, to analyse the signal with respect to Vasin-Shcherbakov Equations.
After a few seconds.
“Luke. This signal encodes the current satellite image of Earth with an extraordinary resolution of one mile on Earth to one mile on the data transmitted.”
Luke was shocked- “How on Earth is this possible! This crater contains the most gigantic telescope, constantly keeping an eye on us and we never knew. How did we miss it? I must head to the colony and tell Bruce about this.”
As Luke started drifting swiftly towards the rover, he felt a strange presence, as if he was not alone. A dusty breeze blew through his airtight suit. He was shocked at the thought of something penetrating his suit.
The next moment his power-suit turned off.
He tripped.
Turned his head.
Saw a faint silver figure floating in air and never woke up.
The giant lunar telescope was not the first alien technology mankind ever came across. Something similar happened 800 years ago.

Groom Lake | Southern Nevada, U.S. | 1949 AD 


The lake was shrinking season after season. Old Timothy Adams was having a dip in the lake when suddenly he felt something big under his feet. He informed the sheriff and soon they pulled out that saucer shaped object. Rumours of this strange object spread and this area was cordoned off quickly. They named it Area 51, a secretive military air force base.
After a few years, disruptive technologies started pouring out in US- Fibre optics, LASERs, Kevlar, Titanium fighter planes, Transistors (the birth of computers)– and some of these totally changed our world. Some technologies took centuries to reverse engineer, like the hydroxyGEN– which could split water vapour in air and provide us both Hydrogen fuel and pure Oxygen.
It still remains a well kept secret that the technologies we boast off today, had their origin in that one saucer which landed on Earth maybe centuries ago.

SpaceX Moon Colony | Maria Levita, Moon | 2779 AD


It was a peaceful lunar settlement, flocked with twenty families as a part of the SpaceX lunar experiment. The colony was a closed ecological system where all nutrients were recycled. It was self-sustainable requiring no Earthly support.
Bruce entered his house. Sam was eagerly waiting for his dad. He was wearing a strange skimpy suit covering his entire body except his head.
“Hey son, look what grandpa sent you.”
It was a slimy fish with orange scales. Swimming to and fro in the container. It looked beautiful.
“Dad, it belongs to which species?”
“I have no clue Sam. Try asking Ela.”
Sam moved his hand and positioned his palm facing the fish.
“Ela, tell me all details you find on this fish.”- He said it on his microphone.
Green rays came out of his palm and started scanning the fish. The rays stopped and Ela, his personal supercomputer, soon arrived at an answer.
“It is an Oranghy also known as the "slimehead". It is slimy and has orange scales, having a typical life expectancy of 150 years. It is found along the North Atlantic coast. It became extinct 50 years back due to overfishing.”
Sam looked at this cute fish and started feeling sorry. Man's inherent nature to dominate the entire planet never changed. As centuries passed, species extinction had continued at an alarming rate due to human activities.

Amazon Desert | Brazil | 2779 AD

What was once 2.1 million sq miles rainforest was now reduced to a desert with just a small patch of land covered with trees. Millions of species residing in those forest were now extinct. An automatic lumberjack came and started logging the final patch.
The moment the last tree touched ground, 2000 orbs left the Gioni Crater on Mars.

Adam Elevator Earth Base | On a Pacific Isle | 2779 AD


“Stephan, today around two thousand silver orbs destroyed all major cities around the globe. A high energy plasma beam emitted from a single orb wiped out an entire city, leaving behind just a rocky terrain. With all major government centers gone, the entire planet and its people are thrown into chaos."- Andy told me.

A day later, everyone, including me, enlisted in the army, in order to protect the Adam Earth Base as that was our last resort to escape this doomsday. It was our last hope.
We took our positions and surrounded the base.

Five hours later, three elevated figures appeared far away. The humanoids looked identical, shaped like an ideal human. We started shooting at them with our laser guns. It was a futile effort.
Their silver suits were made up of technology never seen before-
Nanotech? Biotech?
No.
It was nowhere near as simple as that. Its material was inserted with an integral DNA of living organisms. Customized artificial neurons were working in conjunction with their nervous system. Those metallic suits responded to their thoughts. It was an amalgam of biotechnology and mechatronics. They were controlling it perfectly. Our laser beams were easily blocked by their techno-organic armour which altered itself automatically to create a shield in order to obstruct the trajectory.
They were close. We were scared.
None of my shots were even close. I was just another scientist holding a gun and wearing a power-pack, stupefied by their alien technology. One of them was now floating in air facing me. I shot at him insanely, to no result. He extended his hand fully towards me, keeping his arms straight and locked. His palm a few feet away facing my head. Suddenly he turned and shot a spherical ball towards Andy. The ball appeared out of nowhere on his palm. As if lots of molecules on his palm assembled to form that sphere. As it reached Andy, the sphere disintegrated into the air. Andy's power-pack failed and then a few moments later Andy dropped dead.
I could predict that this superior race had already harnessed Technovores- Synthetic alloys and unknown biological entities that invade the system compromising power source and life out of the cells of the host. The silver Technovore shield was made entirely of nanobots. It had the ability to disassemble itself into a stream of nanites which carries a copy of the entire viral personality, and implying that the whole entity can reconstruct itself from a single unit. It absorbed technology into itself, adding the abilities of consumed technology into its physical being. It was a bio-tech warfare, probably the first and the last mankind would ever see.
The alien turned his head and looked directly into my cold eyes.

SpaceX Moon Colony | Maria Levita, Moon | 2779 AD

Bruce and Sam started running towards the escape pods kept at the edge of the colony. But when they reached it was already too late. The five pods were already carrying eight families. Bruce was holding Sam's hand standing in despair. They could see the SilverMen on the other side of the colony shield.
The pods launched.
SilverMen positioned their palms shooting hundreds of globules into space which disintegrated on contact with the surface of the pods. Three hundred feet above the ground those pods annihilated.
Sam could not bear the sight. He hugged his dad and started crying. Right now he felt just like the Oranghy – alone, entrapped and helpless.
“Dad, are we going to become extinct?” 


This entry was written for IBL 2.0 Coup d'East Team. Do like the original entry - Link

Monday, June 3, 2013

Book Review: Shoes of the Dead




Journalist Kota Neelima has delivered a powerful political novel in the form of 'Shoes of the Dead'. It is a chilling parable of modern day India, featuring characters that readers don't encounter too often - greedy money lenders, farmers burdened by debt, unscrupulous middle men, corrupt doctors and district collectors struggling to work. Also we encounter the big city journalists, the well heeled academics and the smooth-talking politicians.

The story begins with the death of Sudhakar Bhadra who kills himself over-burdened by debt due to successive crop failures. The powerful district suicide comittee of Mityala routinely dismisses the suicide and refuses compensation to his widow. Gangiri Bhadra, his well educated brother, makes it his life's mission to bring justice to the dead by influencing the committee to validate similar farmer suicides. His own personal life is full of crisis where he is barely able to feed Padma, his brother's widow, and her two children two square meals a day. Fully determined he comes up with a plan and soon commitee members turn to vote for suicide due to debt. While he treads on this path, the readers come across some harsh realities of rural India like poor healthcare. Dr. Hemant Rao who has his own dark side where he cheats the hospital by stealing medicines and faking innovices in order to treat the poor farmers for free.

Keyur Kashinath of the Democratic Party is the MP from Mityala and son of Vaishnav Kashinath, a veteran politician. He never visits his constituency and inherits his father's power in Delhi politics. He believes that owing to his lineage it is his divine right to rule and forgets the people's right to rule. He faces his first crisis when every suicide in his constituency certified by the committee as debt-related turns out to be a blot on the party's image and his competence. Meanwhile Nazar Prabhakar, a journalist, comes up with his article "Mityala MP should quit if farmer suicides continue: Demand Voters, seek relief measures" which forces Keyur to visit his constituency.

The brilliant farmer battles his inheritance of dispair, the arrogant politician fights to keep his inheritance of power. The two worlds collide in a conflict that pushes both to the limits of morality, from where there is no turning back. And in the end, there can be only one winner.

This well researched novel surely gives readers a deeper understanding of the complexities at the heart of this nation and brings up the issue very well.
A must read!

This review is a part of the biggest Book Review Program for Indian Bloggers. Participate now to get free books!

Sunday, June 2, 2013

3047 AD : Troy



3032 AD
"Whoa! Robert we did it, it’s amazing we made a profound discovery in our solar system. It truly does give a deep insight into science," said Kurt the administrator of Space-X.
Robert was the deputy administrator of this private firm which had advanced miles ahead in the field of space research compared to NASA and other government organisations. Just a few hundred years Space-X had made Mars habitable for Human settlement by inducing climatic conditions similar to that of Earth. 
"Yes we did it. It’s a combined effort of our team, without them we never would have found that wormhole." said Robert.
"Yes, and to think that there would be a wormhole between the planet Mars and the asteroid belt is truly astounding" said Kurt.
"Kurt you know how eager I am to discover new colonies of life outside earth and get to know their culture and existence and I truly believe this opportunity could be used to the fullest and explore the unexplored. We are lucky that this is a traversable wormhole and space travel could be done through it." Robert asked Kurt with extreme delight in his eyes.
"A wonderful opportunity indeed." Kurt replied. "Considering that and the fact that it is impossible for life travel to take place through that wormhole we must make a satellite which could send radio waves through the worm hole."

3035 AD
"Pandora 619 is is ready for the launch Robert," Kurt said cheerfully.
"Let's begin the countdown."

3045 AD
"Kurt, there is a serious problem at hand, the connection with Pandora 619 is cut and cannot be re-established."
"It’s alright, we covered most of the part of planet Redik through Pandora 619, we will find an alternate solution and even inform the situation to the Garganians who have their planet Gargan near the satellite. Maybe they could help us as they have been helping us by lending their technological marvels over the past few years since we made our first contact." said Kurt filled with hope.

3047 AD
"Kurt, sorry to disturb you at this moment but our watch-station 4 has just sent an emergency message, it says that an unidentified object is heading towards Earth. I’ve even contacted Gargans, but they denied it being theirs. It is approximately 5 days away from earth." said Robert confused.
"All right I will look into the matter." Kurt said calmly.

The following day Kurt seemed to be rejoicing.
"Cheers! I am very happy that Pandora 619 is returned. We could possibly use it to test Redik's soil samples. I even asked the watch-station to conduct an X-ray scan of Pandora 619 but it seems there is no danger."


That night Kurt returned back to his home overlooking the Martian Delta. Suri, his daughter, was eagerly waiting for her dad.
"Dad, look what I found while I was browsing the SMAI today. On Earth there was a lost city of Atlantis which was discovered 500 years ago. It was created by the survivors of Troy who wanted to live at peace after its destruction because of the Trojan Horse." Suri paused. "Dad what is a Trojan Horse?"


"My girl, the Trojan Horse was a way of deception used by the Greeks who wanted to win against Troy in a war. The Greeks hid in the wooden horse and the army of Troy thought of it to be the gift of victory and took it inside. When inside at night the Greeks crept out and called in reinforcements and slaughtered the army of Troy. This was the Trojan Horse," said Kurt thoughtfully.

"Dad, this is cheating." Suri was sad.
Kurt then began to contemplate.
He then stomped his foot and quickly headed towards the Space-X office and called Carter the man in-charge at watch-station 4.
"Carter, its me Kurt, sorry to disturb you at this time of the night, but could you tell me how far is Pandora 619?"
"3 days sir," replied Carter.
"Could you please take an electron beam scan of Pandora 619?"
"Right away sir."

The next day Kurt was holding the reports. He was puzzled.
Holding the reports in his hand Kurt called the Extra Terrestrial Space Force Captain Norman Scruze.
"Norman I want Pandora 619 to be exterminated immediately. And please make sure it is done as soon as possible" Kurt said.
"Sure sir" Norman replied.
After 13 hours the the whole sky is blinded by a white light.
Kurt arrived to the unit and smiled at his staff. Everyone including Robert were stupefied by this phenomenon.
"I am glad the report saved us Kurt." - Robert remarked.
"It didn't, Robert. The reports were negative. The Garganians sent back the satellite Pandora 619 with loads of anti-matter which if it would have made contact with any planet would have lead to total annihilation. These reports provide us the proof that our technology is still far inferior. We need to figure out their future plans. They are nothing less than demi-gods who are gearing up for a war. This was just their Trojan Horse."