[No. 86] Sanity check

 

Fig. 1 Pickett N3-ES Slide-rule
Fig. 1 Pickett N3-ES Slide-rule

There is an old story about the engineer who was asked to multiply 4 × 3, who took out a slide-rule, and who declared the result to be “about 12”. While this is a cruel caricature of an engineer, it would be less disrespectful had the question been to find 3.8π. With a slide-rule the answer is 11.94, and this can be found as easily and as quickly as 4 × 3 (but nowhere near as quickly as 4 × 3 can be given by the 10-year-old school-kid who knows the first few multiplication tables). With a standard 10-inch slide-rule, greater precision is not possible by the simple procedure using the D and CI scales. The average 10-year-old school-kid would have more trouble with “3.8 pi” or 3.8π. But an engineering student should be able to manage it approximately by mental arithmetic, saying that 3.8 is a bit less than 4 while π is a bit more than 3, so the result will be somewhere around 12.

An internet search for “3.8 pi” yields 11.9380521 even without opening a web page, and it does this almost instantaneously. I could say that the computer is faster, more convenient, and more precise; and this is true if I am sitting in front of it, and it is switched on, and the internet is available. These conditions are not always satisfied, and that’s why I still use a slide-rule, especially in my workshop / laboratory, where I need quick answers and the slide-rule gives adequate precision. Indeed I have a special slide-rule in my workshop, where there is sometimes swarf and oil, and the environment is sometimes not ideal for a computer, or even a calculator. If you want a calculator to survive a dusty, oily environment, maybe an abacus would work. All the other gadgets need to be kept squeaky-clean.

The slide-rule is also thousands of times less expensive than a computer. The one in Fig. 1 is a top-quality American all-metal slide-rule that cost about $10 in 1967, nearly 60 years ago. It has been used continuously since that date. No computer can come anywhere close to these figures. The last time I bought a calculator (hp 32S 50th Anniversary model) it cost about $200, more than 20 times the price of the slide-rule. Spare batteries cost more than the price of the slide-rule. My last computer cost $2500 (with screen, keyboard, software all extra; continuous supply of electricity, extra).

I use the slide-rule and the calculator regularly, and always in preference to the computer. I do calculations with the computer only when it is absolutely necessary. How often is “absolutely necessary”? Nearly all the time! That’s because engineering calculations are often too complicated for slide-rules or even programmable calculators: they involve huge amounts of data and they are often nonlinear and iterative, with multiple variables. But this raises an important question: how do we check computer calculations, to verify that they are correct?

Fig. 2  IPM flux-plot at no-load
Fig. 2 IPM flux-plot at no-load

Probably every engineer who runs sophisticated engineering analysis software confronts this question all the time. It is a deep philosophical question. It does not have a single answer and it does not have a simple answer.

One very common method is the so-called sanity check. Every engineer probably has sanity checks of several kinds, appropriate to the particular calculation.

As an example, consider the EMF generated in a PM brushless machine, Fig. 2. The bore diameter is 117.2 mm and the stack length is the same. Obviously there are four poles. If we assume that the peak value of the fundamental space-harmonic of air-gap flux-density on open-circuit is 0.85 T (a typical value with high-energy magnets), the fundamental flux/pole will be 0.85 × 0.11722 /2 = 5.84 mWb. Now suppose we have a lap winding with 96 turns in series per phase, and a winding factor of 0.95. The peak value of the fundamental flux-linkage per phase is then 96 × 0.95 × 5.84 = 0.533 Vs. Suppose the speed is 2,800 rpm. Then the fundamental frequency is 2800/60 × 2 = 93.3 Hz, and the generated EMF per phase is 4.44 × 0.533 × 93.3 = 220 V RMS. The finite-element calculation gives 216.96 V. 1 All we needed for the sanity check was a standard formula and an estimate of the flux-density, based on experience with similar machines.

A more precise calculation requires the use of a computer with finite-element software to compute a reliably accurate value of the magnetic field over a range of rotor positions spanning one pole-pitch or some ‘symmetry fraction’ thereof; then to apply Faraday’s law by numerical differentiation to obtain the EMF waveform; then the fundamental harmonic component must be extracted using Fourier series (not the FFT), and the RMS value is taken. This is a complex and expensive process, but it is a necessary process: electric machines can hardly be designed without these facilities. But if we have these facilities, how can we be sure they are giving the correct result?

This question splits into parts. In the first place, there is the question of the accuracy of the software, and even of the processor that runs it. It is better to think separately of the precision of the software, and its appropriateness for the job in hand, and the proficiency of the user. It is common to assume that in the case of finite-element software, the precision is generally beyond question, especially for normal machine design purposes.

