mrf-cstar
A Node.js package that calculates CStar for Alberta's Modernized Royalty Framework (mrf)
Usage
First, install the pacakge using npm:
npm install mrf-cstar --save
Then, require the package and use it like so:
var calculateCStar = require('./index').CalculateCStar
console.log(calculateCStar( 250, 0, 0)) // 1170
console.log(calculateCStar( 251, 0, 0)) // 2340
console.log(calculateCStar( 0, 1, 0)) // 800
console.log(calculateCStar( 250, 1, 1)) // 2120
console.log(calculateCStar(2000, 0, 0)) // 2048670
// deep wells
console.log(calculateCStar(2001, 0, 0)) // 2052960
console.log(calculateCStar(2002, 0, 0)) // 2057250
There is also a formatted option, useful visual inspection of test results
require('./index').setMode('formatted')
var calculateCStar = require('./index').CalculateCStar
// shallow wells
console.log(calculateCStar( 250, 0, 0)) // 1,170
console.log(calculateCStar( 251, 0, 0)) // 2,340
console.log(calculateCStar( 0, 1, 0)) // 800
console.log(calculateCStar( 250, 1, 1)) // 2,120
console.log(calculateCStar(2000, 0, 0)) // 2,048,670
// deep wells
console.log(calculateCStar(2001, 0, 0)) // 2,052,960
console.log(calculateCStar(2002, 0, 0)) // 2,057,250
Licence
Apache 2.0