jump to navigation

Lost in translation March 18, 2013

Posted by mareserinitatis in computers, research.
Tags: , ,
add a comment

I took my first class in Fortran in the fall semester of 1992, while I was still in high school.  I was taking some classes at the university as an early entry student, and the teacher of the course was a grad student.  He was trying to explain something and kept getting the syntax wrong.  I was getting horribly frustrated, as were the rest of us.  He probably noticed as his response was to say, “I know three operating systems, which means I’ve become completely useless in all of them.”

I didn’t understand how he could confuse things like that as I was taking German and Spanish simultaneously and never seemed to have a problem with mixing things.  I had no idea how different it was to learn spoken language versus coding language.  That was before I’d learned to use a handful of programming languages and started using matlab commands in my fortran code.  Debugging is even more of a pain because it looks right…and it is, but for another language.

I have converted January 9, 2012

Posted by mareserinitatis in computers, research, science, solar physics.
Tags: , , ,
7 comments

Because of the vagaries of my status at UMN (that is, I am an enrolled student, but I don’t pay tuition and therefore do not get some of the perks), I found out that I could no longer get access to Matlab.  This is a bummer because, well, I need it for my thesis.

I’m trying to prove out some code and it’s easier to see what’s going on in Matlab because of the plotting functions.  The idea is that I would like to write it up in there, see what’s going on, and then translate it to the dreaded Fortran.

Alas, I guess I’m having to break up with Matlab.  Instead, I’m learning Scilab.  I find this somewhat funny given how I was explaining to my engineering students last semester that once you know a computer language, it’s often easier to learn another.  (Sadly, most chose not to learn a first one.)  This is doubly so moving from Matlab to Scilab (or, I imagine, the reverse order) because they are so similar.

I like Scilab because it seems to me like a cleaned up version of Matlab.  I don’t consider myself a master in the art of Matlab Kung Fu, but I’m passable.  I have written a small program to solve the Boltzmann equation in the presence of an electromagnetic field and later solved the intractable igloo problem.  However, there are some of the subtleties of matrix operations in Matlab which have always proved problematic for me, mostly dealing with conditional statements to indicate matrix indices, leaving me to fall back on loops.  Not efficient, but it works.  So far, it appears that these operations are more straightforward in Scilab.  I also like the use of the % to indicate prenamed variables.  I am all too guilty of using i as a counter and then being frustrated because it wouldn’t work as an imaginary value later in the program.  And of course, I really like the price tag.

I haven’t yet gotten to some of the plotting I need, however, and as I understand it, that is where Matlab excels.  We shall see.

Have you used both programs?  If so, how do you think they compare?

Engineers who don’t like to program November 15, 2011

Posted by mareserinitatis in computers, education, engineering, teaching.
Tags: , , ,
8 comments

I admit that I’ve set myself up for some major disappointment.

My method of grading has been to basically grade assignments in a binary fashion.  Either it’s good enough or it needs to be redone.

The other thing is that I’m determining grades by number of assignments that are complete.  There are some required assignments which everyone must do to pass the class.  Then there are 9 optional assignments.  To get an A, you must complete 7 of those.  A B requires six, and a C requires five.  I didn’t mention the alternatives.

The last two assignments are Matlab assignments.  The one before that is writing up a technical presentation.

For me, I’d much rather do coding than write up a presentation.  (Yuck!)

Most of my students don’t agree.  In fact, based on my first two classes, it looks like less than 10% will be doing either of the matlab assignments.  I’m guessing this will be worse in my Thursday classes because of my cancellation of class last week.

I have to admit that I’m rather shocked…and disappointed.  It doesn’t matter what you’re doing in EE: you’re likely going to need to have a good handle on programming.

On the good side, I’ve introduced them to the material.  On the bad side, the horse is standing by the water and not drinking.

I’m trying to decide, assuming I teach this class again in the future, whether it’s worth it to develop a somewhat scaled down assignment.  Is it better to get them doing a small amount of coding, or is it better to have a bit more breadth in their initial exposure?

