Gas station without pumps

2011 June 30

LaTeX: essential skills for engineers

Filed under: Uncategorized — gasstationwithoutpumps @ 09:52
Tags: , , ,

I’ve been thinking that the School of Engineering ought to have a required freshman seminar, like the required 200 course for grad students, that teaches the basics of how to be a college student.  One thing I would require in such a course (as I have required in 200 for several years) is that students learn to use use \LaTeX.  I’ve long thought it an essential skill for math and computer science majors, but the more I see bioengineers and electrical engineers producing crappy documents in Word, the more I realize that all engineers would benefit from having a document system that can handle math and properly referenced figures.

One thing that prompted this observation was the post on Engineer Blogs, She’s got the look, in which a young engineer (a mechanical engineer, I believe) found out the hard way that \LaTeX is much better for theses than Word.  Several other young engineers have commented on that blog, most agreeing that Word is totally unsuited for theses and other documents that need to be formatted properly and edited through many revisions.  A few have had trouble with the document-compiler nature of \LaTeX and recommended front-ends like LyX.

There is a startup cost to learning \LaTeX, so the sooner we start students on it, the more that cost gets amortized.  We can’t count on high schools teaching it (though the Art of Problem Solving  online classes require it for their middle-school and high-school students—they even have a gentle tutorial for youngsters).  It seems like a freshman seminar (required also for new transfer students) would be the best place to put such instruction.

What else should be included in a how-to-be-an-engineering-student course?  A little Python with NumPy?  Some soldering? UNIX command line utility programs? Definitely some search skills from the librarians!

2011 June 29

Data Acquisition

Filed under: Accelerometer,Data acquisition,Robotics,Software — gasstationwithoutpumps @ 19:28
Tags: , , ,

One of the science-teacher blogs that I read has recently discussed using an Arduino for data acquisition: The DAQ-ness Monster « Science Learnification.

I’ve not played with the Arduino much that way, but I do have a 3-axis accelerometer, the ADXL335 from Analog Devices, on a breakout board from Adafruit Industries.  This accelerometer has analog readout, so I connected the three X, Y, and Z pins to analog pins 0,1, and 2 of the Arduino, and powered the breakout board from the Arduino 3.3 volt supply.  I also sent the 3.3 volt input to the AREF pin of the Arduino so that the I could use “ratiometric” measurements.  The ADXL335 is designed so that 0g acceleration is mid-scale, so using the same voltage for powering the chip and for the Arduino AREF input means that 512 is 0g and the scaling is approximately 1g for each difference of 100.  It turns out that the calibration is not perfect (no surprise there), so you can improve the measurements by tweaking the offset and scaling for each axis separately.  I did this manually for my code, and the results are only good to about 1%.

I should be able to do better if I write a calibration program on my laptop that gathers results from the Arduino and tries to optimize the magnitudes of the reported acceleration vectors to be one.  If the accelerometer is held steady in several different orientations, this should auto-calibrate.

I wrote a little program that measured the X, Y, and Z values 1000 times, averaged them, and sent the average over the USB line to my laptop.  I’ve put the code on-line at https://gist.github.com/1054649  Each of the measurements takes about 3.3 msec (about 1msec per DAC reading)

Limitations of the Arduino as a data-acquisition device:

  • Only 6 analog inputs
  • Only 10-bit resolution
  • All 6 channels on same scale, and input must be between 0 and a single reference voltage (3.3v for the setup I used).
  • No faster than about 1msec/sample (so don’t try to collect audio or video data)

UPDATE 8 October 2011.  I’ve just found out how to put code into the blog itself, so here it is:

// Accelerometer (ADXL335) test
// Kevin Karplus
// 29 June 2011

void setup()
{
  analogReference(EXTERNAL);   // essential if you are going to connect to AREF
  Serial.begin(115200);
  Serial.println("setup");
}

// I used wires to connect the breakout board to 
// three analong inputs, 3.3v, and ground.
// I also connected the AREF input of the Arduino to 3.3v

const int Xpin=2;
const int Ypin=1;
const int Zpin=0;

const int num_to_sum=1000;
const float xscale = 0.0098/num_to_sum;
const float yscale = 0.0097/num_to_sum;
const float zscale = 0.0099/num_to_sum;

const int zero_x = 500;
const int zero_y = 506;
const int zero_z = 511;

long xsum,ysum,zsum;

void loop()
{
  unsigned long startTime=millis();
  xsum = ysum = zsum = 0;
  for (int i=num_to_sum; i>0; i--)
  {    
     xsum += analogRead(Xpin) -zero_x;
     ysum += analogRead(Ypin) -zero_y;
     zsum += analogRead(Zpin) -zero_z;
  }
  Serial.print(millis()-startTime);
  float x=xscale*xsum;
  float y=yscale*ysum;
  float z=zscale*zsum;
  Serial.print(" X=");
  Serial.print(x);
  Serial.print(" Y=");
  Serial.print(y);
  Serial.print(" Z=");
  Serial.print(z);
  
  Serial.print(" total=");
  Serial.println(sqrt(x*x+y*y+z*z));
}

