Happenings – 2013 Feb 2

I think I’m going to do something different this weekend… and I don’t know that it will lead to a technical post on Monday… but it seems to be what I need to do.

Play with MATLAB. We’re using it in two of the courses I’m taking – Image Processing, and Control of Mobile Robots. So I’ve got a backlog of work in the Image Processing class, and I ought to get moving in the Controls class. On top of it all, as I’ve said before, I’ve got a hefty pile of books that use MATLAB.

Now, the student version prohibits me from using it for commercial or professional purposes. I don’t care to argue with them over whether this blog is “professional”, so unless I buy my own full-fledged version, I believe that it is simpler to not publish any of my MATLAB exercises out here – not unless I move up from the student license.

So I’ve got MATLAB itself to play with, and Simulink… and toolkits for image processing, controls, and symbolic calculations, and wavelets… and more, but that’s a heck of a lot to look at already.

Unless something quick and easy pops into my head over the weekend, I expect no technical post to go out this Monday. I expect to be doing plenty of applied mathematics, I just don’t expect to publish any of it.

The Economic Order Quantity – a simple calculus application

The EOQ (Economic Order Quantity) formula is a deceptively simple model. It comes from Zipkin’s “Foundations of Inventory Management” (Irwin/McGraw-Hill, 2000, 0-256-11379-3) and it is the very first model in the book. It was first published 100 years ago, in 1913 – the model, not the book!.

When all is said and done, it’s a simple application of freshman calculus.

Imagine that we sell or use up one product, at a known constant rate \lambda\ . Periodically, we order more of this product, to replenish our inventory I(t). Further, there is a known constant lead time L – between when we place an order and when we receive it (actually, when we can sell or use it, so this includes unloading and storing). If our inventory will go to zero at t = T, then, at the very latest, we must place an order at T – L:

EOQ 1
Read the rest of this entry »

Happenings – 2013 Jan 26

Since putting out the latest technical post, I haven’t done a whole lot. I’m falling a little behind in my two Coursera classes (Intro Computational Finance, and Image Processing)… I have not been playing with Matlab, not much anyway… I have an idea for the next control theory post, but I don’t know about getting it done this weekend.

Still, I have a couple of ideas other than control theory for a short technical post this weekend, and I hope to put some time into Matlab. And to catch up on the assignments and the lectures for my classes – a third one (Control of Mobile Robots) starts this Monday… the fourth one (Signal Processing) starts on Feb 18, a week before the first one ends – so I’ll be taking 4 classes for only one week. Whew!

We’ll see how it goes.

Control Theory – Example 3: PI, PD, and PID

There’s something I forgot to do when I looked at PID tuning: I meant to look at the Bode plots for the controllers, literally to see what they do individually. In addition, I’m going to mention real derivative control; I’ve long known that the simple PID includes “ideal” derivative control, but I only just realized just how unrealistic it is.

It’s probably just as well that this end up in a separate post.

Let’s just dive in to Bode plots.

PID with Ziegler-Nichols rules

Recall our plant… first the definition, then the resulting transfer function.

con 1 21 1

We found, by looking at the gain margin for the open loop Bode plot of the plant that the ultimate gain and ultimate period were 10 and 2 \pi\ :

con 1 21 2
Read the rest of this entry »

Happenings – 2013 Jan 19

I’m slowly getting back into the saddle. As you can see, a technical post went out last Monday… the first in quite some time. Well, things slowed down around the holidays. We’ll see, however, if I manage to write up a tech post this weekend.

I am also being distracted by taking two classes thru Coursera. In addition to the Computational Finance, I’m now taking one of the image processing classes “… from Mars to Hollywood….” As a bonus, Cousera/Duke University arranged for students to be eligible for the student pricing on Matlab… so I will finally get to play with Matlab. Not only is it the preferred language for the course, but also lot of my texts have Matlab code… which I’ve never been able to run.

Control Theory: Example 3 – Ziegler-Nichols and Tyreus-Luyben Tuning Rules

Edit 21 Jan 2013: added “Example 3” to the title.

Introduction

