dvars


Namedvars JSON
Version 0.1.6 PyPI version JSON
download
home_pageNone
SummaryResponse spectra calculations for earthquake engineering
upload_time2025-07-24 11:23:57
maintainerNone
docs_urlNone
authorNone
requires_python>=3.4
licenseNone
keywords response spectra earthquake engineering
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# DVARS - Elastic Displacement, Velocity and Acceleration Response Spectra


## Overview
In earthquake engineering response spectrum is used to analyze the dynamic reponse of structures to seismic events.
The response spectrum shows the maximum values of displacement, velocity and/or acceleration
as a function of frequency or period.

The calculation is based on the assumption that the structure behaves as a simple harmonic oscillator,
damped by default to only 5% and its natural frequency is tuned to the tested frequency.
The response spectrum can be determined by applying the same earthquake to a series
of simple oscillators with different natural frequencies and a uniform damping of 5%.
In the analog implementation of this test, the earthquake acts on a series of oscillators in parallel, 
while computer simulation is usually arranged serially - by repeatedly processing
the time record of the earthquake on a sequentially retuned harmonic oscillator model.
For each excitation of the recorded acceleration waveform, the maximum observed response
in terms of relative displacement or absolute acceleration is recorded.

This repository provides a Python interface to a C implementation of response spectrum computation,
which is based on the widely used fortran code ``rdcalcdp``
[EXSIM12 repository](https://github.com/GFZ-Centre-for-Early-Warning/exsim),
[EXSIM12](https://www.seismotoolbox.ca/EXSIM12/EXSIM12.for),
published by David M. Boore in 2008 as part of the TSPP package.
This is a modified version of the algorithm ``Quake.For``, originally written by J.M. Roesset in 1971.
The formulation is from Nigam and Jennings (BSSA, v. 59, 909-922, 1969).

## Installation prerequisites
- Python 3.x
- Dependencies: ctypes, numpy, matplotlib

For building the C extension:
- C compiler (e.g., GCC)
- Cross-compilation tools Mingw64 if building for MS Windows
- Python build tools: `setuptools`, `wheel`, `build`

## Installation

The DVARS package is available on PyPI and can be installed using pip:
```bash
pip install dvars --upgrade
```

or you can install it directly from the wheel:
```bash
pip install dvars-0.1.2-cp311-cp311-linux_x86_64.whl --upgrade
```

## Building the wheel package

Download the git repository
```bash
git clone https://github.com/ipemu/dvars.git
```
or download the source package from the releases page and unzip.

To build the package and the C extension, you can use the provided Makefile
from the root directory of the package:

Native build  (was tested on Linux only).
```bash
# linux native build
# creates both source and wheel distributions
make build
```
Linux cross-compilation creates a wheel distribution for Windows.
```bash
# buildw32 is for 32-bit Windows builds
make buildw32
# buildw64 is for 64-bit Windows builds
make buildw64
```
The resulting wheel files will be located in the ``dist`` directory.

## Usage
```python
# Import the dars function from the dvars module
from dvars import dars
# Use help for listing arguments
help(dars)
```
The ``dars`` function provides a calculation of the response spectrum.
The input is a time history of ground motion (accelerogram)
and the output is a tuple containing:
- A numpy array of frequencies (in Hz)
- A numpy array of relative displacements
- A numpy array of absolute accelerations

Simply as the output of the dars function we get DSR - Displacement Response Spectra.
Other modifications used in practice are:
- PSA (PARS) - Pseudo Acceleration Response Spectra,
- PSV (PVRS) - Pseudo Velocity Response Spectra,

which can be derived from DSR according to the following relationships:
- pseudo-velocity response spectrum PSV(f) = (2 pi f) DRS(f)
- pseudo-acceleration response spectrum PSA(f) = (2 pi f) PSV(f)

The series of absolute accelerations AA is given for completeness.
Due to the small value of the standard oscillator damping (5 %), the values
of absolute acceleration AA and pseudo-acceleration response spectrum PSA are practically the same.

$$AA(f) \sim \mathsf{PSA}(f) = (2 \pi f)^2 \mathsf{DRS}(f)$$

The absolute acceleration and pseudo-acceleration values start to differ significantly in situations such as long periods and/or greater than standard damping.

For study purposes, the function ``osc_aa`` can be used,
which calculates the response of an oscillator tuned to a given frequency and damping
to the ground acceleration at the input.

## Example
Examples are not included in the distribution package,
but you can find them in the repository https://github.com/ipemu/dvars in the `examples` directory.

The notebook ``example_dars_esmdb.ipynb`` compares the response spectrum calculated by the `dvars.dars` function
with the data stored in the [ESM-DB](https://esm-db.eu), the Engineering Strong-Motion Database. 
```bash
jupyter notebook examples/example_dvars.ipynb
```

## Limitations
- The algorithm is designed for linear oscillators and may not be suitable for non-linear systems.
- If non-standard damping is required, then the assumptions for calculating pseudo-acceleration
  from the relative displacement series are not met and the results may not be accurate.
  Use the absolute acceleration series instead.

## Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements,
please open an issue or submit a pull request.

## License
This project is licensed under the MIT License. 

## Literature
- Nigam, N.C., and Jennings, P.C. (1969). "Calculation of Response Spectra from Strong-motion Earthquake Records." Bulletin of the Seismological Society of America, Vol. 59, No.2, pp. 909-922. April, 1969
- David M. Boore (2008) TSPP - A Collection of FORTRAN Programs for Processing and Manipulating Time Series. U.S. Geological Survey Open-File Report 2008-1111. Version 1.2, March 2008. https://pubs.usgs.gov/of/2008/1111/of2008-1111_v1.2.pdf

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dvars",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.4",
    "maintainer_email": null,
    "keywords": "response spectra, earthquake engineering",
    "author": null,
    "author_email": "Pavel Zacherle <zapa@ipe.muni.cz>",
    "download_url": "https://files.pythonhosted.org/packages/ee/67/c5615eca6aaed724681d55ff213bd0cbcfa993e37edee42660971cc5c1c7/dvars-0.1.6.tar.gz",
    "platform": null,
    "description": "\n# DVARS - Elastic Displacement, Velocity and Acceleration Response Spectra\n\n\n## Overview\nIn earthquake engineering response spectrum is used to analyze the dynamic reponse of structures to seismic events.\nThe response spectrum shows the maximum values of displacement, velocity and/or acceleration\nas a function of frequency or period.\n\nThe calculation is based on the assumption that the structure behaves as a simple harmonic oscillator,\ndamped by default to only 5% and its natural frequency is tuned to the tested frequency.\nThe response spectrum can be determined by applying the same earthquake to a series\nof simple oscillators with different natural frequencies and a uniform damping of 5%.\nIn the analog implementation of this test, the earthquake acts on a series of oscillators in parallel, \nwhile computer simulation is usually arranged serially - by repeatedly processing\nthe time record of the earthquake on a sequentially retuned harmonic oscillator model.\nFor each excitation of the recorded acceleration waveform, the maximum observed response\nin terms of relative displacement or absolute acceleration is recorded.\n\nThis repository provides a Python interface to a C implementation of response spectrum computation,\nwhich is based on the widely used fortran code ``rdcalcdp``\n[EXSIM12 repository](https://github.com/GFZ-Centre-for-Early-Warning/exsim),\n[EXSIM12](https://www.seismotoolbox.ca/EXSIM12/EXSIM12.for),\npublished by David M. Boore in 2008 as part of the TSPP package.\nThis is a modified version of the algorithm ``Quake.For``, originally written by J.M. Roesset in 1971.\nThe formulation is from Nigam and Jennings (BSSA, v. 59, 909-922, 1969).\n\n## Installation prerequisites\n- Python 3.x\n- Dependencies: ctypes, numpy, matplotlib\n\nFor building the C extension:\n- C compiler (e.g., GCC)\n- Cross-compilation tools Mingw64 if building for MS Windows\n- Python build tools: `setuptools`, `wheel`, `build`\n\n## Installation\n\nThe DVARS package is available on PyPI and can be installed using pip:\n```bash\npip install dvars --upgrade\n```\n\nor you can install it directly from the wheel:\n```bash\npip install dvars-0.1.2-cp311-cp311-linux_x86_64.whl --upgrade\n```\n\n## Building the wheel package\n\nDownload the git repository\n```bash\ngit clone https://github.com/ipemu/dvars.git\n```\nor download the source package from the releases page and unzip.\n\nTo build the package and the C extension, you can use the provided Makefile\nfrom the root directory of the package:\n\nNative build  (was tested on Linux only).\n```bash\n# linux native build\n# creates both source and wheel distributions\nmake build\n```\nLinux cross-compilation creates a wheel distribution for Windows.\n```bash\n# buildw32 is for 32-bit Windows builds\nmake buildw32\n# buildw64 is for 64-bit Windows builds\nmake buildw64\n```\nThe resulting wheel files will be located in the ``dist`` directory.\n\n## Usage\n```python\n# Import the dars function from the dvars module\nfrom dvars import dars\n# Use help for listing arguments\nhelp(dars)\n```\nThe ``dars`` function provides a calculation of the response spectrum.\nThe input is a time history of ground motion (accelerogram)\nand the output is a tuple containing:\n- A numpy array of frequencies (in Hz)\n- A numpy array of relative displacements\n- A numpy array of absolute accelerations\n\nSimply as the output of the dars function we get DSR - Displacement Response Spectra.\nOther modifications used in practice are:\n- PSA (PARS) - Pseudo Acceleration Response Spectra,\n- PSV (PVRS) - Pseudo Velocity Response Spectra,\n\nwhich can be derived from DSR according to the following relationships:\n- pseudo-velocity response spectrum PSV(f) = (2 pi f) DRS(f)\n- pseudo-acceleration response spectrum PSA(f) = (2 pi f) PSV(f)\n\nThe series of absolute accelerations AA is given for completeness.\nDue to the small value of the standard oscillator damping (5 %), the values\nof absolute acceleration AA and pseudo-acceleration response spectrum PSA are practically the same.\n\n$$AA(f) \\sim \\mathsf{PSA}(f) = (2 \\pi f)^2 \\mathsf{DRS}(f)$$\n\nThe absolute acceleration and pseudo-acceleration values start to differ significantly in situations such as long periods and/or greater than standard damping.\n\nFor study purposes, the function ``osc_aa`` can be used,\nwhich calculates the response of an oscillator tuned to a given frequency and damping\nto the ground acceleration at the input.\n\n## Example\nExamples are not included in the distribution package,\nbut you can find them in the repository https://github.com/ipemu/dvars in the `examples` directory.\n\nThe notebook ``example_dars_esmdb.ipynb`` compares the response spectrum calculated by the `dvars.dars` function\nwith the data stored in the [ESM-DB](https://esm-db.eu), the Engineering Strong-Motion Database. \n```bash\njupyter notebook examples/example_dvars.ipynb\n```\n\n## Limitations\n- The algorithm is designed for linear oscillators and may not be suitable for non-linear systems.\n- If non-standard damping is required, then the assumptions for calculating pseudo-acceleration\n  from the relative displacement series are not met and the results may not be accurate.\n  Use the absolute acceleration series instead.\n\n## Contributing\nContributions are welcome! If you find any issues or have suggestions for improvements,\nplease open an issue or submit a pull request.\n\n## License\nThis project is licensed under the MIT License. \n\n## Literature\n- Nigam, N.C., and Jennings, P.C. (1969). \"Calculation of Response Spectra from Strong-motion Earthquake Records.\" Bulletin of the Seismological Society of America, Vol. 59, No.2, pp. 909-922. April, 1969\n- David M. Boore (2008) TSPP - A Collection of FORTRAN Programs for Processing and Manipulating Time Series. U.S. Geological Survey Open-File Report 2008-1111. Version 1.2, March 2008. https://pubs.usgs.gov/of/2008/1111/of2008-1111_v1.2.pdf\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Response spectra calculations for earthquake engineering",
    "version": "0.1.6",
    "project_urls": {
        "Issues": "https://github.com/ipemu/dvars/issues",
        "Repository": "https://github.com/ipemu/dvars.git"
    },
    "split_keywords": [
        "response spectra",
        " earthquake engineering"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3d53883d4f37213cd938583527f5d7626578a9298daf2b2923f76f3d0bd62206",
                "md5": "6cf61d56109629f53fc4c115aab78a3b",
                "sha256": "19748f089017228e72a3e81bb2135b3fee94a1848c9cb9feb9e55f31cd32eee7"
            },
            "downloads": -1,
            "filename": "dvars-0.1.6-cp311-cp311-manylinux1_x86_64.manylinux_2_5_x86_64.whl",
            "has_sig": false,
            "md5_digest": "6cf61d56109629f53fc4c115aab78a3b",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.4",
            "size": 17196,
            "upload_time": "2025-07-24T11:23:53",
            "upload_time_iso_8601": "2025-07-24T11:23:53.706273Z",
            "url": "https://files.pythonhosted.org/packages/3d/53/883d4f37213cd938583527f5d7626578a9298daf2b2923f76f3d0bd62206/dvars-0.1.6-cp311-cp311-manylinux1_x86_64.manylinux_2_5_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c3f89b34abeabe85c16d0dfab1d9a15277fb69fe356c1ab52fc7f6796f340b7e",
                "md5": "67526737f4373257499bf3b07f37c5e9",
                "sha256": "ebcc18a023ea5f0c2532e23c8f268addf32a51a11b17c50b87b296bc2f089b88"
            },
            "downloads": -1,
            "filename": "dvars-0.1.6-py3-none-win32.whl",
            "has_sig": false,
            "md5_digest": "67526737f4373257499bf3b07f37c5e9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.4",
            "size": 43496,
            "upload_time": "2025-07-24T11:23:56",
            "upload_time_iso_8601": "2025-07-24T11:23:56.724224Z",
            "url": "https://files.pythonhosted.org/packages/c3/f8/9b34abeabe85c16d0dfab1d9a15277fb69fe356c1ab52fc7f6796f340b7e/dvars-0.1.6-py3-none-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1c2a19be8661ec166bc89c22c2fcc507fec8ecd65d9e7feb2a2f443782ffa53b",
                "md5": "a229e0651ec90168b0d06744e2bf1e53",
                "sha256": "b75e02eae2b612dfb1c01ef011081211abc2a8105c4fef492433664d4a1a514c"
            },
            "downloads": -1,
            "filename": "dvars-0.1.6-py3-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "a229e0651ec90168b0d06744e2bf1e53",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.4",
            "size": 47114,
            "upload_time": "2025-07-24T11:23:55",
            "upload_time_iso_8601": "2025-07-24T11:23:55.326632Z",
            "url": "https://files.pythonhosted.org/packages/1c/2a/19be8661ec166bc89c22c2fcc507fec8ecd65d9e7feb2a2f443782ffa53b/dvars-0.1.6-py3-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ee67c5615eca6aaed724681d55ff213bd0cbcfa993e37edee42660971cc5c1c7",
                "md5": "dd76c80915049d700d857409f6e4faf2",
                "sha256": "f00a2df64e813fe3a834b04269b3371112bbcd0c49e05bf2a183aee9075cca5a"
            },
            "downloads": -1,
            "filename": "dvars-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "dd76c80915049d700d857409f6e4faf2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.4",
            "size": 16731,
            "upload_time": "2025-07-24T11:23:57",
            "upload_time_iso_8601": "2025-07-24T11:23:57.941642Z",
            "url": "https://files.pythonhosted.org/packages/ee/67/c5615eca6aaed724681d55ff213bd0cbcfa993e37edee42660971cc5c1c7/dvars-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-24 11:23:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ipemu",
    "github_project": "dvars",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "dvars"
}
        
Elapsed time: 0.70479s