2011 June 27

Conceptual Physics text needed

Filed under: Uncategorized — gasstationwithoutpumps @ 09:40
Tags: , , , , , , ,
Conceptual Physics textbook cover

The Conceptual Physics book that we have looks like this image from an Amazon customer, but without the "media update" banner.

My son is planning to take AP Physics next year, but he has never had a really solid physical science course, just done some reading on his own, so he and I agreed that it would be a good thing for him to read a light-weight physics book over the summer to make sure he was well prepared—the rest of the class will have had a prior physics course. Since it has been over 40 years since I had any physics (and that a high school course that was lower than AP level), I agreed to read the book along with him.

We had a textbook that is used locally by several of the better schools, and that I had heard recommendations for: Conceptual Physics by Paul Hewitt.  We settled on a 10-page-a-day reading schedule and started in.

This week, my son gave up in disgust at the snail’s pace of the book—and I can’t really blame him.  Ideas that need a paragraph or a page are stretched out to fill a chapter.  It may be a gentle introduction for people who love to have things said very, very slowly, but it was putting us to sleep.

Can anyone recommend a better way to get an intro to physics at a livelier pace?

We’ll look into Lewin’s MIT lectures, but neither of us have been big fans of video lectures, most of which are even slower paced than textbooks.  (We’ve not looked at Lewin’s lectures yet, which have a reputation for having good demos, which could compensate for them being videos.)

Note: my son has not had a formal introduction to calculus yet, though he has had some of the basics for several years, so we are not looking for a standard college text, but a quick way to fill in any holes in his self-education, so that he is ready to do AP Physics without much effort.

2011 June 22

Advice on AP Bio from those who grade

Filed under: Uncategorized — gasstationwithoutpumps @ 21:35
Tags: , ,

Recently on the e-mail list for AP Biology teachers, there has been some feedback from teachers grading the free-response questions about messages that aren’t getting through to enough of the students.  I’ve collected those ideas here, paraphrasing them from the original comments.  (Note: I’ve combined the lists from 3 or 4 people, and so decided not to provide direct citation on this blog post, though I would certainly have done so for more scholarly writing.  If the originators of the messages wish to be listed, I would be delighted to add their names here.)

  • There are magical keywords in the prompts that students have to know “describe” versus “explain”, “list” versus “identify”, “discuss” versus “explain”.  The graders are looking for very specific things, and if the wrong question is answered, little or no credit can be given. They expect students to know the fine distinctions between definitions, descriptions, and explanations, and to be sensitive to what is asked for. Here are some of the important words:
    Identify
    Name one or more items, list the parts, or give an example (meaning depends on context).
    Define
    Give a meaning for a word or phrase.
    Describe
    Provide details in words that help someone visualize or construct a mental model of the object being discussed.
    Explain
    Say why or how something happens. The answer should give reasons, not just a description.
    Compare
    Consider two or more objects or concepts and point out what is similar.
    Contrast
    Consider two or more objects or concepts and point out what is different. “Compare and contrast” is a standard phrase asking for both similarities and differences—it is not asking for explanations or descriptions of the objects separately, but only of their similarities and differences.  Listing “X has A, B, and C, and Y has C, D, E” is not an answer, but the same content expressed as “X and Y both have C. A and B are properties of X but not Y, while D and E are properties of Y but not X” does answer a compare-and-contrast question.  The graders are picky about this sort of trivial presentation change, so be sure to present things in precisely the form the questions asks for.
    Discuss
    Consider different theories or points of view.  This is a more general prompt than the others, often asking for all of the above aspects.

    One teacher suggested using Larry Bell’s 12 Powerful Words posters and flash cards, though those seem to me to be directed more at middle school than AP-level courses.  Larry Bell’s web site is rather annoying, with an automatically starting video and a store for selling posters and books, but no listing of the 12 words themselves.  (Secret knowledge to keep the consultant in business?)  Others have no trouble presenting the 12 words: trace, analyze, infer, evaluate, formulate, describe, support, explain, summarize, compare, contrast, and predict.

  • Be precise in your answers.  If the question asks for four examples of something, give exactly four, not three and not five.  Only the first four count positively, and anything after that can only hurt your score, not help it.  A shotgun approach, scattering pellets of information everywhere, is not going to help, as each incorrect or irrelevant statement lowers your score.
  • When asked to give the effect of something, consider both positive and negative effects.  What happens as a result of the change?  What no longer happens? What increases? What decreases?  Both direct and indirect effects may be needed. “Under pressure, carbon dioxide dissolves in water, forming carbonic acid, and so the pH decreases.”
  • An essay, when requested, needs to be in paragraphs with full sentences.  An outline or a list will not earn many points when an essay has been requested.
  • Write legibly in dark blue or black ink—not pink, purple, green, or other “fun” colors.
  • Use a writing implement that allows you to write neatly on the cheap paper provided. Felt-tip markers and fountain pens soak through and become illegible, so a ballpoint pen is a better option.
  • Write large enough for elderly teachers who need reading glasses to be able to read your writing.  As a general rule, this means letters whose ascenders nearly fill the space between the lines and whose x-height (the distance from the baseline to the tops of lower-case letters like “a” and “x”) is  1/2 the distance between lines.  Packing more in by writing microscopically does nothing but giver your grader a headache, which is not likely to increase your grade.
  • Write just the answers, without repeating the question.  Note that this advice is specific to timed exams like the AP or SAT.  For essay questions in general, it is a good idea for the answers to be stand-alone, so that they make sense to someone who has never seen the questions and does not have a copy of them.
  • On a multi-part question, start a new paragraph for each part, and label the parts the same as the labels in the question.  This greatly speeds the reader’s task of finding whether you’ve done each part and what your answers are for each.
  • Each question has a designated place in the “pink booklet” for the answer.  Put the answer on the right page—don’t run the answers together to “save paper”.
  • Practice writing AP-style short essays frequently before taking the exam.  Writing a short essay under time pressure is a skill that is valuable for test-taking (and not much else), and it does not come naturally to people—even good writers need to learn to present an idea quickly and clearly without time to do rewrites.
  • Label both axes  of any graphs, with the independent variable on the X-axis and the dependent variable on the Y-axis.  Put units on the axis labels, and provide a descriptive title for the graph above the graph.
  • Secret code:  The AP graders interpret “plot” to mean just putting data points on the graph, while “graph” means to draw a line or curve.  This may be the only context where these words have this precise interpretation, but it is useful to know the dialect of English that is specific to AP exams.
  • Don’t extend curves for graphs beyond the provided data (unless asked to predict or extrapolate).
  • If you need to put multiple curves on the same graph, make sure that the different curves are clearly labeled.  An arrow from a label to each curve is probably easier than coming up with different dot or dash styles.

