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

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

Taper-Lock Bushing Failures: The Physics of Wedge Angles

The Failure Scenario: A technician is installing a heavy 20-inch cast-iron V-belt sheave onto a motor shaft using a standard Taper-Lock® bushing. To make future removal easier, they apply a generous coat of anti-seize lubricant to the tapered surface. They tighten the set screws with an impact wrench. Instantly, a loud "CRACK" echoes through the shop. The massive cast-iron hub has split perfectly in half. The Cause: The technician misunderstood the physics of mechanical wedges and friction. By lubricating the taper and using unregulated torque, they generated a radial expansion force that exceeded the Ultimate Tensile Strength of the cast iron, causing a catastrophic hoop stress failure. Tapered bushings (including Taper-Lock and QD styles) are the industrial standard for mounting sprockets, gears, and pulleys to shafts. They rely on the mechanical advantage of a wedge to create massive clamping friction. This guide explains the physics of wedge mechanics, the de...

Polynomial Cams: Analysis & Design Pitfalls (Part 3)

Figure 1: Mathematical coefficients determine the physical shape. Poor math leads to physical defects like the "dip" shown on the right. In [ Polynomial Cam Function (Derivation of Fifth-degree function) - Part 2 ], we derived the equations for the Fifth-Degree (3-4-5) Polynomial . Advertisement Now, we apply this math to the real world of Mechanical Cam Design . The shape of the physical cam is determined by plotting these functions. Unlike a standard Cycloid curve, the polynomial allows us to manipulate the Start Velocity (v 0 ) and End Velocity (v 1 ) of the follower. However, this flexibility requires careful design. If the coefficients are not balanced, the physical cam profile can develop "dips" or negative slopes, causing the mechanical linkage to behave unpredictably. Case 1: Standard Dwell-to-Dwell (Zero Velocity) Figure 2: The standard profile (v 0 =0, v 1 =0). Safe, smooth, and ide...