To help me learn the reactions of photosynthesis, specifically the mass balance between the various inputs and outputs, I'm writing a Matlab program that will run it for tMax time steps. So far I'm only through the light reactions, and of course I'm not doing this in any sort of complicated way. I've got an idea for it that I want to test, and if it's okay I might do it as my class project.
In any case, today's short and handy MatLab tip comes from this... many people probably know this already, but there's a way to get your command prompt to print helpful messages. why do this? because long simulations aren't super fun to watch (in fact, you don't see anything).
So it's pretty easy
in fact, you don't need anything special to do it
it's just
disp('whatever you want to say!')
for example:
at the bottom is my script, which counts a bunch of stuff, and also stores it in matrices about where it is right now in the chloroplast... err, well, at the moment it's all still in the grana. Anyway, you see the disp command telling me that the light reactions are complete! At the top is the command window, where we also see that the light reactions are complete.
after I finish this I may post the script, it's of course hard to keep track of some of this stuff, and I'm sure I've made a minute error I haven't seen yet.
Saturday, January 22, 2011
fun alienware tricks
This is very low-tech but I have an alienware and I love it!
Yesterday, a girl walking through a hall stopped me with something like "WOW! YOUR COMPUTER HAS A RED KEYBOARD... IS IT A MAC?!?"
No, I've had my days of Macintosh... it's great for just regular stuff like web-browsing, and it's also great for making designs, and it has some neat programs, like grapher, and iPhoto. But when you are constantly downloading strange files and open source GIS stuff, Mac just doesn't have the flexibility of windows (I know, I could run windows on Mac, but it wasn't the same).
But let me show you what I mean about the red keyboard:
Alienware lets you change your keyboard color-- I have mine set so it will change when I am plugged in or not plugged in, and if I'm doing a few specific apps, it turns green, just for kicks.
And here's another neat trick, the math reader. It missed the top derivative being a full one, but you can correct it (I didn't so you can see the difference). It's probably not a huge timesave if you don't have a mouse, but I can see how this would be helpful if you just want one simple differential or something in a word doc and you feel like snipping it as an image. Else I would probably use LaTeX.
Yesterday, a girl walking through a hall stopped me with something like "WOW! YOUR COMPUTER HAS A RED KEYBOARD... IS IT A MAC?!?"
No, I've had my days of Macintosh... it's great for just regular stuff like web-browsing, and it's also great for making designs, and it has some neat programs, like grapher, and iPhoto. But when you are constantly downloading strange files and open source GIS stuff, Mac just doesn't have the flexibility of windows (I know, I could run windows on Mac, but it wasn't the same).
But let me show you what I mean about the red keyboard:
Alienware lets you change your keyboard color-- I have mine set so it will change when I am plugged in or not plugged in, and if I'm doing a few specific apps, it turns green, just for kicks.
And here's another neat trick, the math reader. It missed the top derivative being a full one, but you can correct it (I didn't so you can see the difference). It's probably not a huge timesave if you don't have a mouse, but I can see how this would be helpful if you just want one simple differential or something in a word doc and you feel like snipping it as an image. Else I would probably use LaTeX.
Thursday, January 20, 2011
simile... modeling software that is pretty cool!
I'm taking my first "big girl" engineering class-- NOTE THAT I AM NOT AN ENGINEER-- and we got this really neat software to use to make conceptual models. What's great is that
1. it's visual
2. it runs C ++
3. put the two above together and you can see that essentially I consider it a GUI for C++... I think C++ looks very hard but I admire how efficiently well-written scripts in it run, and people who can figure out all that stuff with the parenthesis. However I don't know how to do that, and I haven't had the chance to learn yet. OKAY!
Okay, so I built a basic (bad) model for stand density to show you how it works:
So the basic rules of the road are in this toolbar here. Look to the lower left, and you've got boxes for "steady state variables"-- the things you want to "track" with your differential equations. In this case, it is "stand density" that I want to track. The circle with the X in it is "variables"-- these are parameters and they can be functions, constant, boolean, arrays, logical... you name it. More in a second. Then there is hourglass-with-a-line-through-it, this is a flow to move something (like trees) from one state to another. The units of these must agree with the boxes. You can also use them to move things into the system or out of it. Finally there is little-curvy arrow, which is used to make influence. For example, if you are writing a differential equation where the CHANGE IN X OVER TIME = RATE OF SOMETHING * X, then you would want rate of something and X to influence change in X over time. I've found you can't really have too many of these, and simile will delete the ones that you don't put into the model math.
There's some other neat stuff up there too that I won't go into, including creation (sun), migration (bird), and submodel (the cartoonish talking cloud). Oh! Most importantly, to click on something, use the little arrow. I know it sounds dumb but I took a bit to understand that.
So you have this model now that you built for stand density. As you can see, the above variables are described and labelled, and lines of flow and influence are drawn. This is just point and click.
Now you may want to fill it in. Well, okay, you do want to fill it in. So click on the variables, boxes, and flows, and you'll get a screen like this (you don't fill in the influences, they are more like operators, I guess). Anyway, here I called rate of seeding 0.5 (fertile stand, huh?)
And here you can see me filling in the flow for birth. Notice in the background it's green while you are filling it in. Also notice that because of the "influences" I have the choice to fill it in using the variables that influence it. I've just made it rate*stand density. This is a per-capita stand. :D
Ok! Time to plot! And there's a lot of ways to do it. You'll see now that my model is black because I've fillled everything in. I plotted stand density versus time (I had a low death rate, something like 0.4 per capita). Oh NO! OVERCOMPETITION OCCURED! TIME FOR THINNING (see below!)
Well, that's your brief guide to simile. If you like it you should play the tutorials here
Subscribe to:
Posts (Atom)