The accuracy then depends on the appropriateness, or the choice of the right software and the right process for the job. It also depends on the proficiency of the user, who must ensure that the correct methods are chosen, with the correct input data (which includes material property data). These aspects are subject to human error, and that is why the sanity check is so important and useful. It is not so much a question of checking the integrity of an expensive computer or an expensive suite of computer programs; it is more a question of having a personal means of checking, Have I done this right? My go-to for this check is the slide-rule; or the hp calculator. These friendly inexpensive tools are checking my own “sanity”, and my proficiency in using the computer, rather than the integrity of the results I see on the computer. Sanity checks should be personal!

There are many other ways to verify computed results. What I cannot do is to send the computer back to the manufacturer with a request to check my calculations. Even if that were possible, it would cost a lot of money, and it wouldn’t prove the physical accuracy of the calculations: it would only verify the precision and integrity of the purchased computer and the purchased software.

But here are some suggestions taken from common experience. We can make up an acronym, PVC — Physical testing, Variation, and Comparison.

Physical testing — By far the most important test of accuracy is physical testing of the machine in the test-house. This is also expensive! Ideally it should include the measurement of everything that can be measured, including weights, costs, temperatures, resistances, currents, voltages, torques, speeds, losses, efficiencies, and so on. Note that all of these are plural, either because they have many components or because they have different values depending on the operating condition.

Variation — Parameter variation is an integral part of the design process, but it also presents opportunities for checking the integrity of the calculations. In many cases, the engineer will have an expectation of the result of a parameter change. The expectation might come from intimate knowledge of the machine that is being analysed; or it might be nothing more than a “sixth sense”. If the calculated effect of the variation matches the expectation, well and good; but if it doesn’t, it could be a red flag. A red flag for the integrity or accuracy of the calculation? Possibly. But it could also be a red flag for the depth of the engineer’s understanding. For example, suppose we change the wire in an induction motor from copper to aluminium. The resistivity will increase from about 1.7 to about 2.7. Does that mean the losses will increase in the ratio 1.6? If the wire resistivity is the only parameter varied in a design calculation, that is what will happen; but it is only theoretical. In substituting aluminium for copper we must reconsider the physical dimensions of the winding, especially the slot-fill factor (and therefore the wire gauge) and the overall length (which will vary because of the difference in mechanical properties) and also the temperature (which will vary if the losses vary). The parameter variation is not testing the integrity of a computer design calculation, so much as it is exercising the wider design skill of the engineer, and consolidating his or her proficiency. It’s a sanity check. If the computer calculation gives 1.6, it will be wrong — not because the software is wrong, but because the engineer overlooked some important related parameters: a proficiency deficit, we might say,

Comparison — You could run the same finite-element calculation in another brand of finite-element software. Probably few people do this, because they would need to pay twice the software licence, invest twice the effort in learning the software, and spend twice as much time running the calculation. It is likely to produce comparable results with small differences that are highly irritating (because they don’t reveal any errors in either software, or in the engineer’s proficiency). This situation is more likely to arise when the company changes the finite-element software for some reason — a change that can be very disruptive. Another “trick” is to switch the computer off and repeat the calculation the following day, to see if there is any difference. It may sound daft: but it can happen that results are obtained and saved in files without saving the input parameters. Here we are thinking about sanity checks, and of course you can compare the results of a finite-element calculation with a back-of-the-envelope calculation, or with another type of program (including in some cases very old design programs written years ago in individual companies). That’s not likely to disqualify a well-established finite-element process (or any other engineering design program for that matter), but it certainly is a sanity check.

So can we use a slide-rule to check a finite-element analysis? Sure, as long as it’s only a sanity check.

Notes

1 The values in this example are taken from [2], and the coefficient 4.44 (often used in slide-rule calculations and old textbooks) is 2π/√2. Fig. 2 was computed by Yves Thiolière of Powersys.


References

[1] Hendershot J.R. and Miller T.J.E., Design of Brushless Permanent-Magnet Machines, Motor Design Books LLC, ISBN 978-0-9840687-0-8, 2010, sales@motordesignbooks.com (Green Book)

[2] Hendershot J.R. and Miller T.J.E., Design Studies in Electric Machines, Motor Design Books LLC, ISBN 978-0-9840687-4-6, 2022, (Blue Book)

PROFILE

Prof. Miller was educated at the universities of Glasgow and Leeds, U.K., and served an industrial apprenticeship with Tube Investments Ltd. He worked for G.E.C. in the U.K. and General Electric in the United States. From 1986-2011 he was professor of electric power engineering at the university of Glasgow, where he founded the Scottish Power Electronics and Electric Drives Consortium. He has published more than 200 papers and 10 books and 10 patents, and he has given many training courses. He has consulted for several industrial companies in Europe, Japan and the United States. He is a Life Fellow of I.E.E.E. and in 2008 he was awarded the Nikola Tesla award.

The Green Book: “Design of Brushless Permanent-Magnet Machines”

The Blue Book: “Design Studies in Electric Machines” (June 30, 2022)