mf-from-atomic-ratio
v1.2.23
Published
Find a molecular formula from atomic ratio
Readme
mf-from-atomic-ratio
Find a molecular formula from atomic ratio based on a molecular formula range.
Installation
$ npm install --save mf-from-atomic-ratio
Usage
const { mfFromAtomicRatio } = require('mf-from-atomic-ratio');
const mfs = await mfFromAtomicRatio(
{ C: 3, O: 2 },
{
ranges: 'C0-10 H0-10 O0-10 N0-10',
maxElementError: 0.01,
maxTotalError: 0.02,
},
);
console.log(mfs[0]);
/*
{
em: 13.00782503223,
mw: 13.018676650791026,
mf: 'CH',
mfAtomicComposition: [
{ element: 'C', count: 1, theoretical: 0.5 },
{ element: 'H', count: 1, theoretical: 0.5 }
],
atomicRatios: [
{
element: 'C',
experimental: 0.5,
count: 1,
theoretical: 0.5,
error: 0
},
{
element: 'H',
experimental: 0.5,
count: 1,
theoretical: 0.5,
error: 0
}
],
totalError: 0
}
*/