Happenings – 2012 Sep 29

First of all, news about the blog. Sometime this past Tuesday night the blog had 200,000 hits since inception almost 5 years ago. The daily record remains 542 hits… the weekly record is 1911… and the monthly record is 7077.

I was reminded of another reason to go with the extended keyboard… on the old Apple keyboards, shift–return executes all of the Mathematica® commands within a selection. I frequently use that to execute earlier sections of a problem I’m working on.

Having looked this morning for more news about the seismologists on trial in Italy, I find that the prosecution has made its closing arguments… it has asked for four-year prison sentences for the seismologists as well as for the civil servant who actually made the falsely reassuring statement that there would be no earthquake in the near future. The trial will resume on October 9, at which time the defense will make its closing arguments. A search on “Italy seismologist” will turn up this recent news. My initial post on this is here.

I have begun taking an online class, through coursera.org… this is an introduction to the R statistics package, which is the free open-source analogue of S-plus. Owning Mathematica, I doubt that I will ever use R for statistics… but, who knows? It has powerful tools for cleaning up missing values, and if anyone ever gives me an S–plus data set, I would be able to read it using R. And I have more than a few books which are based on S-plus. Knowing something of R may help.

Finally, I have some ideas for a post this Monday. Control theory is a pretty solid bet, but I don’t actually have even a draft of the mathematics… this alleged post is at stage II. Well, maybe it’s a little closer to stage III. We’ll see what happens, won’t we?

Control Theory: Transfer Functions and Output Response

edited: 11/14/2012 to replace “sum” with “product”; search on (edit)
edited: 1/12/2013 to replace “gain margin” with “phase margin”; search on (edit)

Introduction

Let emphasize that we require Mathematica® version 8 for the following. Prior versions required an add-on, Control System Professional. The commands are a little different now.

We’ve seen one example of using Laplace transforms to solve an ordinary differential equation. Frankly, that’s not enough, so if they’re new to you, you’ll need to study up on them.

Now I want to move on and introduce transfer functions. I hope you recall – or that it at least sounds familiar – when I say that Laplace transforms incorporated the initial conditions into the solution. Instead of getting a general solution with unknown constants, we get a specific solution that incorporates all the initial conditions.

Transfer functions are a special case of Laplace transforms – where we set all of the initial conditions to zero. On the other hand, transfer functions are a little more general than Laplace transforms: we use an arbitrary forcing function and arbitrary coefficients in the equation.

What?

Let me show you.
Read the rest of this entry »

Happenings – 2012 Sep 22

In one respect it’s been another very slow week: I’ve had a cold since dawn last Sunday… and when the congestion was bad enough to make my eyes hurt, I bailed on mathematics. I watched lectures from The Teaching Company on 19th century European history.

I had made some progress on a first control theory post, but that stopped fairly soon… hence, no post last Monday. Ironically, to my delight, the blog got more than 300 hits a day Monday thru Thursday.

Right now, nevertheless, I have a controls post thru stage IV: mathematics and commentary are complete. I just need to move text and images to the blog this wekend, and do final edits as usual Monday evening.

Oh, if it were only that simple!

I kept working examples, and I’m already in trouble. I have a Bode plot – two of them even – which I believe says that the output from a unit-amplitude sinusoidal input should be substantially less than 1 for any frequency greater than about .45 rad/sec.

But the actual solution grows, instead of shrinking. Here’s what I get for the time-domain response to a frequency of 1, i.e. to sin(t).


Read the rest of this entry »

Posted in diary. 2 Comments »

Happenings – 2012 Sep 15

Work – what I do to pay the bills – was quite a bit more hectic this week than usual. I was pretty tired at the end of every day.

(Don’t misunderstand, I like what I do for work, but it’s not the same as doing whatever math turns me on. No, I’m not an actor working as a waiter, or a writer working working as a housepainter. Most of my work is to model the performance of power plants, so I do get paid to do mathematical modeling. And I know how fortunate I am to do work that I love. But it’s not always the same as doing what I want.)

Interestingly, the main effect of being unable to do any math of my own during this past week is that I really want to dive into math today… but I mean math, not the writing up of math for a post!

Realistically, I’m hoping that I will either end up writing a post about something because I need a break from math per se, or that I will get the material I need for a post out of the math I do.
Read the rest of this entry »

Linear Programming – The Final Tableau of a Minimization Problem

A Minimization problem

Let me work a minimization problem rather than a maximization. Like the previous problem, this one comes from Loomis & Turban, “Applied programming for management”, 003-078240-6 (pp. 97-99).

A customer asks a butcher to grind up several cuts of beef to form a blend of not less than 17.6% protein and 14.8% fat.

What he has available is

so that table gives us the A matrix and the c vector; the protein and fat requirements give us the b vector. Let the variables be x1, x2, x3.
Read the rest of this entry »

Happenings – 2012 Sep 8

The only math I’ve done this week has been linear programming. It will be worthwhile to put out a second post using a minimization problem instead of a maximum. That is, I discovered I had questions about sensitivity analysis after I finished the minimum problem.

Sensitivity analysis? That’s the part where I said that x2 would enter the optimal solution if its profit rose by 42 cents… and the part where I said the shadow prices on the slack variables told me what I should be willing to pay for more of the resources which I had completely used up.

What happens when it’s a minimization problem instead? I know what I expect… but I haven’t verified the answers.

In addition, I am making progress on understanding the transformation of the cost (or profit) vector from initial conditions to final tableau.

And that’s it for math.

With Federer out of the US Open, I will probably be rooting for Murray. But maybe I should do math instead.

Finally, it turns out that function-shift-return acts as shift-enter on the new Apple keyboards. Well, I like the extended keyboard, so I don’t regret buying it – but now I could also use the default keyboard. What I do regret buying is the separate keypad that the Apple Store guy suggested. My bad… I paid the price (pun intended).

OK, let me get rolling today.

Posted in diary. 1 Comment »

Linear programming – Getting the final tableau given the answer

(That may sound strange. Bear with me.)

Introduction

Every once in a while, I pick up and play with linear programming. This post will show you a couple of elementary ways to set up and solve a small linear programming problem….

But that is not the main purpose of this post.

For the record, Mathematica® has some special–purpose commands for solving large linear programming problems. I believe it handles them as data sets in a standardized format. I also believe its smallest example has more than 30 variables. So, if you need to do linear programming professionally, you should look at Mathematica’s linear programming command.

But if, like me, you pick up linear programming as a student who wants to work his way through a textbook, then you need something else.

Working through a textbook will almost certainly involve tabular displays of the initial problem, a sequence of tabular displays of intermediate non-optimal solutions, and a display of the final optimal solution. Each of these tables is typically called by the French “tableau”, plural tableaux.

You need to know how to get the final tableau, given Mathematica’s solution and the initial tableau (i.e. the initial data).
Read the rest of this entry »

Happenings – 2012 Sep 1

The past week has been another distracting one.

I’ve had Mathematica running on my new desktop Mac since Monday. Oh, one problem with the new Macs is that the latest keyboards no longer have a separate enter key; enter is now shift–return. This makes it difficult to use shift–enter to get the next Mathematica command.

I have no idea what other people are doing, but I simply bought an extended keyboard… it has a numeric keypad, and most importantly, an enter key, on the far right.

After you tell the Apple salesperson that you want an extended keyboard instead of the default, do not let him talk you into buying a keypad instead. The keypad is a separate input device, and does not have a shift key of its own – and hitting shift on the keyboard and enter on the keypad does not effect the shift–enter combination.
Read the rest of this entry »