Showing posts with label geek. Show all posts
Showing posts with label geek. Show all posts

Monday, 5 March 2012

calculus in the garden

KorganIconThe other day I got a chance to use some calculus for real-world stuff.

So our yard is one of those that floods when it rains. It's clay and it has trough shapes. There is one main trough shape and I thought that I would like to get it filled up with soil. So how much soil would I need?

Well I knew I could solve this with an integral. So I went ahead and assumed the curve of the trough was parabolic. Who knows what it was but this was a fair guess.

I went out and measured the depth of the trough and gauged its length. That gave me my parabolic function. It was something like y=-(13/(36^2))x^2+13. The integral of this multiplied by the trough's length gave me the volume of the trough. So it turns out I need around 122 cubic feet of soil.

Turns out that costs somewhere around $200-$500. So looks like I'm keeping the trough. :D

Thursday, 11 February 2010

Φ beds

KorganIconAfter getting the most awesome Freecycle donation I'm ever likely to get, I've started to get the garden moving.


I got TWENTY TWO bags of manure. Mostly chicken manure, some cow manure too. Also got a small bag of rabbit bedding from another freecycler but nowhere near enough to satisfy the mass of chicken poop that I have. Hopefully I'll figure that out.

So I decided to put more dorky ideas into the garden. I've seperated the raised bed into sections that have the golden ratio inherent to their scale. Like so:



The raised bed isn't to the correct scale so there will be a strip down it's length cut off, with the rest of the bed sectioned as described. Like so:



I think it will look attractive. Anyway, while I was typing all that I had a very nice idea: to raise each section of the raised bed in accordance with its position in the spiral. Like so:


Ah MS Paint, what can't you do? In this sketch, even the height of each section has a relationship to phi, so it all follows the pattern. Well, I don't have the materials or the time to build this right now so it'll have to wait. But now that I've drawn this, I really want it bad. It looks great!

Monday, 18 January 2010

SEED SWAP DATABASE

KorganIconFor the last 4-5 days I've been writing a database program. As much as I try to get away from geeky blawgs, it's not happening.


It's a database that manages seed swapping, and it does it in a clever way. Let's say you have a box that you keep all your seeds in. Let's say it has two sections. The first section is your keep section. It contains all the seeds you aren't going to swap; they're for you. The second section is your swap section.

Now the goal is to get as many varieties of seed in your keep section as possible and hold as many of each as possible. You can only hold so much of each type of seed in either section. If your keep section is full of that type of seed, it goes into your swap section.

So I came up with this. Every seed has a value. I invented a currency called the U. Every seed in my keep section is worth 1U, but the value of seeds in the swap section changes. Let's say I add a tomato seed to my collection. The value of that tomato seed is less than any other tomato seed in the collection. The same happens with the next tomato seed I add. So, the value drops.


This works out awesomely two ways: if you come to me with seeds and I don't already have that variety of seed, then they are worth a good amount to me. You can get a lot of swap seeds in exchange. This encourages growth in my keep section and discourages growth in my swap section. It's great for someone swapping seeds with me because they usually get a lot more seeds than they gave.

Well I wrote a program that manages all of that stuff. You can create a database for seeds, add seeds to it, save and load databases to/from files. It will automate a swapping transaction, and issue credit if you have credit left over after a swap. And a few other nifty tricks.

It's not pretty though. It's all command line stuff. But it works.

So, if you have seeds that you want to swap, come to me and get them valued. If I have swap seeds, you'll get a very good deal. If I have nothing you need, leave your seeds and I'll issue you with credit. You can come to me later, bring your credit, and maybe pick up something you need then. Neat, huh?

Monday, 4 January 2010

Virtual Plant Breeding Project

KorganIconThis blog is about my virtual plant breeding program. If you don’t know about Mendelian genetics, read my previous blog which explains the basics in an easy-to-read way.

The last frame of the animation on my previous blog is very interesting. It summarises all six rules of Mendelian genetics. This illustration explains why a child may have red hair even though its parents don’t but its grandmother does, it explains how hybrid seeds are made and why garden centres make money from selling F1 seeds, and it explains how to make a true-breeding plant from a hybrid.


Let’s say I breed together a red and a white plant and I get a bunch of hybrids. If I produce thousands of children from these hybrids, then I know I will get roughly 25% homozygous dominant plants, 25% homozygous recessive plants, and 50% heterozygous plants. So in this case, the majority of plants are heterozygous. But what if I make another generation from this one? What will the proportions of the second generation be? This was the question I had. What is the proportion on the 1,000th generation? And the 10,000th generation?

So I wrote a program that simulates this. Then it spits out the figures and I graph it and see the results. I took two heterozygous plants and made 1,000 children from them. Then, I made a 2nd generation by randomly mating members of the 1st generation. I did this for the 3rd generation, the 4th and so on. I simulated up to 10,000 generations. I recorded the proportion of homozygous dominants, homozygous recessives and heterozygous plants in each generation and plotted the results.

Here is a sample of the graphs. (click on them for larger image) In these examples, homozygous dominant eventually overthrows the others:


Well, does that always happen? Nope. Sometimes homozygous recessive won, as shown here:


So far, I've figured that the meek MIGHT inherit the Earth. But it's not certain. So I repeated this entire experiment 500 times. The figures settle down at around 50% each way. That is, out of the 500 experiments, homozygous dominant plants took over in 48.1% of cases, homozygous recessive plants in 51.9% of cases. Hybrids can never win.

I haven't included mutations or competition or any other environmental factors in these simulations. So what?

I've learned some useful things in all this. Maybe you read this stuff and use it.