Skip to content

Commit ce47244

Browse files
authored
Replay function redone and beam experiment data added (#39)
- Updates clustering and mode tracking modules - Separates YaFEM models from methods - Updates documentation - Adds recorded data of cantilever beam for repeatable experiments
1 parent 7a4568c commit ce47244

File tree

26 files changed

+177143
-144
lines changed

26 files changed

+177143
-144
lines changed

USERGUIDE.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ Inside `examples/run_sysid.py`, `examples/run_mode_clustering.py`, `examples/run
4747
the sample time can be changed: `number_of_minutes`.
4848

4949
* **Parameters**
50-
Inside `method/constans.py` the parameters for system identification, mode clustering, mode tracking and model updating
50+
Inside `method/constants.py` the parameters for system identification, mode clustering, mode tracking and model updating
5151
can be changed.
5252

5353
* **Model**
5454
A digital YAFEM model can be added to `models/<your_model>`.
55-
Inside `method/constans.py` the model paramters can be set together with the paths to the model folder and the model function file.
55+
Inside `method/constants.py` the model paramters can be set together with the paths to the model folder and the model function file.
5656

5757

5858
## Step 1.4 Run examples
@@ -124,7 +124,7 @@ poetry build
124124
```
125125

126126
This will create a `.whl` file in the `dist/` directory,
127-
e.g., `dist/cp_sens-0.6.0-py3-none-any.whl`.
127+
e.g., `dist/cp_sens-0.6.1-py3-none-any.whl`.
128128

129129
### Step 2.2: Create and Activate a Virtual Environment
130130

@@ -141,7 +141,7 @@ pip install example_shm-<version>-py3-none-any.whl
141141
```
142142

143143
Replace `<version>` with the version number found in the `.whl`
144-
filename. (e.g `0.6.0`).
144+
filename. (e.g `0.6.1`).
145145

146146
## Step 2.4: Create Configuration
147147

@@ -226,7 +226,6 @@ Options:
226226
Commands:
227227
accelerometers
228228
align-readings
229-
align-readings-plot
230229
clustering-with-local-sysid
231230
clustering-with-remote-sysid
232231
live-clustering-with-remote-sysid
@@ -257,13 +256,6 @@ $example-shm
257256
Usage: example-shm --config <config-file> accelerometers
258257
```
259258

260-
261-
262-
263-
264-
265-
266-
267259
## Distributed Setup Overview
268260

269261
This explains the setup needed to run the distributed version of the example-shm pipeline.
@@ -310,7 +302,7 @@ CONFIG_PATH = "config/replay.json"
310302
RECORDINGS_DIR = "record/mqtt_recordings"
311303
FILE_NAME = "recording.jsonl"
312304

313-
REPLAY_SPEED = 0.1 # Multiplier for replay speed
305+
REPLAY_SPEED = 1 # Multiplier for replay speed
314306
```
315307
At the bottom the number of times to loop the replay function can be stated: `replay_mqtt_messages(loop=10) # Times to loop`
316308

models/beam/beam_yafem_model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ def eval_yafem_model(pars=None):
1414
l1 = pars.setdefault('l1' ,0.030) # [m] distance from the beam top to the top accelerometer
1515
l2 = pars.setdefault('l2' ,0.0675) # [m] distance between the accelerometers 0.0675
1616
l3 = pars.setdefault('l3' ,0.070) # [m] distance between the supports
17-
l4 = pars.setdefault('l4' ,0.130) # [m] VARIABLE approx. the depth of the "ground"
17+
l4 = pars.setdefault('l4' ,0.1289) # [m] VARIABLE approx. the depth of the "ground"
1818
E = pars.setdefault('E' ,200e9) # [Pa] Young modulus, normal steel
1919
b = pars.setdefault('b' ,29e-3) # [m] width of the ruler
2020
h = pars.setdefault('h' ,1e-3) # [m] thichness of the ruler
2121
rho = pars.setdefault('rho',7850) # [kg/m3] density of the steel
2222
m = pars.setdefault('m' ,15e-3) # [kg] VARIABLE tip mass
23-
k_rot = pars.setdefault('k_rot' ,3.5e3) # [Nm/rad] VARIABLE rotational stiffness
23+
k_rot = pars.setdefault('k_rot' ,10) # [Nm/rad] VARIABLE rotational stiffness
2424
modes = pars.setdefault('modes' ,3)
2525
dofs_sel = pars.setdefault('dofs_sel',np.array([1,1]))
2626

@@ -59,7 +59,7 @@ def eval_yafem_model(pars=None):
5959
mass_pars['dofs'] = np.array([[8,1]])
6060
mass_tip = MCK(myNodes,mass_pars)
6161

62-
# # springs
62+
# springs
6363
spring_pars = {}
6464
spring_pars['K'] = np.array([[k_rot,0],[0,k_rot]])
6565
spring_pars['dofs'] = np.array([[3,3],[2,3]])
@@ -136,4 +136,4 @@ def eval_yafem_model(pars=None):
136136
idxs_sel = myModel.find_dofs(dofs_sel)
137137
phi_sel = phi[idxs_sel,:]
138138

139-
return omega, phi, phi_sel, myModel
139+
return omega, phi, phi_sel, myModel, mySimulation

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "example-shm"
3-
version = "0.6.0"
3+
version = "0.6.1"
44
description = "Demonstration for structural health monitoring of engineering structures"
55
authors = [
66
"Mohamed Abdulkarim <202206332@post.au.dk>",
@@ -14,7 +14,8 @@ packages = [
1414
{include = "examples", from="src"},
1515
{include = "functions", from="src"},
1616
{include = "methods", from="src"},
17-
{include = "beam", from="models"}
17+
{include = "beam", from="models"},
18+
{include = "record"}
1819
]
1920

2021
[tool.poetry.dependencies]

record/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Purpose
2+
The record.py and replay.py files are used to record data from MQTT topics which later can be replayed and re-published with replay.py.
3+
4+
# Run the functions
5+
The functions are directly run with:
6+
```bash
7+
python ./record/record.py
8+
9+
python ./record/replay.py
10+
```
11+
12+
# Parameters for record.py
13+
14+
CONFIG_PATH = "<path>.json": Path to config file
15+
16+
RECORDINGS_DIR : Directory path to what folder to save recording to
17+
18+
FILE_NAME = "<name>.jsonl": filename for saved recording file
19+
20+
DURATION_SECONDS: Recording duration in seconds
21+
22+
# Parameters for replay.py
23+
24+
CONFIG_PATH = "<path>.json": Path to config file
25+
26+
RECORDINGS_DIR : Directory path to what folder the file to replay
27+
FILE_NAME = "<name>.jsonl": filename for file to replay
28+
29+
REPLAY_SPEED: # Multiplier for replay speed
30+
31+
KEEP_UP_TIME: If delay time (remaining) is lower than this time, warn the user that the replay speed is two fast.
32+
33+
PRINT_INTERVAL: Interval between printing information
34+
35+
BATCH_SIZE: Number of values in every MQTT package
36+
37+
LOOPS: Number of times to loop over the recording

0 commit comments

Comments
 (0)