Skip to main content

Featured Post

Stepper vs Servo Motor: Torque, Lost Steps & Control Explained

In automation design, the choice between a Stepper Motor and a Servo Motor is often decided by budget. But looking at the price tag alone is a mistake that leads to machine failure. Steppers are excellent for holding loads stationary (high holding torque). Servos are kings of high-speed motion. If you choose a stepper for a high-speed application, it will lose torque and "miss steps." If you choose a servo for a simple low-speed application, you have wasted $500. This guide explains the physics behind the choice. Table of Contents 1. Open Loop vs. Closed Loop (The Risk) 2. The Torque Curve: Speed Kills Steppers 3. Inertia Mismatch 4. Selection Summary Advertisement 1. Open Loop vs. Closed Loop (The Risk) The biggest difference is not the motor itself, but how it is controlled. Figure 1: Steppers run "blind" (Open Loop). Servos use an encoder to verify position (Closed Loop). ...
Disclosure: As an Amazon Associate, I earn from qualifying purchases.

Gauss Elimination: Partial Pivoting & Zero Errors (Part 3)

Visualization of Partial Pivoting in Gauss Elimination to prevent division by zero

Figure 1: Partial Pivoting involves swapping rows to avoid zero pivots.

The "Fatal Flaw" in Basic Code

In our previous post, Gauss Elimination (Part 2), we derived the mathematical foundation of the algorithm. However, if you implement that raw math directly into code (VBA, MATLAB, or C++), your program will eventually crash.

Why? Because the basic algorithm assumes the diagonal element (the pivot) is never zero. In the real world of engineering simulations, zeros happen frequently.

Advertisement

The Problem: Division by Zero

Let's look at a standard solvable system of equations:

The first step of the algorithm is to normalize the first row by dividing by the coefficient of x1 (which is 5). Since 5 is not zero, this works perfectly.

But what if the equations were rearranged?
Mathematically, the order of equations doesn't matter. But computationally, it changes everything. Look at this arrangement:

Here, the coefficient of x1 is 0. The computer attempts to divide by zero, resulting in a runtime error.

The Hidden Danger: Small Numbers

Even if the number isn't zero, but is very small (e.g., 0.000001), it causes Round-off Errors. Dividing by a tiny number creates a massive result, which can cause the computer to lose precision in the remaining digits. This is known as an "Ill-conditioned system."

The Solution: Partial Pivoting

To solve this, we use a technique called Partial Pivoting. Before performing the elimination step on a column, the algorithm must:

  1. Search: Look down the current column (below the diagonal).
  2. Identify: Find the row with the largest absolute value.
  3. Swap: Switch the current row with that row.

By ensuring the largest possible number is always in the pivot position, we avoid division by zero and minimize round-off errors.

Advertisement

Next Part: The Final Code

Now that we understand the logic and the safety features required, we are ready to build the robust Excel VBA tool.

Continue to Part 4:
Solving System of Equations using Gauss Elimination Method (Part 4: The Final Program)

References

Comments

Popular posts from this blog

Dowel Pins & Locating Pins: The Basics of Fixture Design

Figure 1: A typical fixture setup. Notice how dowel pins (silver) provide precise location, while bolts (not shown here) provide the clamping force. In the world of Precision Engineering , the difference between a high-quality product and a scrap part often comes down to microns. While bolts hold parts together, they are terrible at positioning them. This is where Dowel Pins and Locating Pins become essential components in industrial tooling . Advertisement What is a Dowel Pin? Dowel pins are precision-ground fasteners used to secure the relative position of two parts. They are typically machined to extremely tight tolerances (often within 0.0001 inches) and are available in materials like: Hardened Steel: For high-wear applications in CNC fixtures . Stainless Steel: For corrosion resistance in medical or food processing machinery. Plastic (Thermoplastic): For lightweight, non-conductive, low-load alignment. The ...

Hoeken's Linkage: Kinematics and Walking Robot Design

Figure 1: Animated simulation of the Hoeken’s Linkage showing the characteristic "tear-drop" coupler curve. 🚀 New Design Guide Available Don't just read about it—build it. Check out our new tutorial: How to Design a Hoeken’s Linkage in Excel (with Free VBA Simulator) » Introduction to the Hoekens Linkage The Hoekens linkage is a specialized four-bar mechanism designed to convert rotational motion into an approximate straight-line motion. While it serves a similar purpose to other straight-line generators, its unique coupler curve—a "tear-drop" shape—makes it exceptionally useful for intermittent motion and walking machines. One of the most fascinating aspects of kinematic theory is the concept of "Cognates." The Hoekens linkage is actually a cognate linkage of the Chebyshev Straight-line Mechanism . This means that while the physical structure and link lengths differ, they can generate...

Engineer's Guide to Ball Detent Torque Limiters

Figure 1: The ball detent mechanism provides precise overload protection by disengaging instantly when the torque limit is exceeded. The First Line of Defense: Overload Clutches In high-speed automation and heavy industrial machinery, a "jam" is not a matter of if , but when . Whether it is a cardboard box getting stuck in a packaging machine or a tool crashing in a CNC lathe, the resulting torque spike can destroy gearboxes, twist shafts, and burn out expensive servo motors in milliseconds. A torque limiter (or overload clutch) is the mechanical fuse of the drive system. While electronic monitoring (current limiting) is common, it is often too slow to prevent physical damage from the massive kinetic energy stored in the system inertia. A mechanical torque limiter provides a physical disconnect that operates in a fraction of a second. Search for Torque Limiters & Safety Couplings Advertisement Why Choose ...