Skip to main content

Posts

Showing posts with the label Differentiation

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

Stop trying to be a hero. Start being a mechanic.

Get the book →

The Sheet Mechanic on Amazon. Affiliate link, I earn from qualifying purchases.

Calculate First Derivatives with Numerical Method Using Excel VBA

In the previous post, Numerical Methods - First derivative using Excel formula , we learned how to calculate the first derivative of functions using standard formulas in the spreadsheet grid. While effective, that method can be cumbersome to set up for repeated use. In this post, let's see how we can simplify the process by creating a reusable custom function using Excel VBA (Visual Basic for Applications) . Instead of downloading a pre-made file, follow the steps below to build this powerful tool yourself. Advertisement The VBA Code Solution The following code implements the Five-Point Stencil method for high precision. It defines the mathematical function f(x) and a derivative function fDeriv(x) . Step 1: Open Excel and press Alt+F11 to open the VBA Editor. Step 2: Go to Insert > Module . Step 3: Copy and paste the code below into the module window. ' ================================================ ' Created ...