Maybe I’ll do an eval at the end of the semester so I can find out.  In the meantime, I’m still bummed out that most of them aren’t going that route.

Forgetting how to be inexperienced November 8, 2011

Posted by mareserinitatis in computers, engineering, teaching.
Tags: , ,
4 comments

I learned to program when I was 9.  My grandmother gave us an old TI-35 console that hooked up to a TV and a tape deck to record the programs.  (Yes, as in cassette tapes…)  She failed to get any games or other programs to run, so in order to get anything useful out of it, I had to learn to program.

It was a huge disappointment for me: I’d really wanted an Apple IIc so I could play Oregon trail on the phosphorescent green screen like I did at school.  On the other than, with 25+ years of knowledge and experience, I think it was the best gift I could’ve ever gotten.  I can make a living programming…but I can’t playing Oregon Trail.

My goal this week was to pass on some of that appreciation of programming to my students.  (I guess I can almost say next generation since my own son is just a couple years behind my students.  That’s sad.)  My informal polling in class has made me realize that only about a quarter of my students have ever programmed in any language ever.

I could have understood this when I was in college…not everyone had access to computers.  It seems like the ubiquity of computers doesn’t necessarily mean one will necessarily have experience using them other than at an apps level.

So I decided they should probably get at least a cursory knowledge of a useful programming language.  Matlab seemed like a good choice because I know several of the upper-level classes use it.  And let’s face it…once you learn to program in one language, it’s easier to go to another.

I found an excellent tutorial.  I liked it because it went through things in a fairly basic manor, which I was sure my students could understand.  It also had exercises.

Unfortunately, my mistake was thinking my students would be able to read, do the examples, and get a decent understanding of how matlab worked.  That’s more or less how I learned it.

Of course…I had already learned other languages when I decided I should learn Matlab.  (It wasn’t around when I was 9, you see…)

I was very surprised to find that the most difficult concept for the students to get was how to write an m-file.  That is, they didn’t understand that you could write a series of commands in the file and then execute the whole file simply by typing the m-file name in the command window.  They wanted to print out the command window or copy and paste their results into the m-file from the command window.

I have to admit that I was impressed with their creativity…but confounded by all the strange things they were attempting.

Finally, I went through a five-minute explanation of the differences between the command window and an m-file, and how the two work.  That seemed to clarify what needed to be done for many of the students.  When I took this approach with my second class, they seemed very calm and significantly less frustrated than the first class.

I really hoped this would be a positive introduction to programming for the students, but I can tell I’ve managed to make it frustrating for one group.  I guess it’s really hard to put myself in their place and figure out where they’re going to have problems.  It’s only when I throw some of them in and see how they react that I can change my approach to fit their needs.

Teaching any class for the first time is a frustrating experience.

The Program Prayer February 9, 2011

Posted by mareserinitatis in computers.
Tags: , , program prayer
4 comments

A few of you know that I’m having to relearn Fortran.  It was the first college class I took (while still in high school), and the version I’m learning now is considerably newer.

As I’m going through this, I’m remembering why I like Matlab.  The one thing that bothers me about Fortran is that it will deal with integers and reals in different ways, and that can be problematic if you have a mixed-type operation.  My main irritation with Matlab is that I will use i as a counter and later try to use it as an imaginary value.  (Of course, I always forget I can use j because that’s just not proper…I still have difficulties adjusting to that usage in certain contexts.)

I’ll bet I’m not the only one who gets annoyed at various language quirks.

Anyway, while digging through some files, I came across something from the same time period I took Fortran.  In fact, the printing on the paper is from a dot-matrix printer. If there is one thing I am thankful for, it is that technology has created quieter printers.

The Program Prayer

Our program, which art in memory,
“Hello” be thy name.
Thy operating system come,
Thy commands be done,
On the printer as it is on the screen.
Give us this day, our daily data,
And forgive us our I/O errors
As we forgive those whose logic circuits are faulty.
Lead us not into frustration,
But deliver us from power surges,
For thine is the algorithm, the application, and the solution,
Looping forever and ever.
Return.

Follow

Get every new post delivered to your Inbox.

Join 1,265 other followers