Unlocking the Power of Functions in Methvin: Advanced Equations, Variables, and Automated Pricing for Smarter Cost Estimation
Methvin provides a variety of functions to streamline calculations, whether you're managing complex construction projects or handling simpler measurements. These functions are designed to improve accuracy and simplify your workflow. Methvin supports a wide range of functions, including basic arithmetic, advanced JavaScript-based calculations, and date functions for managing project timelines. These functions are categorized into the following sections:
- Quick Functions
- JavaScript Math Functions
- JavaScript Date Functions
- Project Financing Example
1. Quick Functions
These are commonly used functions for quick calculations.
Density of Mild steel
- [skg]: Returns the density of mild steel in kg/m³.
- Example: [skg] returns 7850.
- [slb]: Returns the density of mild steel in lb/ft³.
- Example: [slb] returns 490.636.
Mathematical Constants
- [PI]: Returns the mathematical constant pi (π), approximately 3.14159.
- Example: [PI] returns 3.14159.
Using Global Variables in Equations
Global variables are user-defined values set within the estimating application. These variables can be seamlessly utilized in the Takeoff Tool’s equation field, allowing for automated calculations based on predefined project-wide values.
By incorporating global variables, users can efficiently standardize and automate measurements that share a common value across multiple takeoff elements.
Examples of Global Variables:
- [CD_GV] – Contract Duration
- [NF_GV] – Number of Floors
- [GPA_GV] – Gross Plan Area
- [WH_GV] – Working Hours on Site
This functionality enhances consistency and accuracy in estimating, ensuring that key project parameters are applied uniformly across all relevant calculations.
Power Calculation
- Computes the power of a number.
- Example: 2^3 returns 8.
Square Root
- Computes the square root of a number.
- Example: 4^(1/2) returns 2.
Conditional Statements
- Performs logic-based outcomes based on conditions.
- Example: if(10 > 5) {55} else {66} returns 55.
Bill Item Quantity
- [qty]: Returns the quantity associated with a bill item.
- Example: [qty] returns 100 (or the specified quantity).
2. JavaScript Math Functions
These functions utilize JavaScript for advanced mathematical operations.
Basic Math Functions
- E: Euler’s constant, approximately 2.718.
- Example: Math.E returns 2.718.
- PI or [PI]: Returns the mathematical constant pi (π).
- Example: Math.PI returns 3.14159.
Logarithmic Functions
- LN(x): Returns the natural logarithm of x.
- Example: Math.LN(2) returns 0.693.
- log(x): Computes the natural logarithm of x.
- Example: Math.log(10) returns 2.3026.
- LOG(x)E: Calculates the logarithm of x in base E.
- Example: Math.LOG(2) returns 0.3010.
Rounding Functions
- ceil(x): Rounds x up to the nearest integer.
- Example: Math.ceil(2.1) returns 3.
- floor(x): Rounds x down to the nearest integer.
- Example: Math.floor(2.9) returns 2.
- round(x): Rounds x to the nearest integer.
- Example: Math.round(2.5) returns 3.
- toFixed(n): Rounds x to n decimal places.
- Example: 2.567.toFixed(2) returns 2.57.
Other Math Functions
- min(x, y, z, ...): Returns the smallest value from a list of arguments.
- Example: Math.min(0, 150, 30, -200, -8) returns -200.
- max(x, y, z, ...): Returns the largest value from a list of arguments.
- Example: Math.max(0, 150, 30, 20, -8) returns 150.
- SQRT(x): Computes the square root of x.
- Example: Math.SQRT(9) returns 3.
- sin(x): Calculates the sine of an angle in radians.
- Example: Math.sin(Math.PI / 2) returns 1.
3. JavaScript Date Functions
These functions are used to manage contract-related calculations and project timelines.
Contract Start and End Dates
- SD1: Define the contract start date.
- Example: SD = 10/01/2017 sets the start date to 10th January 2017.
- ED1: Define the contract end date.
- Example: ED = 24/05/2017 sets the end date to 24th May 2017.
Contract Duration
- Calculate the total duration of the contract in weeks.
- CD1 = (([ED] - [SD]) / 1000 / 60 / 60 / 24 / 365.242 * 12 * 4.33).toFixed(2)
This returns the duration in weeks, e.g., 19.07.
- CD1 = (([ED] - [SD]) / 1000 / 60 / 60 / 24 / 365.242 * 12 * 4.33).toFixed(2)
4. Project Financing Example
Contract Interest Cost Calculation Example
The table below demonstrates how to calculate the financing cost for a construction project, including initial principal, monthly increase, and interest over the repayment period.
Example of a pricing worksheet for calculating contract interest costs:
Description | Resource | Rate | Unit | Variable | Equation | Value | Amount |
Clients financing variables | 1 | 1 | - | ||||
Annual Interest Rate | AIR | [BLR_GV]% | 0 | - | |||
Client initial Principal costs | 1 | 1 | - | ||||
Initial Principal | IP | [LAC_GV] | 1,600,000 | - | |||
Client monthly increase cost of build | 1 | 1 | - | ||||
Design and Consultants' costs: | [TDC_GV] | 9,300,000 | - | ||||
Contractors build cost | [CEB_GV] | 60,000,000 | - | ||||
Clients provisions | [CPC_GV] | 11,367,600 | - | ||||
Total client cost less land acquisition cost | CC | [TDC_GV]+[CEB_GV]+[CPC_GV] | 80,667,600 | - | |||
Monthly Increase | MI | [CC]/[CPD_GV] | 1,390,821 | - | |||
Client cost of interest | 1 | 1 | - | ||||
Number of Repayment Periods | NOR | [CPD_GV] | 58 | - | |||
Monthly Rate | MIR | [AIR]/12 | - | - | |||
Total Interest | Interest | 1 | sum | FOR(0, [NOR]): { answer += ([IP] + ([MI] * count)) * [MIR] } | 7,972,755 | 7,972,755 |
Breakdown of Key Calculations
- Initial Principal (IP): The land acquisition cost [LAC_GV] is the starting principal.
- Value: 1,600,000
2. Annual Interest Rate (AIR): The yearly interest rate is 4%, converted into a monthly rate:
- Formula: [AIR] / 12
- Value: 0.0033333
3. Total Client Cost (CC): Sum of consultant, contractor, and provision costs.
- Formula: [TDC_GV] + [CEB_GV] + [CPC_GV]
- Value: 80,667,600
4. Monthly Increase (MI): Monthly construction cost increase based on repayment period.
- Formula: [CC] / [CPD_GV]
- Value: 1,390,820.69
- Total Interest Calculation: Using a loop formula:
FOR(0, [NOR]): { answer += ([IP] + ([MI] * count)) * [MIR] }- Total Interest Value: 7,972,755.33