I’m going to jump right in and imagine that we have a known plant which we wish to control using P, PI, or PID. I’m going to assume that you have some idea what those are. We’ve seen proportional (P) control, where the control signal is proportional to the error. Integral control has a signal which is proportional to the integral of the error, and derivative control a signal which is proportional to the rate of change (the derivative) of the error. Proportional control is always used in conjunction with integral, hence PI. Although derivative control can be used with only proportional, in process control we generally use both integral and proportional with it, hence PID. We’ll talk more about them in subsequent posts, but for now I want to show you two ways to get the required parameters. They may not always be very good values, but they’ll be better than in the ballpark. At the very least, they are good starting values for further investigation.

Oh, I am aware that Mathematica® version 9 has new capabilities for tuning controllers – but let me write about what I know, using version 8.

My plant is a 3rd-order transfer function… as usual, rules are a convenient way to specify things:

con 1 14 1
Read the rest of this entry »

Happenings – 2013 Jan 12

Well… I have just about finished my dead-tree annual letter, so I can start getting back into the blog.

I put out 93 posts in 2012, 52 of which were my diary (“Happenings”) posts, so only 41 technical posts. The blog got about 81,000 hits during 2012, an average of about 222 hits per day – but as usual, interest picks up as time goes by… the last three months were far more active than the first three… 300 hits in a day no longer looks unusual.

Here’s a picture of the monthly totals for about the past 2 1/2 years:

2012 monthly hits

For the year, the first poker hands post was the most popular, followed closely by the CIE chart; these stand in reverse order all-time – that is, the CIE chart is still number 1 all-time.

Here’s a picture of the all-time leaders (every post with more than 3000 hits total):
Read the rest of this entry »

Happenings – 2013 Jan 5

I haven’t even finished Xmas yet – still more friends to visit and gifts to exchange. I’m not planning a technical post for this Monday. Heck, I’m not even going to try yet to summarize the past year on the blog – I’m still working on my annual dead-tree letter.

I have, however, found an excellent reminder that whatever you read on the Internet should be viewed with caution. (A lesson we should have learned about whatever we hear during election campaigns, too.) It seems that some person or persons has been promulgating a completely fictitious war about 500 years ago, on Wikipedia. The material was just removed – after 5 years. If it’s important to you, check multiple sources.

(I do realize that I’m trusting Wikipedia when it says the article about that war was untrustworthy.)

Now let me get back to the rest of my life.

Happenings – 2012 Dec 29

Christmas vacation continues.

I was away from home over Xmas, from the Saturday afternoon before until the Wednesday evening afterwards… I visited an old friend in Sedona AZ, driving there in two cars with two other friends, but returning alone. It amounted to 500 miles of my driving on Sunday, and 750 on Wednesday. Whew!

Thursday I got caught up on the Coursera class (“Introduction to Computational Finance and Financial Econometrics”) I’m currently taking. This week there was a mistake in a lecture example which was not corrected in the supporting slides. Tsk.

Yesterday I read a little about The Standard Model of elementary particles, but mostly I worked on my annual end-of-year letter. And in the evening I watched some Teaching Company lectures on modern European history (i.e. starting in 1715, with the death of Louis XIV; ending on the eve of World War I).

Today I’ll try to do a mixture of math and the annual letter, and perhaps some more European history in the evening. No, I do not expect a technical post to go out on this Monday, New Year’s Eve.

Happy New Year.

Posted in diary. 1 Comment »

Happenings – 2012 Dec 22

I’ve been doing holiday stuff and work, of course, this past week… now I’m off until Jan. 2… but I have lots of holiday stuff to do.

Oh, so much for the Mayan apocalypse – but did you (a reader of a math blog) really expect the world to end yesterday?

I’ve started a computational finance course from the University of Washington, thru Coursera… one week in, it’s everything the previous course, from Georgia Tech, should have been but wasn’t; I certainly hope it maintains this level. It has lectures with clear examples… although there have been some mistakes in the lectures, they are corrected in the downloadable slides… plenty of background tutorial material in Excel and R for anyone who needs it. (And I can use some of the R training. A four-week class got me up and running in R, but I’m still an apprentice at it. I still want to see journeyman-level solutions.)

Well, I have to get back to holiday preparations. For those of you who celebrate Xmas, whether as a sacred event or secular, I wish you a happy holiday.