fosanalysis
A framework to evaluate distributed fiber optic sensor data
Loading...
Searching...
No Matches
shrinking.py
Go to the documentation of this file.
2r"""
3Contains functionality to compensate shrinking and creep.
4\author Bertram Richter
5\date 2022
6"""
7
8import numpy as np
9import scipy.signal
10
11from . import compensator
12
14 r"""
15 Implements compensation for shrink and creeping of concrete.
16 """
17 def __init__(self,
18 method: str = "mean_min",
19 *args, **kwargs):
20 r"""
21 Constructs a ShrinkCompensator object.
22 \param method \copybrief method For more, see \ref method.
23 \param args \copybrief args For more, see \ref args.
24 \param kwargs \copybrief kwargs For more, see \ref kwargs.
25 """
26
29 self.method = method
30
32 self.args = args
33
35 self.kwargs = kwargs
36 def run(self, x: np.array, strain: np.array, strain_inst: np.array) -> np.array:
37 r"""
38 The influence of concrete creep and shrinking is calculated.
39 All of the parameters are assumed to be in sync and sanitized.
40 \param x Positional data.
41 \param strain Strain data, belonging to `x`, that was measured with time delay after applying the load.
42 \param strain_inst Instantaneous strain belonging to `x`, that appear right after applying the load to the structure.
43 \return Returns an array of same length as the given arrays.
44 """
45 assert all(entry is not None for entry in [x, strain, strain_inst]), "Can not compute shrink compensation. At least one of `x`, `strain` and `strain_inst` is None! Please provide all of them!"
46 peaks_min, properties = scipy.signal.find_peaks(-strain_inst, *self.args, **self.kwargs)
47 strain_min_inst = np.array([strain_inst[i] for i in peaks_min])
48 strain_min = np.array([strain[i] for i in peaks_min])
49 min_diff = np.mean(strain_min - strain_min_inst)
50 shrink_calibration_values = np.full(len(x), min_diff)
51 return shrink_calibration_values
Implements compensation for shrink and creeping of concrete.
Definition shrinking.py:13
method
Method, how to calculate the shrinkage calibration.
Definition shrinking.py:29
kwargs
Keyword arguments, will be passed to scipy.signal.find_peaks().
Definition shrinking.py:35
__init__(self, str method="mean_min", *args, **kwargs)
Constructs a ShrinkCompensator object.
Definition shrinking.py:19
np.array run(self, np.array x, np.array strain, np.array strain_inst)
The influence of concrete creep and shrinking is calculated.
Definition shrinking.py:36
args
Positional arguments, will be passed to scipy.signal.find_peaks().
Definition shrinking.py:32