/pdhi

Physics-DNN hybridized integration time stepper (demo)

Primary LanguagePython

Physics-DNN Hybridized Time-Stepper in Structural Seismic Response Prediction

Homepage

This source code is for the paper J. Guo, R. Enokida, D. Li, & K. Ikago. Combination of physics-based and data-driven modeling for nonlinear structural seismic response prediction through deep residual learning. Earthquake Engineering and Structural Dynamics, 2023; 00:1-23.

Table of contents

Introduction

In this study, a discrete Physics-DNN hybridized integration (PDHI) time-stepper is presented to compute the time evolution of nonlinear structural dynamic systems under seismic excitation. The basic idea of this method is to generate the future states of the nonlinear dynamic system with two different time-steppers: exponential integration stepper for the system's displacement and velocity states and DNN flow map stepper for the augmented nonlinear restoring force states. The DNN flow map stepper employs the ResNet to model the nonlinear dynamics and its input-output relation is derived from the general form of linear multistep method.

figure 1: method

Directory

|- mechanical_system.py (benchmark example in Section 4.1 of the published paper)

|- train.py (training model of DNN flow map stepper)

|- predict.py (PDHI prediction based on the trained model)

|- train_data.mat (demo data for training)

|- predict_data.mat (demo data for prediction)

|- Readme.md

|- requirements.txt

|-- result (save run results)

 |- model (save trained model)

 |- prediction.mat (prediction output)

System requirements

Most code is written in Python 3, and depends on the open source framework PyTorch. Demo data is generated by Matlab.

Installation guide

  1. Install Python 3
  2. Install requirements.txt
cd [directory of this project]
pip install -r requirement.txt

Demo

Case Base-isolated seven-story shear building in Section 4.1

  1. Run train.py, which will load the training dataset (see FIGURE 6) and train an implict DNN time-stepper (M=0) for the nonlinear damping system;

A standard output is

X:\...\pdhi (CODE_ROOT)
Dataset loaded. Now training...

Epoch 100
-------------------------------
Train Loss: 2.040098, Eval Loss: 0.3081, [    1/  100]
Train Loss: 0.274806, Eval Loss: 0.2204, [    2/  100]
Train Loss: 0.234243, Eval Loss: 0.1991, [    3/  100]
...
Train Loss: 0.006947, Eval Loss: 0.0013, [   99/  100]
Train Loss: 0.006905, Eval Loss: 0.0014, [  100/  100]

Best loss: 0.00414

The training and evaluation errors for each epoch will be saved in the file './result/model.csv'.

To view the input data, change the parameter show_data into True in the function MyDataset().

  1. Run predict.py, which will give structural seismic response prediction according to Algorithm 1 in Section 2.2.3. The isolator's damping force predicted by PDHI and its ground truth will be displayed in the screen.

A standard output is

X:\...\pdhi (CODE_ROOT)
-------------------------------------
Input shape (ground motion): (4, 6001, 1)
Batch size: 4
Total 6000 Steps.
Running....
Output shape (response): (4, 6001, 15)
-------------------------------------
Predict completed.

The seismic response results obtained by PDHI will be saved in the file './result/prediction.mat'.

Citation

This work is funded by the Japan Society for the Promotion of Science (JSPS). If you use this code for academic research, please cite the following paper:

@article{guo2023combination,
  title={Combination of physics-based and data-driven modeling for nonlinear structural seismic response prediction through deep residual learning},
  author={Guo J, Enokida R, Li D, Ikago K},
  journal={Earthquake Engineering Structural Dynamics},
  volume={00},
  pages={1-23},
  year={2023},
  publisher={Wiley}
}