2011 June 21

Banana slug mitochondrial genome done (almost)

Filed under: Uncategorized — gasstationwithoutpumps @ 19:12
Tags: , , ,
Ariolimax dolichophallus at UCSC

Banana slug on UCSC campus (same species, but not same individual as the one being sequenced). Image via Wikipedia

Today I released a draft sequence for the banana slug (Ariolimax dolichophallus) mitochondrial genome on the Banana Slug Genomics wiki.  Some rough notes about the assembly are on the wiki on a page set aside for the mitochondrion and there is a link there to the fasta sequence file.

This unfunded project was a spinoff of the larger (also unfunded) project to sequence the entire genome for the banana slug.  We had one run of Illumina paired-end data, with a rather small fragment length donated by the UCSC sequencing center (it was a test or training run for a new technician or a new machine, I believe).  They have donated some other data for the project, but most has been too low coverage to be of any real use.

I have twice taught a class on assembling the banana slug genome, learning the material myself along with the grad students.  We have no where near enough data (particularly, no data from large DNA fragments) to assemble the whole genome: there are about 2Gbases in the genome and we’re getting an N50 of about 232 base pairs—less than the read length in some technologies!

The mitochondrion, however, is small (about 20k bases) and over represented in the data (probably about 175x coverage), so I thought it would be easy to pull out the mitochondrial reads and assemble them.

It was doable, but nowhere near as easy as I expected.  The tiny DNA fragments we had were not long enough to span even a single copy of a repeat in a nasty repeat region in the mitochondrial genome, and I had to write special-purpose software just to close the circle and get all the mitochondrial reads.  The closest previously sequenced mitochondria are so dissimilar that using them to select reads was not going to help.

After more than 40 attempts, I finally got a complete genome, with (I think) all the variants of the repeat sequence, but with no data to use to order the repeats.  I’ll be setting this project aside now, unless some wet-lab person volunteers to do buy some primers and do some PCR to disambiguate the repeats.

Update:

The closest sequenced mitochondrial genomes at NCBI are

NC_010220.1     Biomphalaria tenagophila mitochondrion, complete genome
>gb|EF433576.1| Biomphalaria tenagophila strain Taim-RS mitochondrion, complete genome

NC_005439.1 Biomphalaria glabrata mitochondrion, complete genome
>gb|AY380531.1| Biomphalaria glabrata strain 1742 mitochondrion, complete genome

name max score total score query coverage E-value max identity
Biomphalaria tenagophila 2679     4235     51%     0.0     71%
Biomphalaria glabrata 2562    3934     52%     0.0     69%
Next Page »