timoshenko-engine 2.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. timoshenko_engine-2.0.1/LICENSE +190 -0
  2. timoshenko_engine-2.0.1/PKG-INFO +237 -0
  3. timoshenko_engine-2.0.1/README.md +205 -0
  4. timoshenko_engine-2.0.1/pyproject.toml +57 -0
  5. timoshenko_engine-2.0.1/setup.cfg +4 -0
  6. timoshenko_engine-2.0.1/src/timoshenko/__init__.py +173 -0
  7. timoshenko_engine-2.0.1/src/timoshenko/_validation.py +19 -0
  8. timoshenko_engine-2.0.1/src/timoshenko/adapters.py +111 -0
  9. timoshenko_engine-2.0.1/src/timoshenko/assets.py +57 -0
  10. timoshenko_engine-2.0.1/src/timoshenko/beams.py +75 -0
  11. timoshenko_engine-2.0.1/src/timoshenko/csv_source.py +187 -0
  12. timoshenko_engine-2.0.1/src/timoshenko/health.py +149 -0
  13. timoshenko_engine-2.0.1/src/timoshenko/mechanics.py +54 -0
  14. timoshenko_engine-2.0.1/src/timoshenko/modal.py +243 -0
  15. timoshenko_engine-2.0.1/src/timoshenko/monitor.py +48 -0
  16. timoshenko_engine-2.0.1/src/timoshenko/mqtt.py +272 -0
  17. timoshenko_engine-2.0.1/src/timoshenko/multichannel.py +105 -0
  18. timoshenko_engine-2.0.1/src/timoshenko/observations.py +96 -0
  19. timoshenko_engine-2.0.1/src/timoshenko/oma.py +254 -0
  20. timoshenko_engine-2.0.1/src/timoshenko/plugins.py +142 -0
  21. timoshenko_engine-2.0.1/src/timoshenko/polygon.py +254 -0
  22. timoshenko_engine-2.0.1/src/timoshenko/pressure.py +33 -0
  23. timoshenko_engine-2.0.1/src/timoshenko/project.py +251 -0
  24. timoshenko_engine-2.0.1/src/timoshenko/report.py +154 -0
  25. timoshenko_engine-2.0.1/src/timoshenko/sections.py +119 -0
  26. timoshenko_engine-2.0.1/src/timoshenko/sensors.py +142 -0
  27. timoshenko_engine-2.0.1/src/timoshenko/sensorthings.py +259 -0
  28. timoshenko_engine-2.0.1/src/timoshenko/session.py +388 -0
  29. timoshenko_engine-2.0.1/src/timoshenko/shafts.py +36 -0
  30. timoshenko_engine-2.0.1/src/timoshenko/stability.py +30 -0
  31. timoshenko_engine-2.0.1/src/timoshenko/storage.py +413 -0
  32. timoshenko_engine-2.0.1/src/timoshenko/strength.py +29 -0
  33. timoshenko_engine-2.0.1/src/timoshenko/structure.py +103 -0
  34. timoshenko_engine-2.0.1/src/timoshenko/uncertainty.py +261 -0
  35. timoshenko_engine-2.0.1/src/timoshenko/update.py +46 -0
  36. timoshenko_engine-2.0.1/src/timoshenko/vibration.py +138 -0
  37. timoshenko_engine-2.0.1/src/timoshenko_engine.egg-info/PKG-INFO +237 -0
  38. timoshenko_engine-2.0.1/src/timoshenko_engine.egg-info/SOURCES.txt +48 -0
  39. timoshenko_engine-2.0.1/src/timoshenko_engine.egg-info/dependency_links.txt +1 -0
  40. timoshenko_engine-2.0.1/src/timoshenko_engine.egg-info/entry_points.txt +3 -0
  41. timoshenko_engine-2.0.1/src/timoshenko_engine.egg-info/requires.txt +10 -0
  42. timoshenko_engine-2.0.1/src/timoshenko_engine.egg-info/top_level.txt +1 -0
  43. timoshenko_engine-2.0.1/tests/test_adapters.py +425 -0
  44. timoshenko_engine-2.0.1/tests/test_formulas.py +189 -0
  45. timoshenko_engine-2.0.1/tests/test_modal.py +247 -0
  46. timoshenko_engine-2.0.1/tests/test_package.py +56 -0
  47. timoshenko_engine-2.0.1/tests/test_polygon.py +105 -0
  48. timoshenko_engine-2.0.1/tests/test_project_report.py +105 -0
  49. timoshenko_engine-2.0.1/tests/test_storage_session.py +230 -0
  50. timoshenko_engine-2.0.1/tests/test_uncertainty.py +79 -0
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Ayberk Korkmaz
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,237 @@
1
+ Metadata-Version: 2.4
2
+ Name: timoshenko-engine
3
+ Version: 2.0.1
4
+ Summary: Composable structural engineering calculations and analysis primitives for Python applications.
5
+ Author: Ayberk Korkmaz
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/Ayberkrk/timoshenko
8
+ Project-URL: Repository, https://github.com/Ayberkrk/timoshenko
9
+ Project-URL: Issues, https://github.com/Ayberkrk/timoshenko/issues
10
+ Project-URL: Documentation, https://github.com/Ayberkrk/timoshenko/tree/main/docs
11
+ Keywords: civil engineering,structural engineering,structural health monitoring,modal analysis,digital twin
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Scientific/Engineering
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: numpy>=1.24
25
+ Provides-Extra: mqtt
26
+ Requires-Dist: paho-mqtt<3,>=2.1; extra == "mqtt"
27
+ Provides-Extra: test
28
+ Requires-Dist: pytest>=7; extra == "test"
29
+ Provides-Extra: docs
30
+ Requires-Dist: mkdocs-material<10,>=9.5; extra == "docs"
31
+ Dynamic: license-file
32
+
33
+ <p align="center">
34
+ <img src="https://raw.githubusercontent.com/Ayberkrk/timoshenko/main/assets/timoshenko-logo.png" alt="Timoshenko Engine logo" width="920">
35
+ </p>
36
+
37
+ <h1 align="center">Timoshenko Engine</h1>
38
+
39
+ <p align="center">
40
+ Reusable structural engineering building blocks for Python applications.
41
+ </p>
42
+
43
+ <p align="center">
44
+ <img alt="Version 2.0.1" src="https://img.shields.io/badge/version-2.0.1-orange?style=for-the-badge">
45
+ <img alt="Alpha" src="https://img.shields.io/badge/stage-alpha-orange?style=for-the-badge">
46
+ <img alt="Python 3.10 to 3.13" src="https://img.shields.io/badge/python-3.10%20to%203.13-blue?style=for-the-badge">
47
+ <img alt="Apache 2.0 license" src="https://img.shields.io/badge/license-Apache--2.0-green?style=for-the-badge">
48
+ <a href="https://github.com/Ayberkrk/timoshenko/actions/workflows/tests.yml"><img alt="Tests" src="https://github.com/Ayberkrk/timoshenko/actions/workflows/tests.yml/badge.svg"></a>
49
+ </p>
50
+
51
+ Timoshenko packages common structural calculations, modal analysis, sensor
52
+ workflows, and monitoring components so applications can reuse them instead
53
+ of rebuilding the same foundations for every project. It is an embeddable
54
+ Python library and engine core, not a hosted monitoring service or a general
55
+ finite-element solver.
56
+
57
+ > **Alpha:** the API may still change between releases. Timoshenko is not yet
58
+ > published on PyPI; install it from GitHub or from a checkout as shown below.
59
+
60
+ ## Install
61
+
62
+ From GitHub:
63
+
64
+ ```bash
65
+ python -m pip install "timoshenko-engine @ git+https://github.com/Ayberkrk/timoshenko"
66
+ ```
67
+
68
+ Or from the root of a checkout:
69
+
70
+ ```bash
71
+ python -m pip install .
72
+ ```
73
+
74
+ The distribution package is named `timoshenko-engine`. The Python import
75
+ package is named `timoshenko`:
76
+
77
+ ```python
78
+ import timoshenko as tm
79
+ print(tm.__version__)
80
+ ```
81
+
82
+ To install optional MQTT support, use:
83
+
84
+ ```bash
85
+ python -m pip install '.[mqtt]'
86
+ ```
87
+
88
+ A future published release can be installed with
89
+ `python -m pip install timoshenko-engine`. That command is only usable after a
90
+ release is available from the selected package index.
91
+
92
+ ## Quick start
93
+
94
+ ```python
95
+ import timoshenko as tm
96
+
97
+ structure = tm.Structure(
98
+ structure_id="building-01",
99
+ story_masses_kg=[120_000.0, 110_000.0],
100
+ story_stiffness_n_m=[85_000_000.0, 70_000_000.0],
101
+ )
102
+
103
+ sensors = tm.load_sensors(
104
+ "acceleration.csv",
105
+ sampling_hz=100.0,
106
+ column="acceleration_m_s2",
107
+ unit="m/s^2",
108
+ )
109
+
110
+ modal = tm.modal.identify(sensors)
111
+ updated = tm.update(structure, modal)
112
+ health = tm.health.assess(structure=updated, observations=sensors)
113
+
114
+ print(health.to_dict())
115
+ ```
116
+
117
+ For a one-shot pipeline, `tm.monitor(structure, sensors)` performs the same
118
+ analysis sequence and returns a serializable result. The model update applies
119
+ one global stiffness multiplier and keeps the analytical reference frequencies
120
+ separate from measured frequencies.
121
+
122
+ ## What it provides
123
+
124
+ | Area | Reusable components |
125
+ |---|---|
126
+ | Structural models | Lumped-mass shear-building models and analytical natural frequencies |
127
+ | Modal analysis | Single-channel peak picking, damping estimates when resolvable, and multi-channel FDD with complex mode shapes |
128
+ | Model comparison | Log-frequency mode pairing, global stiffness updating, and evidence-oriented health assessment |
129
+ | Monitoring | Caller-fed bounded sessions, batch validation, source adapters, and optional plugins |
130
+ | Data workflow | Sensor CSV loading, project manifests, local SQLite history, and CSV replay |
131
+ | Reporting | Standalone HTML reports with an embedded SVG frequency comparison |
132
+ | Engineering calculations | Beam cases, section properties, mechanics, vibration, stability, stress, pressure, torsion, and uncertainty helpers |
133
+
134
+ Timoshenko can be used module by module or embedded in a larger product such as
135
+ Cauren. Sensor collection, application-specific risk rules, and engineering
136
+ interpretation remain with the integrating application.
137
+
138
+ ## Multi-channel modal screening
139
+
140
+ FDD requires synchronized channels with a common sample rate and unit:
141
+
142
+ ```python
143
+ signals = tm.load_multichannel_csv(
144
+ "aligned_accelerometers.csv",
145
+ columns=["deck_left", "deck_center", "deck_right"],
146
+ sampling_hz=100.0,
147
+ units=["m/s^2"] * 3,
148
+ )
149
+ fdd = tm.identify_fdd(signals, nperseg=1024, max_modes=5)
150
+ print(fdd.to_dict())
151
+ ```
152
+
153
+ This first FDD implementation returns candidate frequencies and complex mode
154
+ shapes. It does not estimate damping or issue a damage or safety conclusion.
155
+
156
+ ## Bounded monitoring session
157
+
158
+ A caller supplies timestamped observation batches. The session aligns samples,
159
+ waits for a fresh contiguous analysis window after gaps, and emits reports after
160
+ each configured hop:
161
+
162
+ ```python
163
+ session = tm.MonitoringSession(
164
+ structure,
165
+ sensor_ids=["deck-left", "deck-right"],
166
+ units=["m/s^2", "m/s^2"],
167
+ sampling_hz=100.0,
168
+ window_samples=2048,
169
+ hop_samples=512,
170
+ analysis_options={"nperseg": 512, "max_modes": 4},
171
+ )
172
+ result = session.ingest(batch)
173
+ for report in result.reports:
174
+ tm.report.save_html(report, "reports/latest.html")
175
+ ```
176
+
177
+ A gateway remains responsible for collecting data and handling transport
178
+ reconnection. Timoshenko does not run a background collector or select an alarm
179
+ policy.
180
+
181
+ ## Further examples and documentation
182
+
183
+ - [Documentation home](docs/index.md)
184
+ - [Architecture](docs/architecture.md)
185
+ - [Data contract](docs/data-contract.md)
186
+ - [Historical CSV replay](docs/csv-source.md)
187
+ - [Plugin contract](docs/plugin-contract.md)
188
+ - [Rayleigh damping](docs/rayleigh-damping.md)
189
+ - [Section properties](docs/section-properties.md)
190
+ - [Polygon section properties](docs/polygon-sections.md)
191
+ - [Equation uncertainty](docs/uncertainty.md)
192
+ - [Numerical methods and limits](docs/numerical-methods.md)
193
+ - [Monitoring sessions](docs/live-sessions.md)
194
+ - [Source adapters](docs/adapters.md)
195
+ - [Project manifests](docs/project-manifest.md)
196
+ - [Local storage](docs/storage.md)
197
+ - [Reports](docs/reporting.md)
198
+ - [Optional MQTT adapter](docs/mqtt-adapter.md)
199
+ - [SensorThings adapter](docs/sensorthings-adapter.md)
200
+ - [Engineering calculations](examples/engineering_primitives.py)
201
+ - [Runnable examples](examples/)
202
+ - [Publishing and citation](docs/publishing.md)
203
+
204
+ ## Limits and engineering posture
205
+
206
+ - Timoshenko is alpha software and is not a structural safety certification tool.
207
+ - Its shear-building model is a small lumped-mass reference model, not a full FEM solver.
208
+ - Modal identification is a screening estimate. A single sensor may miss a mode near a modal node.
209
+ - Damping is reported only when the averaged spectrum resolves the half-power bandwidth; otherwise it is `None`.
210
+ - FDD requires synchronized channels and does not estimate damping.
211
+ - The model update applies a single stiffness scale. It cannot locate or size local damage.
212
+ - A frequency shift is evidence for human review, not a damage verdict. Temperature, sensor placement, boundary conditions, and other effects can shift measurements.
213
+ - A monitoring session consumes data supplied by the caller. It does not implement a broker subscription, reconnect loop, scheduler, hosted dashboard, or alarm policy.
214
+ - Closed-form mechanics and section functions rely on their documented ideal assumptions. They are not code-compliance checks.
215
+
216
+ ## Development
217
+
218
+ ```bash
219
+ python -m pip install -e ".[test]"
220
+ python -m pytest
221
+ ```
222
+
223
+ To build the documentation locally, install the optional documentation tools
224
+ and run MkDocs:
225
+
226
+ ```bash
227
+ python -m pip install -e ".[docs]"
228
+ python -m mkdocs serve
229
+ ```
230
+
231
+ The test suite checks analytical cases, input validation, adapters, storage,
232
+ monitoring sessions, and reports. Package distributions should be built and
233
+ installed in a clean environment before a release is uploaded.
234
+
235
+ ## License
236
+
237
+ Apache License 2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,205 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/Ayberkrk/timoshenko/main/assets/timoshenko-logo.png" alt="Timoshenko Engine logo" width="920">
3
+ </p>
4
+
5
+ <h1 align="center">Timoshenko Engine</h1>
6
+
7
+ <p align="center">
8
+ Reusable structural engineering building blocks for Python applications.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <img alt="Version 2.0.1" src="https://img.shields.io/badge/version-2.0.1-orange?style=for-the-badge">
13
+ <img alt="Alpha" src="https://img.shields.io/badge/stage-alpha-orange?style=for-the-badge">
14
+ <img alt="Python 3.10 to 3.13" src="https://img.shields.io/badge/python-3.10%20to%203.13-blue?style=for-the-badge">
15
+ <img alt="Apache 2.0 license" src="https://img.shields.io/badge/license-Apache--2.0-green?style=for-the-badge">
16
+ <a href="https://github.com/Ayberkrk/timoshenko/actions/workflows/tests.yml"><img alt="Tests" src="https://github.com/Ayberkrk/timoshenko/actions/workflows/tests.yml/badge.svg"></a>
17
+ </p>
18
+
19
+ Timoshenko packages common structural calculations, modal analysis, sensor
20
+ workflows, and monitoring components so applications can reuse them instead
21
+ of rebuilding the same foundations for every project. It is an embeddable
22
+ Python library and engine core, not a hosted monitoring service or a general
23
+ finite-element solver.
24
+
25
+ > **Alpha:** the API may still change between releases. Timoshenko is not yet
26
+ > published on PyPI; install it from GitHub or from a checkout as shown below.
27
+
28
+ ## Install
29
+
30
+ From GitHub:
31
+
32
+ ```bash
33
+ python -m pip install "timoshenko-engine @ git+https://github.com/Ayberkrk/timoshenko"
34
+ ```
35
+
36
+ Or from the root of a checkout:
37
+
38
+ ```bash
39
+ python -m pip install .
40
+ ```
41
+
42
+ The distribution package is named `timoshenko-engine`. The Python import
43
+ package is named `timoshenko`:
44
+
45
+ ```python
46
+ import timoshenko as tm
47
+ print(tm.__version__)
48
+ ```
49
+
50
+ To install optional MQTT support, use:
51
+
52
+ ```bash
53
+ python -m pip install '.[mqtt]'
54
+ ```
55
+
56
+ A future published release can be installed with
57
+ `python -m pip install timoshenko-engine`. That command is only usable after a
58
+ release is available from the selected package index.
59
+
60
+ ## Quick start
61
+
62
+ ```python
63
+ import timoshenko as tm
64
+
65
+ structure = tm.Structure(
66
+ structure_id="building-01",
67
+ story_masses_kg=[120_000.0, 110_000.0],
68
+ story_stiffness_n_m=[85_000_000.0, 70_000_000.0],
69
+ )
70
+
71
+ sensors = tm.load_sensors(
72
+ "acceleration.csv",
73
+ sampling_hz=100.0,
74
+ column="acceleration_m_s2",
75
+ unit="m/s^2",
76
+ )
77
+
78
+ modal = tm.modal.identify(sensors)
79
+ updated = tm.update(structure, modal)
80
+ health = tm.health.assess(structure=updated, observations=sensors)
81
+
82
+ print(health.to_dict())
83
+ ```
84
+
85
+ For a one-shot pipeline, `tm.monitor(structure, sensors)` performs the same
86
+ analysis sequence and returns a serializable result. The model update applies
87
+ one global stiffness multiplier and keeps the analytical reference frequencies
88
+ separate from measured frequencies.
89
+
90
+ ## What it provides
91
+
92
+ | Area | Reusable components |
93
+ |---|---|
94
+ | Structural models | Lumped-mass shear-building models and analytical natural frequencies |
95
+ | Modal analysis | Single-channel peak picking, damping estimates when resolvable, and multi-channel FDD with complex mode shapes |
96
+ | Model comparison | Log-frequency mode pairing, global stiffness updating, and evidence-oriented health assessment |
97
+ | Monitoring | Caller-fed bounded sessions, batch validation, source adapters, and optional plugins |
98
+ | Data workflow | Sensor CSV loading, project manifests, local SQLite history, and CSV replay |
99
+ | Reporting | Standalone HTML reports with an embedded SVG frequency comparison |
100
+ | Engineering calculations | Beam cases, section properties, mechanics, vibration, stability, stress, pressure, torsion, and uncertainty helpers |
101
+
102
+ Timoshenko can be used module by module or embedded in a larger product such as
103
+ Cauren. Sensor collection, application-specific risk rules, and engineering
104
+ interpretation remain with the integrating application.
105
+
106
+ ## Multi-channel modal screening
107
+
108
+ FDD requires synchronized channels with a common sample rate and unit:
109
+
110
+ ```python
111
+ signals = tm.load_multichannel_csv(
112
+ "aligned_accelerometers.csv",
113
+ columns=["deck_left", "deck_center", "deck_right"],
114
+ sampling_hz=100.0,
115
+ units=["m/s^2"] * 3,
116
+ )
117
+ fdd = tm.identify_fdd(signals, nperseg=1024, max_modes=5)
118
+ print(fdd.to_dict())
119
+ ```
120
+
121
+ This first FDD implementation returns candidate frequencies and complex mode
122
+ shapes. It does not estimate damping or issue a damage or safety conclusion.
123
+
124
+ ## Bounded monitoring session
125
+
126
+ A caller supplies timestamped observation batches. The session aligns samples,
127
+ waits for a fresh contiguous analysis window after gaps, and emits reports after
128
+ each configured hop:
129
+
130
+ ```python
131
+ session = tm.MonitoringSession(
132
+ structure,
133
+ sensor_ids=["deck-left", "deck-right"],
134
+ units=["m/s^2", "m/s^2"],
135
+ sampling_hz=100.0,
136
+ window_samples=2048,
137
+ hop_samples=512,
138
+ analysis_options={"nperseg": 512, "max_modes": 4},
139
+ )
140
+ result = session.ingest(batch)
141
+ for report in result.reports:
142
+ tm.report.save_html(report, "reports/latest.html")
143
+ ```
144
+
145
+ A gateway remains responsible for collecting data and handling transport
146
+ reconnection. Timoshenko does not run a background collector or select an alarm
147
+ policy.
148
+
149
+ ## Further examples and documentation
150
+
151
+ - [Documentation home](docs/index.md)
152
+ - [Architecture](docs/architecture.md)
153
+ - [Data contract](docs/data-contract.md)
154
+ - [Historical CSV replay](docs/csv-source.md)
155
+ - [Plugin contract](docs/plugin-contract.md)
156
+ - [Rayleigh damping](docs/rayleigh-damping.md)
157
+ - [Section properties](docs/section-properties.md)
158
+ - [Polygon section properties](docs/polygon-sections.md)
159
+ - [Equation uncertainty](docs/uncertainty.md)
160
+ - [Numerical methods and limits](docs/numerical-methods.md)
161
+ - [Monitoring sessions](docs/live-sessions.md)
162
+ - [Source adapters](docs/adapters.md)
163
+ - [Project manifests](docs/project-manifest.md)
164
+ - [Local storage](docs/storage.md)
165
+ - [Reports](docs/reporting.md)
166
+ - [Optional MQTT adapter](docs/mqtt-adapter.md)
167
+ - [SensorThings adapter](docs/sensorthings-adapter.md)
168
+ - [Engineering calculations](examples/engineering_primitives.py)
169
+ - [Runnable examples](examples/)
170
+ - [Publishing and citation](docs/publishing.md)
171
+
172
+ ## Limits and engineering posture
173
+
174
+ - Timoshenko is alpha software and is not a structural safety certification tool.
175
+ - Its shear-building model is a small lumped-mass reference model, not a full FEM solver.
176
+ - Modal identification is a screening estimate. A single sensor may miss a mode near a modal node.
177
+ - Damping is reported only when the averaged spectrum resolves the half-power bandwidth; otherwise it is `None`.
178
+ - FDD requires synchronized channels and does not estimate damping.
179
+ - The model update applies a single stiffness scale. It cannot locate or size local damage.
180
+ - A frequency shift is evidence for human review, not a damage verdict. Temperature, sensor placement, boundary conditions, and other effects can shift measurements.
181
+ - A monitoring session consumes data supplied by the caller. It does not implement a broker subscription, reconnect loop, scheduler, hosted dashboard, or alarm policy.
182
+ - Closed-form mechanics and section functions rely on their documented ideal assumptions. They are not code-compliance checks.
183
+
184
+ ## Development
185
+
186
+ ```bash
187
+ python -m pip install -e ".[test]"
188
+ python -m pytest
189
+ ```
190
+
191
+ To build the documentation locally, install the optional documentation tools
192
+ and run MkDocs:
193
+
194
+ ```bash
195
+ python -m pip install -e ".[docs]"
196
+ python -m mkdocs serve
197
+ ```
198
+
199
+ The test suite checks analytical cases, input validation, adapters, storage,
200
+ monitoring sessions, and reports. Package distributions should be built and
201
+ installed in a clean environment before a release is uploaded.
202
+
203
+ ## License
204
+
205
+ Apache License 2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,57 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77.0.3", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "timoshenko-engine"
7
+ version = "2.0.1"
8
+ description = "Composable structural engineering calculations and analysis primitives for Python applications."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE"]
13
+ dependencies = ["numpy>=1.24"]
14
+ authors = [{ name = "Ayberk Korkmaz" }]
15
+ keywords = [
16
+ "civil engineering",
17
+ "structural engineering",
18
+ "structural health monitoring",
19
+ "modal analysis",
20
+ "digital twin",
21
+ ]
22
+ classifiers = [
23
+ "Development Status :: 3 - Alpha",
24
+ "Intended Audience :: Science/Research",
25
+ "Intended Audience :: Developers",
26
+ "Programming Language :: Python :: 3",
27
+ "Programming Language :: Python :: 3.10",
28
+ "Programming Language :: Python :: 3.11",
29
+ "Programming Language :: Python :: 3.12",
30
+ "Programming Language :: Python :: 3.13",
31
+ "Topic :: Scientific/Engineering",
32
+ ]
33
+
34
+ [project.optional-dependencies]
35
+ mqtt = ["paho-mqtt>=2.1,<3"]
36
+ test = ["pytest>=7"]
37
+ docs = ["mkdocs-material>=9.5,<10"]
38
+
39
+ [project.entry-points."timoshenko.plugins"]
40
+ mqtt = "timoshenko.mqtt:MqttPlugin"
41
+ sensorthings = "timoshenko.sensorthings:SensorThingsPlugin"
42
+
43
+ [project.urls]
44
+ Homepage = "https://github.com/Ayberkrk/timoshenko"
45
+ Repository = "https://github.com/Ayberkrk/timoshenko"
46
+ Issues = "https://github.com/Ayberkrk/timoshenko/issues"
47
+ Documentation = "https://github.com/Ayberkrk/timoshenko/tree/main/docs"
48
+
49
+ [tool.setuptools]
50
+ package-dir = { "" = "src" }
51
+
52
+ [tool.setuptools.packages.find]
53
+ where = ["src"]
54
+
55
+ [tool.pytest.ini_options]
56
+ testpaths = ["tests"]
57
+ xfail_strict = true