From 773bdd8164dacc9ce9e3bb30470bbb7734dc1983 Mon Sep 17 00:00:00 2001 From: st_func Date: Mon, 12 Feb 2024 18:07:17 +0900 Subject: [PATCH] =?UTF-8?q?=E6=96=AD=E9=9D=A2=E7=A9=8D=E3=81=AB=E5=AF=BE?= =?UTF-8?q?=E3=81=99=E3=82=8B=E5=8D=98=E4=BD=8D=E8=B3=AA=E9=87=8F=E3=82=92?= =?UTF-8?q?=E6=B1=82=E3=82=81=E3=82=8B=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constant.ts | 6 ++++++ src/sec/build-h-function.test.ts | 11 +++++++++++ src/sec/build-h-function.ts | 5 +++++ src/sec/steel-function.test.ts | 5 +++++ src/sec/steel-function.ts | 14 ++++++++++++++ 5 files changed, 41 insertions(+) create mode 100644 src/sec/steel-function.test.ts create mode 100644 src/sec/steel-function.ts diff --git a/src/constant.ts b/src/constant.ts index 3943702..1daebcc 100644 --- a/src/constant.ts +++ b/src/constant.ts @@ -1,8 +1,14 @@ +/** + * 鋼材の密度(kg/m^3) + */ +export const STEEL_DENSITY: number = 7850.0; + /** * 断面性能のタイプ */ export const enum SectionPropertyType { Area = "断面積", + MassPerMetre = "単位質量", SecondMomentOfAreaY = "断面二次モーメントY", SecondMomentOfAreaZ = "断面二次モーメントZ", } diff --git a/src/sec/build-h-function.test.ts b/src/sec/build-h-function.test.ts index 9d88cfb..e9422ed 100644 --- a/src/sec/build-h-function.test.ts +++ b/src/sec/build-h-function.test.ts @@ -13,6 +13,17 @@ test("ビルドHのA", () => { ); }); +test("ビルドHの単位質量", () => { + const H = 1.2; + const B = 0.4; + const T1 = 0.019; + const T2 = 0.025; + const M = 328.5225; + expect( + SecBuildHFunction.buildH(SectionPropertyType.MassPerMetre, H, B, T1, T2) + ).toBe(M); +}); + test("ビルドHのIy", () => { const H = 1.2; const B = 0.4; diff --git a/src/sec/build-h-function.ts b/src/sec/build-h-function.ts index 09f5c5b..c798fea 100644 --- a/src/sec/build-h-function.ts +++ b/src/sec/build-h-function.ts @@ -1,4 +1,5 @@ import { SectionPropertyType } from "../constant"; +import { SecSteelFunction } from "./steel-function"; /** * 組立H形鋼の断面性能を計算する関数集 */ @@ -65,6 +66,10 @@ export class SecBuildHFunction { switch (propertyType) { case SectionPropertyType.Area: return SecBuildHFunction.buildHArea(a, b, t1, t2); + case SectionPropertyType.MassPerMetre: + return SecSteelFunction.massPerMetre( + SecBuildHFunction.buildHArea(a, b, t1, t2) + ); case SectionPropertyType.SecondMomentOfAreaY: return SecBuildHFunction.buildHSecondMomentOfAreaY(a, b, t1, t2); case SectionPropertyType.SecondMomentOfAreaZ: diff --git a/src/sec/steel-function.test.ts b/src/sec/steel-function.test.ts new file mode 100644 index 0000000..a676a65 --- /dev/null +++ b/src/sec/steel-function.test.ts @@ -0,0 +1,5 @@ +import { SecSteelFunction } from "./steel-function"; + +test("鉄骨の単位質量", () => { + expect(SecSteelFunction.massPerMetre(10.0)).toBe(78500.0); +}); diff --git a/src/sec/steel-function.ts b/src/sec/steel-function.ts new file mode 100644 index 0000000..9e195f1 --- /dev/null +++ b/src/sec/steel-function.ts @@ -0,0 +1,14 @@ +import { STEEL_DENSITY } from "../constant"; +/** + * 鉄骨断面に関する関数 + */ +export class SecSteelFunction { + /** + * 単位質量 + * @param area 断面積 + * @returns 単位質量 + */ + static massPerMetre(area: number): number { + return STEEL_DENSITY * area; + } +}