Important

It is very important to check accuracy of asva analysis on your own for production use since asva is under development. Please report bugs to Github Issues.

asva

asva is a package to simulate vibration response of multi degree of freedom system subjected to earthquakes. Response time history and amplitude can be calculated.

Quick Start

Requirements

Python 3.8+

Installation

pip install asva

Minimum code example

import asva as ap

config: ap.AnalysisConfigType = {
   # analysis
   'BETA': 1 / 4,

   # case
   'CASES': [
      {
            'NAME': 'Example',
            'WAVE': 'Sample',
            'AMP': 1,
            'DAMPER': 'None',
            'NDIV': 2,
            'START_TIME': 0,
            'END_TIME': None,
      },
   ],

   # damper
   'DAMPERS': {
      'None': [
            [],
      ],
   },

   # model
   'BASE_ISOLATION': False,
   'H': 0.02,
   'H_TYPE': 0,
   'I': [
      [1],
   ],
   'MI': [100],
   'KI': [
      [{
            'type': 'elastic',
            'k0': 4000,
      }, ],
   ],

   # wave
   'WAVES': {
      'Sample': {
            'NAME': 'Sample',
            'DT': 0.02,
            'NDATA': 2688,
            'TO_METER': 0.01,
            'INPUT_FILE': 'wave/Sample.csv',
            'DELIMITER': None,
            'SKIPROWS': 3,
            'COL': 0,
            'ENCORDING': 'utf',
      },
   },
}


def main():
   analysis = ap.Analysis(config, 0)   # 0は最初のケースを回す。
   analysis.analysis()
   print(analysis.resp.dis)

if __name__ == '__main__':
   main()

Setup Config

Config dict must be provided to Analysis class in asva. asva provides types to validate the dict. Types are defined in Types. You can use them as shown below if needed.

import asva as ap

analysis_config: ap.AnalysisConfigType = {
    <your config>
}

# optional
amp_config: ap.AmplitudeConfigType = {
    <your config>
}

# optional
export_config: ap.ExportConfigType = {
    <your config>
}

analysis = ap.Analysis(analysis_config, 0, amp_config, export_config)
Analysis Config
class AnalysisConfigType(TypedDict):
    # analysis
    BETA: float                 # Newmarkβ法のβ
    BASE_ISOLATION: bool        # 剛性比例型の減衰計算で1層目を無視(C1を0)

    # wave
    WAVES: Dict[str, WaveType]   # 地震波の設定

    # case
    CASES: List[CASESType]        # 解析ケースのリスト

    # model
    H: float                    # 主系粘性減衰定数
    H_TYPE: Literal[0, 1]       # 0: 初期剛性比例型 1: 瞬間合成比例型
    I: List[List[float]]        # インプットする外力(NDOF×1)の行列で指定。地震波入力の場合、通常全て1。
    MI: List[float]             # 主系の質量[ton]
    KI: List[KIType]      # 主系の剛性[kN/m]

    # damper
    DAMPERS: Dict[str, List[List[DamperType]]]
                                # ダンパーのリスト
Amplitude Config
class AmplitudeConfigType(TypedDict):
    N_W: int                    # 応答倍率曲線の出力データ数
    DF: float                   # 応答倍率曲線の出力周波数刻み[Hz]
Export Config
class ExportConfigType(TypedDict):
    RESULT_DIR: str             # 解析結果のディレクトリ名
    RESULT_DATA_DIR_NAME: str   # 解析結果数値データのディレクトリ名
    RESULT_PLOT_DIR_NAME: str   # 解析結果プロットのディレクトリ名
    DATA_PLOT_STORIES: Optional[List[int]]  # 解析結果プロットで出力する層 (配列 or Noneで全指定)

Hysteretic Models

Hysteretic models can be defined and set to AnalysisConfig like below.

# Example
import asva as ap

config: ap.AnalysisConfigType = {
    ...,
    'KI': [
        [ # first storey
            { # first hysteresis
                'type': 'elastic',
                'k0': 4000,
            },
            {  # second hysteresis
                'type': 'elastic',
                'k0': 4000,
            },
        ],
        [ # second storey
            {
                'type': 'elastic',
                'k0': 4000,
            },
        ],
        ...,
    ],
    ...,
}
Elastic
class ElasticType(TypedDict):
    type: Literal["elastic"]
    k0: float                       # 初期剛性[kN/m]
Bilinear
class BilinearType(TypedDict):
    type: Literal["bilinear"]
    k0: float                       # 初期剛性[kN/m]
    a1: float                       # 降伏後剛性低下率[-]
    f1: float                       # 降伏荷重[kN]
Trilinear, Gyakko, Takeda
class TrilinearType(TypedDict):
    type: Literal["gyakko", "takeda", "trilinear"]
    k0: float                       # 初期剛性[kN/m]
    a1: float                       # 降伏後剛性低下率1[-]
    a2: float                       # 降伏後剛性低下率2[-]
    f1: float                       # 降伏荷重1[kN]
    f2: float                       # 降伏荷重2[kN]

Dampers

Dampers can be defined and set to AnalysisConfig like below.

You can register several dampers in config and choose it in CASES.

# Example
import asva as ap

Oil: ap.VDBType = {
    'c1': 100,
    'c2': 50,
    'vr': 0.75,
    'vel_max': 1.5,
}

config: ap.AnalysisConfigType = {
    ...,
    'CASES': [
        {
            'DAMPER': 'VDB_DAMPERS',
            ...,
        },
    ],
    ...,
    'DAMPERS': {
        'VDB_DAMPERS': [
            [
                {
                    'type': 'VDB',
                    'Nd': 1,
                    'd': Oil,
                },
            ],
        ],
    },
    ...,
}
MASS Damper

type MASS

class MASSType(TypedDict):
    m: float
Stopper

type Stopper

class StopperType(TypedDict):
    k: float
    ft: float
Viscous Damper (CV^α)

type VDA

class VDAType(TypedDict):
    cd: float
    alpha: float
    vy: Optional[float]
    vel_max: Optional[float]
Viscous Damper (Bilinear)

type VDB

class VDBType(TypedDict):
    c1: float
    c2: float
    vr: float
    vel_max: float
TMD

type TMD

class TMDType(TypedDict):
    md: float
    cd: float
    kd: float
iRDT

type iRDT

class iRDTType(TypedDict):
    md: float
    cd: float
    alpha: float
    kb: float
    fr: float
    cosA: float

General Indices