Skip to main content

Featured Post

Why I Wrote The Sheet Mechanic (And Why Calculations Aren’t Enough)

For engineers who already know the math—but still lose projects. For the last few years, I’ve been sharing technical guides here on Mechanical Design Handbook —how to size a motor, how to calculate fits, and (as you recently read) how to choose between timing belts and ball screws. But after 25 years in industrial automation, I realized something uncomfortable: Projects rarely fail because the math was wrong. They fail because: The client changed the scope three times in one week. A critical vendor lied about a shipping date (and no one verified it). The installation technician couldn’t fit a wrench into the gap we designed. University taught us the physics. It didn’t teach us the reality. That gap is why I wrote my new book, The Sheet Mechanic . This is not a textbook. It is a field manual for the messy, political, and chaotic space between the CAD model and the factory floor. It captures the systems I’ve used to survive industrial projec...
NEW RELEASE: Stop trying to be a Hero. Start being a Mechanic. Get "The Sheet Mechanic" on Amazon »
Disclosure: As an Amazon Associate, I earn from qualifying purchases.

Gauss Elimination: Dynamic N x N Scaling (Part 5)


Figure 1: Visualizing dynamic matrix scaling for large engineering systems.

Scaling Up: Handling N x N Systems

In Part 4, we looked at the basic user interface. But engineering problems aren't fixed at 3x3. A truss analysis might need 10 equations; a thermal grid might need 100.

A professional Excel tool must be Dynamic. It should automatically resize the input table based on the user's needs, clearing old data and preparing fresh cells for input.

Advertisement

1. User Input for Dimensions

The process starts with a simple input request. In our design, clicking "Main Menu" > "New Equations" triggers a VBA InputBox or UserForm asking for the number of variables (N).

Figure 2: The user selects "New Equations" from the main menu.

For this example, let's input 10 to simulate a larger structural problem.

Figure 3: Specifying a 10-variable system.

2. Managing Data Integrity

When resizing a matrix, you must decide what to do with old data. Our reference design includes a safety check: "Existing equations will be deleted." This prevents users from mixing data from a 3x3 problem with a new 10x10 grid.

Figure 4: A safety warning prevents accidental data loss.

3. Automating the Resize (VBA Logic)

Behind the scenes, your VBA code needs to do the heavy lifting.

How it works conceptually:

  • Clear Range: The code identifies the old range (e.g., B3:D5) and runs .ClearContents.
  • Redefine Range: Based on the input N=10, the code calculates the new range (B3:K12).
  • Formatting: It applies borders and background colors to the new range so the user knows exactly where to type.
Figure 5: The spreadsheet automatically formats a clean 10x10 input grid.
Advertisement

4. Solving the Large System

Once the data is entered, the Gauss Elimination algorithm we wrote in Part 1 handles the 10x10 matrix just as easily as the 3x3.

Figure 6: Inputting coefficients for a larger system.

Clicking "Solve" populates the 10x1 result vector instantly.

Figure 7: The algorithm computes the 10 unknowns instantly.

5. Verification: The MMULT Function

Trust but verify. A good engineer always checks the results. In Excel, you can use the built-in function =MMULT() to multiply your original [A] matrix by the calculated {X} vector.

If the result matches your original {B} vector, the solution is correct.

Figure 8: Using MMULT to multiply [A]*{X} confirms the solution matches {B}.

Conclusion

By combining robust math (Gauss Elimination) with smart VBA (Dynamic Ranges), you can build powerful engineering tools that rival commercial software.

In the final post, we will share a video demonstration of this tool in action.

Continue to Part 6:
Solving System of Equations using Gauss Elimination Method (Part 6: Video Demo)

Comments

Popular posts from this blog

Dowel Pins & Locating Pins: The Basics of Fixture Design

Dowel pins are precision cylindrical pins used for accurate part alignment in assemblies. They control position, not clamping force. This guide explains tolerances, fits, sizing rules, and design best practices. 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-wea...

Ball Detent Torque Limiter – Working Principle & Selection

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 ...

Perfect Straight-Line Mechanisms: Peaucellier-Lipkin & Sarrus

Figure 1: A modern interpretation of the Peaucellier-Lipkin linkage, showing the generation of a perfect straight line from rotary input. The Quest for Perfection In the world of kinematics, most straight-line generators (like the Hoekens Linkage or Watt's Linkage) produce only an approximate straight line. For general machinery, this is sufficient. However, for precision instrumentation and high-seal applications, engineers require exact straight-line motion . This post explores the two most famous solutions to this problem: the planar Peaucellier–Lipkin linkage and the spatial Sarrus linkage . Search for Precision Machine Design Books Advertisement 1. The Peaucellier–Lipkin Linkage (Planar) Invented in 1864, the Peaucellier–Lipkin cell was the first planar linkage capable of transforming rotary motion into a perfect straight line without using any reference guideways or sliders. The Mathematics: Inversion...