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:

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.


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.