new w-geo()
- Source:
Members
(static) calcLiquefaction
- Description:
液化分析
Unit Test: Github
- Source:
液化分析
Unit Test: Github
Example
let rowsIn = `[{"sampleId":"S-1","depthStart":"0","depthEnd":"3.5","depth":"1.75","N60":"8","w":"20.8","GS":"2.7","e":"0.86","LL":"32.5","PI":"11.4","soilClassification":"CL","D50":"","D10":"","FC":"76.09999847","rd":"14.21150662","PGA":"0.612","Mw":"7.6","waterLevelUsual":"0","waterLevelDesign":"0"},...]`
rowsIn = JSON.parse(rowsIn)
// console.log('rowsIn',rowsIn)
let rowsOut = calcLiquefaction.calc('SPT', rowsIn)
// console.log('rowsOut',rowsOut)
fs.writeFileSync('./rowsIn.json', JSON.stringify(rowsIn), 'utf8')
fs.writeFileSync('./rowsOut.json', JSON.stringify(rowsOut), 'utf8')
// let mat = w.ltdtkeysheads2mat(rowsOut)
// w.downloadExcelFileFromData('./mat.xlsx', 'mat', mat)
Methods
(static) calcDepthByDepthStartEnd(rows, optopt) → {Array}
- Description:
由樣本起訖深度反算中點深度
Unit Test: Github
- Source:
Example
let rows
let rs
rows = [
{
depthStart: 0,
depthEnd: 3,
},
{
depthStart: 3,
depthEnd: 13,
},
{
depthStart: 13,
depthEnd: 20,
},
]
rs = calcDepthByDepthStartEnd(rows)
console.log(rs)
// => [
// { depthStart: 0, depthEnd: 3, depth: 1.5 },
// { depthStart: 3, depthEnd: 13, depth: 8 },
// { depthStart: 13, depthEnd: 20, depth: 16.5 }
// ]
rows = [
{
depthStart: 0,
depthEnd: 3,
},
{
depthStart: 13,
depthEnd: 20,
},
]
rs = calcDepthByDepthStartEnd(rows)
console.log(rs)
// => [
// { depthStart: 0, depthEnd: 3, depth: 1.5 },
// { depthStart: 13, depthEnd: 20, depth: 16.5 }
// ]
rows = [
{
ds: 0,
de: 3,
},
{
ds: 3,
de: 13,
},
{
ds: 13,
de: 20,
},
]
rs = calcDepthByDepthStartEnd(rows, { keyDepthStart: 'ds', keyDepthEnd: 'de', keyDepth: 'dc' })
console.log(rs)
// => [
// { ds: 0, de: 3, dc: 1.5 },
// { ds: 3, de: 13, dc: 8 },
// { ds: 13, de: 20, dc: 16.5 }
// ]
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rows |
Array | 輸入數據陣列,各數據為物件,至少需包含起始深度(depthStart)與結束深度(depthEnd),深度單位為m |
||||||||||||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳添加起訖深度的數據陣列
- Type
- Array
(static) calcDepthStartEndByConnect(rows, optopt) → {Array}
- Description:
調整各樣本起訖深度成為各層互相接續狀態
Unit Test: Github
- Source:
Example
let rows
let rs
rows = [
{
depthStart: 0,
depthEnd: 4,
},
{
depthStart: 6,
depthEnd: 10,
},
{
depthStart: 11,
depthEnd: 15,
},
]
rs = calcDepthStartEndByConnect(rows)
console.log(rs)
// => [
// { depthStart: 0, depthEnd: 5 },
// { depthStart: 5, depthEnd: 10.5 },
// { depthStart: 10.5, depthEnd: 15 }
// ]
rows = [
{
depthStart: 0,
depthEnd: 5,
},
{
depthStart: 4,
depthEnd: 15,
},
]
try {
rs = calcDepthStartEndByConnect(rows)
}
catch (err) {
rs = err.toString()
}
console.log(rs)
// => Error: 第 0 樣本之結束深度depthEnd[5]大於第 1 樣本之起點深度depthStart[4]
rows = [
{
depthStart: '0',
depthEnd: '4',
},
{
depthStart: '6',
depthEnd: '10',
},
]
rs = calcDepthStartEndByConnect(rows)
console.log(rs)
// => [ { depthStart: '0', depthEnd: 5 }, { depthStart: 5, depthEnd: '10' } ]
rows = [
{
depthStart: '0',
depthEnd: 'abc',
},
{
depthStart: 'abc',
depthEnd: '10',
},
]
try {
rs = calcDepthStartEndByConnect(rows)
}
catch (err) {
rs = err.toString()
}
console.log(rs)
// => Error: 第 0 樣本結束深度depthEnd[abc]非有效數字, 第 1 樣本起始深度depthStart[abc]非有效數字
rows = [
{
top_depth: 0,
bottom_depth: 4,
},
{
top_depth: 6,
bottom_depth: 10,
},
]
rs = calcDepthStartEndByConnect(rows, { keyDepthStart: 'top_depth', keyDepthEnd: 'bottom_depth' })
console.log(rs)
// => [
// { top_depth: 0, bottom_depth: 5 },
// { top_depth: 5, bottom_depth: 10 }
// ]
rows = [
{
depthStart: 0,
depthEnd: 4,
},
{
depthStart: 6,
depthEnd: 10,
},
{
depthStart: 11,
depthEnd: 15,
},
]
rs = calcDepthStartEndByConnect(rows, { depthEndMax: 20 })
console.log(rs)
// => [
// { depthStart: 0, depthEnd: 5 },
// { depthStart: 5, depthEnd: 10.5 },
// { depthStart: 10.5, depthEnd: 20 }
// ]
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rows |
Array | 輸入數據陣列,各數據為物件,至少需包含起始深度(depthStart)與結束深度(depthEnd),深度單位為m |
||||||||||||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳群組化後添加起訖深度與所屬原數據的陣列
- Type
- Array
(static) calcDepthStartEndByDepth(rows, optopt) → {Array}
- Description:
由樣本中點深度反算各樣本起訖深度,注意樣本添加起訖深度可能因最淺樣本起始深度最大為0,以及最深樣本可被修改為depthEndMax,故各樣本中點深度不一定是起訖深度之平均值
Unit Test: Github
- Source:
Example
let rows
let rs
rows = [
{
depth: 0,
},
{
depth: 6,
},
{
depth: 20,
},
]
rs = calcDepthStartEndByDepth(rows)
console.log(rs)
// => [
// { depth: 0, depthStart: 0, depthEnd: 3 },
// { depth: 6, depthStart: 3, depthEnd: 13 },
// { depth: 20, depthStart: 13, depthEnd: 20 }
// ]
rows = [
{
depth: 4,
},
{
depth: 6,
},
{
depth: 20,
},
]
rs = calcDepthStartEndByDepth(rows)
console.log(rs)
// => [
// { depth: 4, depthStart: 0, depthEnd: 5 },
// { depth: 6, depthStart: 5, depthEnd: 13 },
// { depth: 20, depthStart: 13, depthEnd: 20 }
// ]
rows = [
{
depth: 4,
},
{
depth: 6,
},
{
depth: 20,
},
]
rs = calcDepthStartEndByDepth(rows, { depthEndMax: 25 })
console.log(rs)
// => [
// { depth: 4, depthStart: 0, depthEnd: 5 },
// { depth: 6, depthStart: 5, depthEnd: 13 },
// { depth: 20, depthStart: 13, depthEnd: 25 }
// ]
rows = [
{
depth: 4,
},
{
depth: 6,
},
{
depth: 20,
},
]
rs = calcDepthStartEndByDepth(rows, { depthEndMax: 15 })
console.log(rs)
// => [
// { depth: 4, depthStart: 0, depthEnd: 5 },
// { depth: 6, depthStart: 5, depthEnd: 13 },
// { depth: 20, depthStart: 13, depthEnd: 20 }
// ]
rows = [
{
dc: 4,
},
{
dc: 6,
},
{
dc: 20,
},
]
rs = calcDepthStartEndByDepth(rows, { keyDepth: 'dc', keyDepthStart: 'ds', keyDepthEnd: 'de' })
console.log(rs)
// => [
// { dc: 4, ds: 0, de: 5 },
// { dc: 6, ds: 5, de: 13 },
// { dc: 20, ds: 13, de: 20 }
// ]
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rows |
Array | 輸入數據陣列,各數據為物件,至少需包含起始深度(depthStart)與結束深度(depthEnd),深度單位為m |
|||||||||||||||||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳添加起訖深度的數據陣列
- Type
- Array
(static) calcDepthStartEndByGroup(rows, optopt) → {Array}
- Description:
由樣本指定鍵值作為群組代號,並依照樣本中點深度提取各群組之起訖深度
Unit Test: Github
- Source:
Example
let rows
let rs
rows = [
{
depth: 0,
group: 'a',
},
{
depth: 6,
group: 'b',
},
{
depth: 20,
group: 'c',
},
]
rs = calcDepthStartEndByGroup(rows)
console.log(JSON.stringify(rs, null, 2))
// => [
// {
// "group": "a",
// "depthStart": 0,
// "depthEnd": 3,
// "rows": [
// {
// "depth": 0,
// "group": "a",
// "depthStart": 0,
// "depthEnd": 3
// }
// ]
// },
// {
// "group": "b",
// "depthStart": 3,
// "depthEnd": 13,
// "rows": [
// {
// "depth": 6,
// "group": "b",
// "depthStart": 3,
// "depthEnd": 13
// }
// ]
// },
// {
// "group": "c",
// "depthStart": 13,
// "depthEnd": 20,
// "rows": [
// {
// "depth": 20,
// "group": "c",
// "depthStart": 13,
// "depthEnd": 20
// }
// ]
// }
// ]
rows = [
{
depth: 2,
group: 'a',
},
{
depth: 6,
group: 'b',
},
{
depth: 20,
group: 'c',
},
]
rs = calcDepthStartEndByGroup(rows, { depthEndMax: 25 })
console.log(JSON.stringify(rs, null, 2))
// => [
// {
// "group": "a",
// "depthStart": 0,
// "depthEnd": 4,
// "rows": [
// {
// "depth": 2,
// "group": "a",
// "depthStart": 0,
// "depthEnd": 4
// }
// ]
// },
// {
// "group": "b",
// "depthStart": 4,
// "depthEnd": 13,
// "rows": [
// {
// "depth": 6,
// "group": "b",
// "depthStart": 4,
// "depthEnd": 13
// }
// ]
// },
// {
// "group": "c",
// "depthStart": 13,
// "depthEnd": 25,
// "rows": [
// {
// "depth": 20,
// "group": "c",
// "depthStart": 13,
// "depthEnd": 25
// }
// ]
// }
// ]
rows = [
{
depth: 0,
group: 'a',
},
{
depth: 2,
group: 'a',
},
{
depth: 4,
group: 'b',
},
{
depth: 6,
group: 'b',
},
{
depth: 8,
group: 'b',
},
{
depth: 10,
group: 'c',
},
{
depth: 12,
group: 'b',
},
{
depth: 14,
group: 'c',
},
{
depth: 16,
group: 'b',
},
{
depth: 18,
group: 'b',
},
{
depth: 30,
group: 'd',
},
]
rs = calcDepthStartEndByGroup(rows)
console.log(JSON.stringify(rs, null, 2))
// => [
// {
// "group": "a",
// "depthStart": 0,
// "depthEnd": 3,
// "rows": [
// {
// "depth": 0,
// "group": "a",
// "depthStart": 0,
// "depthEnd": 1
// },
// {
// "depth": 2,
// "group": "a",
// "depthStart": 1,
// "depthEnd": 3
// }
// ]
// },
// {
// "group": "b",
// "depthStart": 3,
// "depthEnd": 9,
// "rows": [
// {
// "depth": 4,
// "group": "b",
// "depthStart": 3,
// "depthEnd": 5
// },
// {
// "depth": 6,
// "group": "b",
// "depthStart": 5,
// "depthEnd": 7
// },
// {
// "depth": 8,
// "group": "b",
// "depthStart": 7,
// "depthEnd": 9
// }
// ]
// },
// {
// "group": "c",
// "depthStart": 9,
// "depthEnd": 11,
// "rows": [
// {
// "depth": 10,
// "group": "c",
// "depthStart": 9,
// "depthEnd": 11
// }
// ]
// },
// {
// "group": "b",
// "depthStart": 11,
// "depthEnd": 13,
// "rows": [
// {
// "depth": 12,
// "group": "b",
// "depthStart": 11,
// "depthEnd": 13
// }
// ]
// },
// {
// "group": "c",
// "depthStart": 13,
// "depthEnd": 15,
// "rows": [
// {
// "depth": 14,
// "group": "c",
// "depthStart": 13,
// "depthEnd": 15
// }
// ]
// },
// {
// "group": "b",
// "depthStart": 15,
// "depthEnd": 24,
// "rows": [
// {
// "depth": 16,
// "group": "b",
// "depthStart": 15,
// "depthEnd": 17
// },
// {
// "depth": 18,
// "group": "b",
// "depthStart": 17,
// "depthEnd": 24
// }
// ]
// },
// {
// "group": "d",
// "depthStart": 24,
// "depthEnd": 30,
// "rows": [
// {
// "depth": 30,
// "group": "d",
// "depthStart": 24,
// "depthEnd": 30
// }
// ]
// }
// ]
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rows |
Array | 輸入數據陣列,各數據為物件,至少需包含起始深度(depthStart)與結束深度(depthEnd),深度單位為m |
||||||||||||||||||||||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳群組化後添加起訖深度與所屬原數據的陣列
- Type
- Array
(static) calcLayersByMerge(ltdt, optopt) → {Array}
- Description:
基於各樣本之起訖深度與指定欄位值進行合併,各樣本起訖深度不一定須為接合,預設合併成功取下方數據
Unit Test: Github
- Source:
Example
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ltdt |
Array | 輸入數據陣列,各數據為物件,至少需包含起始深度(keyDepthStart)與結束深度(keyDepthEnd),深度單位為m |
||||||||||||||||||||||||||||||||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳合併後的數據陣列
- Type
- Array
(static) calcVerticalStress(ltdt, optopt) → {Array}
- Description:
計算樣本數據垂直總應力與有效應力
Unit Test: Github
- Source:
Example
let waterLevelUsual
let waterLevelDesign
let ltdt
let rowsNew
waterLevelUsual = 0
waterLevelDesign = 0
ltdt = [
{
depthStart: 0,
depthEnd: 5,
rsat: 18, //kN/m3
},
{
depthStart: 5,
depthEnd: 10,
rsat: 18, //kN/m3
},
{
depthStart: 10,
depthEnd: 20,
rsat: 18, //kN/m3
},
]
rowsNew = calcVerticalStress(ltdt, { waterLevelUsual, waterLevelDesign, unitSvSvp: 'kPa' })
console.log(rowsNew, (18 - 9.81) * 15) //地下 15(m) 處之垂直有效應力為 122.85(kN/m2)
// => [
// {
// depthStart: 0,
// depthEnd: 5,
// rsat: 18,
// waterLevelUsual: 0,
// waterLevelDesign: 0,
// sv: 45,
// svpUsual: 20.474999999999998,
// svpDesign: 20.474999999999998,
// depth: 2.5
// },
// {
// depthStart: 5,
// depthEnd: 10,
// rsat: 18,
// waterLevelUsual: 0,
// waterLevelDesign: 0,
// sv: 135,
// svpUsual: 61.425,
// svpDesign: 61.425,
// depth: 7.5
// },
// {
// depthStart: 10,
// depthEnd: 20,
// rsat: 18,
// waterLevelUsual: 0,
// waterLevelDesign: 0,
// sv: 270,
// svpUsual: 122.85,
// svpDesign: 122.85,
// depth: 15
// }
// ] 122.85
waterLevelUsual = 0
waterLevelDesign = 0
ltdt = [
{
depthStart: 0,
depthEnd: 5,
rsat: 18, //kN/m3
},
{
depthStart: 5,
depthEnd: 10,
rsat: 19, //kN/m3
},
{
depthStart: 10,
depthEnd: 20,
rsat: 20, //kN/m3
},
]
rowsNew = calcVerticalStress(ltdt, { waterLevelUsual, waterLevelDesign, unitSvSvp: 'kPa' })
console.log(rowsNew, (19 - 9.81) * 15) //地下 15(m) 處之垂直有效應力為 137.85(kN/m2)
// => [
// {
// depthStart: 0,
// depthEnd: 5,
// rsat: 18,
// waterLevelUsual: 0,
// waterLevelDesign: 0,
// sv: 45,
// svpUsual: 20.474999999999998,
// svpDesign: 20.474999999999998,
// depth: 2.5
// },
// {
// depthStart: 5,
// depthEnd: 10,
// rsat: 19,
// waterLevelUsual: 0,
// waterLevelDesign: 0,
// sv: 137.5,
// svpUsual: 63.925,
// svpDesign: 63.925,
// depth: 7.5
// },
// {
// depthStart: 10,
// depthEnd: 20,
// rsat: 20,
// waterLevelUsual: 0,
// waterLevelDesign: 0,
// sv: 285,
// svpUsual: 137.85,
// svpDesign: 137.85,
// depth: 15
// }
// ] 137.85
waterLevelUsual = 20
waterLevelDesign = 20
ltdt = [
{
depthStart: 0,
depthEnd: 5,
rd: 18, //kN/m3
},
{
depthStart: 5,
depthEnd: 10,
rd: 18, //kN/m3
},
{
depthStart: 10,
depthEnd: 20,
rd: 18, //kN/m3
},
]
rowsNew = calcVerticalStress(ltdt, { waterLevelUsual, waterLevelDesign, unitSvSvp: 'kPa' })
console.log(rowsNew, (18) * 15) //地下 15(m) 處之垂直總應力與垂直有效應力為 270(kN/m2)
// => [
// {
// depthStart: 0,
// depthEnd: 5,
// rd: 18,
// waterLevelUsual: 20,
// waterLevelDesign: 20,
// sv: 45,
// svpUsual: 45,
// svpDesign: 45,
// depth: 2.5
// },
// {
// depthStart: 5,
// depthEnd: 10,
// rd: 18,
// waterLevelUsual: 20,
// waterLevelDesign: 20,
// sv: 135,
// svpUsual: 135,
// svpDesign: 135,
// depth: 7.5
// },
// {
// depthStart: 10,
// depthEnd: 20,
// rd: 18,
// waterLevelUsual: 20,
// waterLevelDesign: 20,
// sv: 270,
// svpUsual: 270,
// svpDesign: 270,
// depth: 15
// }
// ] 270
waterLevelUsual = 3
waterLevelDesign = 3
ltdt = [
{
depthStart: 0,
depthEnd: 3,
rd: 18, //kN/m3
},
{
depthStart: 3,
depthEnd: 11,
rsat: 20, //kN/m3
},
]
rowsNew = calcVerticalStress(ltdt, { waterLevelUsual, waterLevelDesign, unitSvSvp: 'kPa' })
console.log(rowsNew, 18 * 3 + (20 * 4 - 9.81 * 4)) //地下 7(m) 處之垂直有效應力為 94.76(kN/m2)
// => [
// {
// depthStart: 0,
// depthEnd: 3,
// rd: 18,
// waterLevelUsual: 3,
// waterLevelDesign: 3,
// sv: 27,
// svpUsual: 27,
// svpDesign: 27,
// depth: 1.5
// },
// {
// depthStart: 3,
// depthEnd: 11,
// rsat: 20,
// waterLevelUsual: 3,
// waterLevelDesign: 3,
// sv: 134,
// svpUsual: 94.75999999999999,
// svpDesign: 94.75999999999999,
// depth: 7
// }
// ] 94.75999999999999
waterLevelUsual = 3
waterLevelDesign = 3
ltdt = [
{
depthStart: 0,
depthEnd: 1,
rd: 18, //kN/m3
},
{
depthStart: 1,
depthEnd: 5,
rd: 18, //kN/m3
rsat: 20, //kN/m3
},
{
depthStart: 5,
depthEnd: 9,
rsat: 20, //kN/m3
},
]
rowsNew = calcVerticalStress(ltdt, { waterLevelUsual, waterLevelDesign, unitSvSvp: 'kPa' })
console.log(rowsNew, 18 * 3 + (20 * 4 - 9.81 * 4)) //地下 7(m) 處之垂直有效應力為 94.76(kN/m2)
// => [
// {
// depthStart: 0,
// depthEnd: 1,
// rd: 18,
// waterLevelUsual: 3,
// waterLevelDesign: 3,
// sv: 9,
// svpUsual: 9,
// svpDesign: 9,
// depth: 0.5
// },
// {
// depthStart: 1,
// depthEnd: 5,
// rd: 18,
// rsat: 20,
// waterLevelUsual: 3,
// waterLevelDesign: 3,
// sv: 56,
// svpUsual: 56,
// svpDesign: 56,
// depth: 3
// },
// {
// depthStart: 5,
// depthEnd: 9,
// rsat: 20,
// waterLevelUsual: 3,
// waterLevelDesign: 3,
// sv: 134,
// svpUsual: 94.75999999999999,
// svpDesign: 94.75999999999999,
// depth: 7
// }
// ] 94.75999999999999
waterLevelUsual = 3
waterLevelDesign = 0
ltdt = [
{
depthStart: 0,
depthEnd: 1,
rd: 18, //kN/m3
rsat: 20, //kN/m3
},
{
depthStart: 1,
depthEnd: 5,
rd: 18, //kN/m3
rsat: 20, //kN/m3
},
{
depthStart: 5,
depthEnd: 9,
rsat: 20, //kN/m3
},
]
rowsNew = calcVerticalStress(ltdt, { waterLevelUsual, waterLevelDesign, unitSvSvp: 'kPa' })
console.log(rowsNew, 18 * 3 + (20 * 4 - 9.81 * 4), (20 - 9.81) * 7) //地下 7(m) 處之常時垂直有效應力為 94.76(kN/m2), 設計垂直有效應力為 71.33(kN/m2)
// => [
// {
// depthStart: 0,
// depthEnd: 1,
// rd: 18,
// rsat: 20,
// waterLevelUsual: 3,
// waterLevelDesign: 0,
// sv: 9,
// svpUsual: 9,
// svpDesign: 5.095,
// depth: 0.5
// },
// {
// depthStart: 1,
// depthEnd: 5,
// rd: 18,
// rsat: 20,
// waterLevelUsual: 3,
// waterLevelDesign: 0,
// sv: 56,
// svpUsual: 56,
// svpDesign: 30.57,
// depth: 3
// },
// {
// depthStart: 5,
// depthEnd: 9,
// rsat: 20,
// waterLevelUsual: 3,
// waterLevelDesign: 0,
// sv: 134,
// svpUsual: 94.75999999999999,
// svpDesign: 71.33,
// depth: 7
// }
// ] 94.75999999999999 71.33
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ltdt |
Array | 輸入數據陣列,各數據為物件,至少需包含起始深度(depthStart,單位m)與結束深度(depthEnd,單位m),位於地下水位以上之樣本需提供乾單位重(rd,單位kN/m3),位於地下水位以下之樣本需提供飽和單位重(rsat,單位kN/m3),若地下水位位於該樣本起訖深度內,則需同時提供乾單位重與飽和單位重 |
|||||||||||||||||||||||||||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳計算後數據陣列
- Type
- Array
(static) checkDepth(rows, optopt) → {Array}
- Description:
檢核樣本數據內深度是否有效與連續
Unit Test: Github
- Source:
Example
let rows
let errs
rows = [
{
depth: 0,
},
{
depth: 5,
},
{
depth: 10,
},
]
errs = checkDepth(rows)
console.log(errs)
// => []
rows = [
{
depth: 0,
},
{
depth: 10,
},
]
errs = checkDepth(rows)
console.log(errs)
// => []
rows = [
{
depth: '0',
},
{
depth: '5',
},
]
errs = checkDepth(rows)
console.log(errs)
// => []
rows = [
{
depth: '0',
},
{
depth: 'abc',
},
]
errs = checkDepth(rows)
console.log(errs)
// => [ '第 1 樣本中點深度depth[abc]非有效數字' ]
rows = [
{
center_depth: 0,
},
{
center_depth: 5,
},
]
errs = checkDepth(rows, { keyDepth: 'center_depth' })
console.log(errs)
// => []
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rows |
Array | 輸入數據陣列,各數據為物件,至少需包含起始深度(depthStart)與結束深度(depthEnd),深度單位為m |
||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳錯誤訊息陣列
- Type
- Array
(static) checkDepthStartEnd(rows, optopt) → {Array}
- Description:
檢核樣本數據內起訖深度是否有效與連續
Unit Test: Github
- Source:
Example
let rows
let errs
rows = [
{
depthStart: 0,
depthEnd: 5,
},
{
depthStart: 5,
depthEnd: 10,
},
{
depthStart: 10,
depthEnd: 20,
},
]
errs = checkDepthStartEnd(rows)
console.log(errs)
// => []
rows = [
{
depthStart: 0,
depthEnd: 5,
},
{
depthStart: 10,
depthEnd: 20,
},
]
errs = checkDepthStartEnd(rows)
console.log(errs)
// => [ '第 1 樣本結束深度depthEnd[5]不等於第 2 個樣本起始深度depthStart[10]' ]
rows = [
{
depthStart: 0,
depthEnd: 5,
},
{
depthStart: 10,
depthEnd: 20,
},
]
errs = checkDepthStartEnd(rows, { stateConn: 'overlap' })
console.log(errs)
// => []
rows = [
{
depthStart: '0',
depthEnd: '5',
},
{
depthStart: '5',
depthEnd: '10',
},
]
errs = checkDepthStartEnd(rows)
console.log(errs)
// => []
rows = [
{
depthStart: '0',
depthEnd: 'abc',
},
{
depthStart: 'abc',
depthEnd: '10',
},
]
errs = checkDepthStartEnd(rows)
console.log(errs)
// => [
// '第 0 樣本起始非有效數字: depthStart[0], depthEnd[abc]',
// '第 1 樣本起始非有效數字: depthStart[abc], depthEnd[10]'
// ]
rows = [
{
top_depth: 0,
bottom_depth: 5,
},
{
top_depth: 5,
bottom_depth: 10,
},
]
errs = checkDepthStartEnd(rows, { keyDepthStart: 'top_depth', keyDepthEnd: 'bottom_depth' })
console.log(errs)
// => []
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rows |
Array | 輸入數據陣列,各數據為物件,至少需包含起始深度(depthStart)與結束深度(depthEnd),深度單位為m |
|||||||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳錯誤訊息陣列
- Type
- Array
(static) complementDepthData(rows, keyDepth, keyValue, keysValueCmp, optopt) → {Array}
- Description:
數據急墜段偵測與處理
Unit Test: Github
- Source:
Example
let rows = [
{
'depth(m)': 0,
'qc(MPa)': 0,
'fs(MPa)': 0,
'u2(MPa)': 0,
},
{
'depth(m)': 0.1,
'qc(MPa)': 0.12,
'fs(MPa)': 0.02,
'u2(MPa)': 0.05,
},
]
let keyDepth = 'depth(m)'
let keyValue = 'qc(MPa)'
let keysValueCmp = ['qc(MPa)', 'fs(MPa)', 'u2(MPa)']
let rsFill = complementDepthData(rows, keyDepth, keyValue, keysValueCmp, { cmpMode: 'linear-fill' })
let rsCut = complementDepthData(rows, keyDepth, keyValue, keysValueCmp, { cmpMode: 'cut' })
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rows |
Array | 輸入數據陣列,各數據為物件,至少需包含深度(depth,單位m)與任意數值 |
|||||||||||||||||||||||||||
keyDepth |
String | 輸入深度欄位字串 |
|||||||||||||||||||||||||||
keyValue |
String | 輸入偵測數值欄位字串 |
|||||||||||||||||||||||||||
keysValueCmp |
Array | 輸入偵測數值與連帶處理欄位陣列 |
|||||||||||||||||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳計算後數據陣列
- Type
- Array
(static) groupByDepthStartEnd(rows, depthStartAndEnds, optopt) → {Array}
- Description:
由指定起訖深度陣列,針對各樣本之中點深度群組化,各群儲存所屬的樣本陣列
Unit Test: Github
- Source:
Example
let rows
let ranges
let rs
rows = [
{
depth: 0,
},
{
depth: 1,
},
{
depth: 3,
},
{
depth: 10,
},
]
ranges = [
{
depthStart: 0,
depthEnd: 1,
},
{
depthStart: 1,
depthEnd: 4,
},
]
rs = groupByDepthStartEnd(rows, ranges)
console.log(JSON.stringify(rs, null, 2))
// => [
// {
// "depthStart": 0,
// "depthEnd": 1,
// "rows": [
// {
// "depth": 0
// },
// {
// "depth": 1
// }
// ]
// },
// {
// "depthStart": 1,
// "depthEnd": 4,
// "rows": [
// {
// "depth": 3
// }
// ]
// }
// ]
rows = [
{
depth: 0,
},
{
depth: 1,
},
{
depth: 3,
},
{
depth: 10,
},
]
ranges = [
{
depthStart: 0,
depthEnd: 3,
},
{
depthStart: 1,
depthEnd: 5,
},
]
try {
rs = groupByDepthStartEnd(rows, ranges)
}
catch (err) {
rs = err.toString()
}
console.log(rs)
// => Error: 第 1 樣本結束深度depthEnd[3]大於第 2 個樣本起始深度depthStart[1]
rows = [
{
depth: 0,
},
{
depth: 1,
},
{
depth: 3,
},
{
depth: 10,
},
]
ranges = [
{
depthStart: 0,
depthEnd: 2,
},
{
depthStart: 5,
depthEnd: 10,
},
]
rs = groupByDepthStartEnd(rows, ranges)
console.log(JSON.stringify(rs, null, 2))
// => [
// {
// "depthStart": 0,
// "depthEnd": 2,
// "rows": [
// {
// "depth": 0
// },
// {
// "depth": 1
// }
// ]
// },
// {
// "depthStart": 5,
// "depthEnd": 10,
// "rows": [
// {
// "depth": 10
// }
// ]
// }
// ]
rows = [
{
depth: 0,
},
{
depth: 1,
},
{
depth: 3,
},
{
depth: 10,
},
]
ranges = [
{
depthStart: 0,
depthEnd: 10,
},
]
rs = groupByDepthStartEnd(rows, ranges)
console.log(JSON.stringify(rs, null, 2))
// => [
// {
// "depthStart": 0,
// "depthEnd": 10,
// "rows": [
// {
// "depth": 0
// },
// {
// "depth": 1
// },
// {
// "depth": 3
// },
// {
// "depth": 10
// }
// ]
// }
// ]
rows = [
{
dc: 0,
},
{
dc: 1,
},
{
dc: 3,
},
{
dc: 10,
},
]
ranges = [
{
ds: 0,
de: 1,
},
{
ds: 1,
de: 4,
},
]
rs = groupByDepthStartEnd(rows, ranges, { keyDepth: 'dc', keyDepthStart: 'ds', keyDepthEnd: 'de' })
console.log(JSON.stringify(rs, null, 2))
// => [
// {
// "ds": 0,
// "de": 1,
// "rows": [
// {
// "dc": 0
// },
// {
// "dc": 1
// }
// ]
// },
// {
// "ds": 1,
// "de": 4,
// "rows": [
// {
// "dc": 3
// }
// ]
// }
// ]
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rows |
Array | 輸入數據陣列,各數據為物件,至少需包含深度(depth),深度單位為m |
|||||||||||||||||||||||||||
depthStartAndEnds |
Array | Object | 輸入欲提取數據的起訖深度陣列或物件,為物件時需有至少需包含起始深度(depthStart)與結束深度(depthEnd),為陣列時則須由前述物件組成之陣列,深度單位為m |
|||||||||||||||||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳群組化後添加起訖深度與所屬原數據的陣列
- Type
- Array
(static) mergeByDepthStartEnd(rows, optopt) → {Array}
- Description:
基於各樣本之起訖深度與指定欄位值進行合併,各樣本起訖深度須為接合,預設合併成功取下方數據
Unit Test: Github
- Source:
Example
let rows
let rows
rows = [
{
depthStart: 0,
depthEnd: 5,
value: 'a',
ext: 12.3,
},
{
depthStart: 5,
depthEnd: 7,
value: 'b',
ext: 12.4,
},
{
depthStart: 7,
depthEnd: 11,
value: 'b',
ext: 2.5,
},
{
depthStart: 11,
depthEnd: 15,
value: 'a',
ext: 2.3,
},
]
rows = mergeByDepthStartEnd(rows)
console.log(JSON.stringify(rows, null, 2))
// => [
// {
// "depthStart": 0,
// "depthEnd": 5,
// "value": "a",
// "ext": 12.3
// },
// {
// "depthStart": 5,
// "depthEnd": 11,
// "value": "b",
// "ext": 2.5
// },
// {
// "depthStart": 11,
// "depthEnd": 15,
// "value": "a",
// "ext": 2.3
// }
// ]
rows = [
{
ds: 0,
de: 5,
value: 'a',
ext: 12.3,
},
{
ds: 5,
de: 7,
value: 'b',
ext: 12.4,
},
{
ds: 7,
de: 11,
value: 'b',
ext: 2.5,
},
{
ds: 11,
de: 15,
value: 'a',
ext: 2.3,
},
]
rows = mergeByDepthStartEnd(rows, { keyDepthStart: 'ds', keyDepthEnd: 'de' })
console.log(JSON.stringify(rows, null, 2))
// => [
// {
// "ds": 0,
// "de": 5,
// "value": "a",
// "ext": 12.3
// },
// {
// "ds": 5,
// "de": 11,
// "value": "b",
// "ext": 2.5
// },
// {
// "ds": 11,
// "de": 15,
// "value": "a",
// "ext": 2.3
// }
// ]
rows = [
{
depthStart: 0,
depthEnd: 5,
data: 'a',
ext: 12.3,
},
{
depthStart: 5,
depthEnd: 7,
data: 'b',
ext: 12.4,
},
{
depthStart: 7,
depthEnd: 11,
data: 'b',
ext: 2.5,
},
{
depthStart: 11,
depthEnd: 15,
data: 'a',
ext: 2.3,
},
]
rows = mergeByDepthStartEnd(rows, { keyValue: 'data' })
console.log(JSON.stringify(rows, null, 2))
// => [
// {
// "depthStart": 0,
// "depthEnd": 5,
// "data": "a",
// "ext": 12.3
// },
// {
// "depthStart": 5,
// "depthEnd": 11,
// "data": "b",
// "ext": 2.5
// },
// {
// "depthStart": 11,
// "depthEnd": 15,
// "data": "a",
// "ext": 2.3
// }
// ]
rows = [
{
depthStart: 0,
depthEnd: 5,
value: 'a',
ext: 12.3,
},
{
depthStart: 5,
depthEnd: 7,
value: 'b',
ext: 12.4,
},
{
depthStart: 7,
depthEnd: 11,
value: 'b',
ext: 2.5,
},
{
depthStart: 11,
depthEnd: 15,
value: 'b',
ext: 2.3,
},
{
depthStart: 15,
depthEnd: 18,
value: 'a',
ext: 7.9,
},
]
rows = mergeByDepthStartEnd(rows, {
funMerge: (v0, v1) => {
return {
// depthStart: null,
// depthEnd: null,
value: v1.value,
ext: v1.ext,
_v0: v0,
_v1: v1,
}
}
})
console.log(JSON.stringify(rows, null, 2))
// => [
// {
// "depthStart": 0,
// "depthEnd": 5,
// "value": "a",
// "ext": 12.3
// },
// {
// "value": "b",
// "ext": 2.3,
// "_v0": {
// "value": "b",
// "ext": 2.5,
// "_v0": {
// "depthStart": 5,
// "depthEnd": 7,
// "value": "b",
// "ext": 12.4
// },
// "_v1": {
// "depthStart": 7,
// "depthEnd": 11,
// "value": "b",
// "ext": 2.5
// },
// "depthStart": 5,
// "depthEnd": 11
// },
// "_v1": {
// "depthStart": 11,
// "depthEnd": 15,
// "value": "b",
// "ext": 2.3
// },
// "depthStart": 5,
// "depthEnd": 15
// },
// {
// "depthStart": 15,
// "depthEnd": 18,
// "value": "a",
// "ext": 7.9
// }
// ]
rows = [
{
depthStart: 0,
depthEnd: 5,
value: 'a',
ext: 12.3,
},
{
depthStart: 5,
depthEnd: 7,
value: 'b',
ext: 12.4,
},
{
depthStart: 7,
depthEnd: 11,
value: 'b',
ext: 2.5,
},
{
depthStart: 11,
depthEnd: 15,
value: 'b',
ext: 2.3,
},
{
depthStart: 15,
depthEnd: 18,
value: 'a',
ext: 7.9,
},
]
rows = mergeByDepthStartEnd(rows, { typeMerge: 'up' })
console.log(JSON.stringify(rows, null, 2))
// => [
// {
// "depthStart": 0,
// "depthEnd": 5,
// "value": "a",
// "ext": 12.3
// },
// {
// "depthStart": 5,
// "depthEnd": 15,
// "value": "b",
// "ext": 12.4
// },
// {
// "depthStart": 15,
// "depthEnd": 18,
// "value": "a",
// "ext": 7.9
// }
// ]
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rows |
Array | 輸入數據陣列,各數據為物件,至少需包含起始深度(keyDepthStart)與結束深度(keyDepthEnd),深度單位為m |
||||||||||||||||||||||||||||||||||||||||||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳合併後的數據陣列
- Type
- Array
(static) relaPlasticity(LLopt, PIopt, PLopt) → {Object}
- Description:
計算土壤塑性參數:液限LL、塑限PL、塑性指數PI之間互相轉換,至少3給2才能反推全部
Unit Test: Github
- Source:
Example
let LL = 24 //%
let PI = 14 //%
let PL = 10 //%
let r
try {
r = relaPlasticity(LL, null, null)
}
catch (e) {
r = e.toString()
}
console.log('LL', r)
// => LL { LL: 24, PL: null, PI: null }
try {
r = relaPlasticity(null, PI, null)
console.log('PI', r)
}
catch (e) {
r = e.toString()
}
// => PI { LL: null, PL: null, PI: 14 }
try {
r = relaPlasticity(null, null, PL)
}
catch (e) {
r = e.toString()
}
console.log('PL', r)
// => PL { LL: null, PL: 10, PI: null }
try {
r = relaPlasticity(LL, PI, null)
}
catch (e) {
r = e.toString()
}
console.log('LL,PI', r)
// => LL,PI { LL: 24, PL: 10, PI: 14 }
try {
r = relaPlasticity(LL, null, PL)
}
catch (e) {
r = e.toString()
}
console.log('LL,PL', r)
// => LL,PL { LL: 24, PL: 10, PI: 14 }
try {
r = relaPlasticity(null, PI, PL)
}
catch (e) {
r = e.toString()
}
console.log('PI,PL', r)
// => PI,PL { LL: 24, PL: 10, PI: 14 }
try {
r = relaPlasticity(LL, PI, PL)
}
catch (e) {
r = e.toString()
}
console.log('LL,PI,PL', r)
// => LL,PI,PL { LL: 24, PL: 10, PI: 14 }
try {
r = relaPlasticity(2, PI, PL)
}
catch (e) {
r = e.toString()
}
console.log('2,PI,PL', r)
// => 2,PI,PL {
// LL: 2,
// PL: 10,
// PI: 14,
// err: '液限[2]<=塑限[10], 反算出塑限[-12]<=0, 反算出塑性指數[-8]<=0, 輸入液限[2]與反算出液限[24]差距過大'
// }
try {
r = relaPlasticity(32, PI, PL)
}
catch (e) {
r = e.toString()
}
console.log('32,PI,PL', r)
// => 32,PI,PL {
// LL: 32,
// PL: 10,
// PI: 14,
// err: '輸入塑限[10]與反算出塑限[18]差距過大, 輸入塑性指數[14]與反算出塑性指數[22]差距過大, 輸入液限[32]與反算出液限[24]差距過大'
// }
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
LL |
Number |
<optional> |
null
|
輸入液限數字,單位%,預設null |
PI |
Number |
<optional> |
null
|
輸入塑性指數數字,單位%,預設null |
PL |
Number |
<optional> |
null
|
輸入塑限數字,單位%,預設null |
Returns:
回傳物件,含鍵值LL、PI、PL
- Type
- Object
(static) relaPorous(rdopt, rsatopt, GSopt, eopt, optopt) → {Object}
- Description:
計算岩土孔隙參數:乾單位重rd、飽和單位重rsat、比重GS、孔隙比e之間互相轉換,至少4給2才能反推全部
Unit Test: Github
- Source:
Example
let GS = 2.7
let e = 0.86
let rd = 14.240322580645163 //kN/m3
let rsat = 18.776129032258066 //kN/m3
let r
let coreFuncs = relaPorous(null, null, null, null, { returnFuncs: true }).coreFuncs
console.log('rd get_rd_from_GS_e', coreFuncs.get_rd_from_GS_e(GS, e))
// => rd get_rd_from_GS_e 14.240322580645163
console.log('rd get_rd_from_rsat_e', coreFuncs.get_rd_from_rsat_e(rsat, e))
// => rd get_rd_from_rsat_e 14.240322580645163
console.log('rd get_rd_from_rsat_GS', coreFuncs.get_rd_from_rsat_GS(rsat, GS))
// => rd get_rd_from_rsat_GS 14.240322580645161
console.log('rsat get_rsat_from_GS_e', coreFuncs.get_rsat_from_GS_e(GS, e))
// => rsat get_rsat_from_GS_e 18.776129032258066
console.log('rsat get_rsat_from_rd_e', coreFuncs.get_rsat_from_rd_e(rd, e))
// => rsat get_rsat_from_rd_e 18.776129032258066
console.log('rsat get_rsat_from_rd_GS', coreFuncs.get_rsat_from_rd_GS(rd, GS))
// => rsat get_rsat_from_rd_GS 18.77612903225807
console.log('e get_e_from_GS_rd', coreFuncs.get_e_from_GS_rd(GS, rd))
// => e get_e_from_GS_rd 0.8599999999999999
console.log('e get_e_from_rd_rsat', coreFuncs.get_e_from_rd_rsat(rd, rsat))
// => e get_e_from_rd_rsat 0.8599999999999998
console.log('e get_e_from_GS_rsat', coreFuncs.get_e_from_GS_rsat(GS, rsat))
// => e get_e_from_GS_rsat 0.86
console.log('GS get_GS_from_rd_e', coreFuncs.get_GS_from_rd_e(rd, e))
// => GS get_GS_from_rd_e 2.7
console.log('GS get_GS_from_rd_rsat', coreFuncs.get_GS_from_rd_rsat(rd, rsat))
// => GS get_GS_from_rd_rsat 2.6999999999999997
console.log('GS get_GS_from_rsat_e', coreFuncs.get_GS_from_rsat_e(rsat, e))
// => GS get_GS_from_rsat_e 2.7
r = relaPorous(rd, rsat, null, null)
console.log('rd,rsat', r)
// => rd,rsat {
// rd: 14.240322580645163,
// rsat: 18.776129032258066,
// GS: 2.7,
// e: 0.8599999999999998
// }
r = relaPorous(rd, null, GS, null)
console.log('rd,GS', r)
// => rd,GS {
// rd: 14.240322580645163,
// rsat: 18.77612903225807,
// GS: 2.7,
// e: 0.8599999999999999
// }
r = relaPorous(rd, null, null, e)
console.log('rd,e', r)
// => rd,e {
// rd: 14.240322580645163,
// rsat: 18.776129032258066,
// GS: 2.7,
// e: 0.86
// }
r = relaPorous(null, rsat, GS, null)
console.log('rsat,GS', r)
// => rsat,GS {
// rd: 14.240322580645161,
// rsat: 18.776129032258066,
// GS: 2.7,
// e: 0.8600000000000001
// }
r = relaPorous(null, rsat, null, e)
console.log('rsat,e', r)
// => rsat,e {
// rd: 14.240322580645163,
// rsat: 18.776129032258066,
// GS: 2.7,
// e: 0.86
// }
r = relaPorous(null, null, GS, e)
console.log('GS,e', r)
// => GS,e {
// rd: 14.240322580645163,
// rsat: 18.776129032258066,
// GS: 2.7,
// e: 0.86
// }
r = relaPorous(rd, rsat, GS, null)
console.log('rd,rsat,GS', r)
// => rd,rsat,GS {
// rd: 14.240322580645163,
// rsat: 18.776129032258066,
// GS: 2.7,
// e: 0.8599999999999999
// }
r = relaPorous(rd, rsat, null, e)
console.log('rd,rsat,e', r)
// => rd,rsat,e {
// rd: 14.240322580645163,
// rsat: 18.776129032258066,
// GS: 2.7,
// e: 0.86
// }
r = relaPorous(rd, null, GS, e)
console.log('rd,GS,e', r)
// => rd,GS,e {
// rd: 14.240322580645163,
// rsat: 18.776129032258066,
// GS: 2.7,
// e: 0.86
// }
r = relaPorous(null, rsat, GS, e)
console.log('rsat,GS,e', r)
// => rsat,GS,e {
// rd: 14.240322580645163,
// rsat: 18.776129032258066,
// GS: 2.7,
// e: 0.86
// }
try {
r = relaPorous(13.9, null, GS, e)
}
catch (e) {
r = e.toString()
}
console.log('GS,e', r)
// => GS,e {
// rd: 13.9,
// rsat: 18.776129032258066,
// GS: 2.7,
// e: 0.86,
// err: '輸入孔隙比[0.86]與反算出孔隙比[0.9055395683453238]差距過大'
// }
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rd |
Number |
<optional> |
null
|
輸入乾單位重數字,單位kN/m3,預設null |
||||||||||
rsat |
Number |
<optional> |
null
|
輸入飽和單位重數字,單位kN/m3,預設null |
||||||||||
GS |
Number |
<optional> |
null
|
輸入比重數字,無單位,預設null |
||||||||||
e |
Number |
<optional> |
null
|
輸入孔隙比數字,無單位,預設null |
||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳物件,含鍵值rd、rsat、GS、e
- Type
- Object
(static) sepDepthStartEndByDepth(rows, optopt) → {Array}
- Description:
通過指定樣本(例如中點)深度對各樣本起訖深度進行分切
Unit Test: Github
- Source:
Example
let rows
let points
let r
rows = [
{
depthStart: 0,
depthEnd: 5,
data: 'abc',
},
{
depthStart: 5,
depthEnd: 10,
data: 'def',
},
]
points = [{ depth: 2.5 }]
r = sepDepthStartEndByDepth(rows, points)
console.log(r)
// => [
// { depthStart: 0, depthEnd: 2.5, data: 'abc' },
// { depthStart: 2.5, depthEnd: 5, data: 'abc' },
// { depthStart: 5, depthEnd: 10, data: 'def' }
//]
rows = [
{
depthStart: 0,
depthEnd: 5,
data: 'abc',
},
{
depthStart: 5,
depthEnd: 10,
data: 'def',
},
]
points = [{ depth: 0 }]
r = sepDepthStartEndByDepth(rows, points)
console.log(r)
// => [
// { depthStart: 0, depthEnd: 5, data: 'abc' },
// { depthStart: 5, depthEnd: 10, data: 'def' }
//]
rows = [
{
depthStart: 0,
depthEnd: 5,
data: 'abc',
},
{
depthStart: 5,
depthEnd: 10,
data: 'def',
},
]
points = [{ depth: 5 }]
r = sepDepthStartEndByDepth(rows, points)
console.log(r)
// => [
// { depthStart: 0, depthEnd: 5, data: 'abc' },
// { depthStart: 5, depthEnd: 10, data: 'def' }
//]
rows = [
{
depthStart: 0,
depthEnd: 5,
data: 'abc',
},
{
depthStart: 5,
depthEnd: 10,
data: 'def',
},
]
points = [{ depth: -1 }]
r = sepDepthStartEndByDepth(rows, points)
console.log(r)
// => [
// { depthStart: 0, depthEnd: 5, data: 'abc' },
// { depthStart: 5, depthEnd: 10, data: 'def' }
//]
rows = [
{
depthStart: 0,
depthEnd: 5,
data: 'abc',
},
{
depthStart: 5,
depthEnd: 10,
data: 'def',
},
]
points = [{ depth: 11 }]
r = sepDepthStartEndByDepth(rows, points)
console.log(r)
// => [
// { depthStart: 0, depthEnd: 5, data: 'abc' },
// { depthStart: 5, depthEnd: 10, data: 'def' }
//]
rows = [
{
top_depth: 0,
bottom_depth: 5,
data: 'abc',
},
{
top_depth: 5,
bottom_depth: 10,
data: 'def',
},
]
points = [{ center_depth: 5.5 }]
r = sepDepthStartEndByDepth(rows, points, { keyDepthStart: 'top_depth', keyDepthEnd: 'bottom_depth', keyDepth: 'center_depth' })
console.log(r)
// => [
// { top_depth: 0, bottom_depth: 5, data: 'abc' },
// { top_depth: 5, bottom_depth: 5.5, data: 'def' },
// { top_depth: 5.5, bottom_depth: 10, data: 'def' }
//]
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rows |
Array | 輸入數據陣列,各數據為物件,至少需包含起始深度(depthStart)與結束深度(depthEnd),深度單位為m |
||||||||||||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳添加起訖深度的數據陣列
- Type
- Array
(static) smoothDepthByKey(rows, key, optopt) → {Array}
- Description:
平滑化含深度與指定欄位之樣本陣列
Unit Test: Github
- Source:
Example
待補充
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rows |
Array | 輸入物件陣列 |
|||||||||||||||||||||||||||||||||||||
key |
String | 輸入欲平滑之欄位鍵名稱字串 |
|||||||||||||||||||||||||||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳平滑化後陣列
- Type
- Array
(static) sptHBF(row) → {Object}
- Description:
HBF液化分析
- Source:
Example
待補充
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
row |
Object | 輸入數據物件 Properties
|
Returns:
回傳計算後數據物件
- Type
- Object
(static) sptNCEER(row) → {Object}
- Description:
NCEER液化分析
- Source:
Example
待補充
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
row |
Object | 輸入數據物件 Properties
|
Returns:
回傳計算後數據物件
- Type
- Object
(static) sptNJRA(row) → {Object}
- Description:
JRA液化分析
- Source:
Example
待補充
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
row |
Object | 輸入數據物件 Properties
|
Returns:
回傳計算後數據物件
- Type
- Object
(static) sptSeed(row) → {Object}
- Description:
Seed液化分析
- Source:
Example
待補充
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
row |
Object | 輸入數據物件 Properties
|
Returns:
回傳計算後數據物件
- Type
- Object
(static) sptTY(row) → {Object}
- Description:
TY液化分析
- Source:
Example
待補充
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
row |
Object | 輸入數據物件 Properties
|
Returns:
回傳計算後數據物件
- Type
- Object