Docsity

Assignment 3: Fractals and Tree Generation in Complex Adaptive Systems CS591 - Prof. Melan, Assignments of Programming Languages

Toggle sidebar
bg1
Complex(Adaptive(Systems,(CS(591(
Assignment(3:(Fractals(
Due$midnight$April$21,$2008$
For(this(assignment((worth(50(rather(than(100(points)(you(do(not(need(to(prepare(a(report.(
You(only(need(to(do(the(following.(
Write(a(program(that(draws(trees(following(the(West(et(al(1997(algorithm.(To(make(things(
easier,(draw(your(trees(in(2(dimensions(so(that(each(branch(has(a(width(and(a(length((not(a(
radius).(The(length(ratio((
γ
)(is(set(so(that(the(branches(are(area(filling((as(opposed(to(volume(
filling(in(West(et(al).(Thus,(given(a(branching(ratio((n),(
γ
(=(n1/2(rather(than(
γ
(=(n1/3.(Similarly,(
rather(than(being(area‐preserving,(the(widths(of(branches(should(be(width‐preserving,(that(
so(that(
β
$=(n‐1.(In(the(2‐D(version,(of(West(et(al(predict(Nt$~Anet2/3,(where(Nt(=(the(number(of(
terminal(units(and(Anet(=(the(area((or(footprint)(of(the(network.(
(
Allow(the(user(to(specify(a(depth((N)(of(the(tree,(the(number(of(daughter(branches((n)(per(
parent(and(the(branching(angle((
Īø
).(Specify(the(size(of(the(ā€˜invariant(terminal(unit’((the(leaf(
or(capillary)(to(be(length$lN(=(2(and(width(wN$=(1/2,(so(that(the(area(of(a(terminal(unit(AN(=(1.((
Build(your(tree(from(the(leaves(back(to(the(trunk.((
For(each(tree(your(program(should(output:(
a)(A(2D(drawing(of(your(tree.(
b)(Report(the(number(of(leaves((Nt),(the(Area(of(the(whole(tree((Anet),(and(the(ratio(of(
leaf(area(to(whole(network(area(((Nt*(At)/Anet)(given(N.((
c)(Calculate(and(report(the(fractal(dimension(of(each(tree(you(generate.((
Turn(in((
i) Your(code(
ii) Drawings(of(2(trees(generated(by(your(code((specify(N,$n(and(
Īø
).(
iii) A(table(reporting(the(items(in(b)(and(c)(for(trees(with(the(following(inputs(
(12(lines(in(your(table):(N(=(2,(4,(8,(10;(n(=(2,(4,(8(
iv) A(mathematical(description(of(
a. the(relationship(between(Nt$and(Anet$(
b. how(fractal(dimension(depends(on(n(and(N?(
(
Extra(credit((10(points(if(you(solve(how(fractal(networks(fit(in(Euclidean(organisms,(partial(
credit(for(a(good(effort).(Consider(that(the(networks(you(generated(above(are(circulatory(
networks(for(2D(circular(animals((small(networks(for(circular(mice,(big(networks(for(
circular(cows).((If(the(maximum(distance(between(leaves(of(the(tree(equals(the(diameter(of(
the(animal,(how(big(is(the(animal,(i.e.(what(is(its(area?((This(makes(the(most(sense(visually(if(
you(use(n=4(in(2d).(Calculate(the(area(of(the(animal((given(the(diameter(above)(as(a(function(
of(the(area(of(the(network.((
You(should(see(that(the(area(of(the(circle(does(not(equal(the(area(of(the(network.(West(et(al(
propose(the(following((translated(to(2D):(
a. The(number(of(capillaries(is(nN(and$nN(āˆ(Anet2/3((
b. To(achieve(Anet(āˆ(Acircle,(set(Nt(āˆAcircle 2/3(,(then(Anet(āˆ(Nt3/ 2(āˆ(Acircle2/3)2/3āˆAcircle.(
Can(you(draw(a(tree,(and(an(organism(surrounding(that(tree(that(shows(whether(these(
conditions(cause(Anet(~(Ac ircle?(Can(you(relax(the(assumption(that(the(animal(is(circular(to(
show(that(this(is(true(under(other(assumptions?(Can(you(relax(the(assumption(that(the(
terminal(units(are(invariant(to(solve(this(problem?(Can(you(systematically(change(
Īø
$or(n(as(
you(change(N(to(cause(Anet(~(Acircle?(Show(your(results(with(fractal(branches(that(fill(the(area(
of(the(circular(organisms,(and(explain(them(mathematically.(

Partial preview of the text

Download Assignment 3: Fractals and Tree Generation in Complex Adaptive Systems CS591 - Prof. Melan and more Assignments Programming Languages in PDF only on Docsity!

Complex Adaptive Systems, CS 591 Assignment 3: Fractals Due midnight April 21, 2008 For this assignment (worth 50 rather than 100 points) you do not need to prepare a report. You only need to do the following. Write a program that draws trees following the West et al 1997 algorithm. To make things easier, draw your trees in 2 dimensions so that each branch has a width and a length (not a radius). The length ratio ( γ) is set so that the branches are area filling (as opposed to volume filling in West et al). Thus, given a branching ratio ( n ), γ = n 1/2^ rather than γ = n 1/3. Similarly, rather than being area‐preserving, the widths of branches should be width‐preserving, that so that β = n ‐^1. In the 2‐D version, of West et al predict Nt ~Anet^2 /3, where Nt = the number of terminal units and Anet = the area (or footprint) of the network. Allow the user to specify a depth ( N ) of the tree, the number of daughter branches ( n ) per parent and the branching angle ( Īø). Specify the size of the ā€˜invariant terminal unit’ (the leaf or capillary) to be length lN = 2 and width wN = 1/2, so that the area of a terminal unit AN = 1. Build your tree from the leaves back to the trunk. For each tree your program should output: a) A 2D drawing of your tree. b) Report the number of leaves ( Nt ), the Area of the whole tree ( Anet ), and the ratio of leaf area to whole network area (( Nt * At )/Anet) given N. c) Calculate and report the fractal dimension of each tree you generate. Turn in i) Your code ii) Drawings of 2 trees generated by your code (specify N, n and Īø). iii) A table reporting the items in b) and c) for trees with the following inputs (12 lines in your table): N = 2, 4, 8, 10; n = 2, 4, 8 iv) A mathematical description of a. the relationship between Nt and Anet b. how fractal dimension depends on n and N? Extra credit ( 1 0 points if you solve how fractal networks fit in Euclidean organisms, partial credit for a good effort). Consider that the networks you generated above are circulatory networks for 2D circular animals (small networks for circular mice, big networks for circular cows). If the maximum distance between leaves of the tree equals the diameter of the animal, how big is the animal, i.e. what is its area? (This makes the most sense visually if you use n =4 in 2d). Calculate the area of the animal (given the diameter above) as a function of the area of the network. You should see that the area of the circle does not equal the area of the network. West et al propose the following (translated to 2D): a. The number of capillaries is nN^ and nN^ āˆ Anet2/ b. To achieve Anet āˆ Acircle, set Nt āˆAcircle2/3^ , then Anet āˆ Nt3/2^ āˆ Acircle2/3)2/3āˆAcircle. Can you draw a tree, and an organism surrounding that tree that shows whether these conditions cause Anet ~ Acircle? Can you relax the assumption that the animal is circular to show that this is true under other assumptions? Can you relax the assumption that the terminal units are invariant to solve this problem? Can you systematically change Īø or n as you change N to cause Anet ~ Acircle? Show your results with fractal branches that fill the area of the circular organisms, and explain them mathematically.