Skip to content

Commit

Permalink
断面積に対する単位質量を求める関数を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
st-func committed Feb 12, 2024
1 parent 89afb00 commit 773bdd8
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 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",
}
11 changes: 11 additions & 0 deletions src/sec/build-h-function.test.ts
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/sec/build-h-function.ts
@@ -1,4 +1,5 @@
import { SectionPropertyType } from "../constant";
import { SecSteelFunction } from "./steel-function";
/**
* 組立H形鋼の断面性能を計算する関数集
*/
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions src/sec/steel-function.test.ts
@@ -0,0 +1,5 @@
import { SecSteelFunction } from "./steel-function";

test("鉄骨の単位質量", () => {
expect(SecSteelFunction.massPerMetre(10.0)).toBe(78500.0);
});
14 changes: 14 additions & 0 deletions 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;
}
}

0 comments on commit 773bdd8

Please sign in to comment.