summaryrefslogtreecommitdiff
path: root/tutorials
diff options
context:
space:
mode:
authorChristian Kolset <christian.kolset@gmail.com>2025-10-20 16:43:28 -0600
committerChristian Kolset <christian.kolset@gmail.com>2025-10-20 16:43:28 -0600
commitba75ac4c0a829316b3cd30cd8110d353cde2b6d2 (patch)
treef8fa13b2a239e0eaeaa083ee31e74a1ab70c1cf7 /tutorials
parentd74d4b65a51d11db90198d6f2548d9ab942a2c25 (diff)
Added sample data files
Diffstat (limited to 'tutorials')
-rw-r--r--tutorials/module_4/data_generation.py38
-rw-r--r--tutorials/module_4/force_displacement_data.txt23
-rw-r--r--tutorials/module_4/velocity-time.txt23
3 files changed, 84 insertions, 0 deletions
diff --git a/tutorials/module_4/data_generation.py b/tutorials/module_4/data_generation.py
new file mode 100644
index 0000000..7656834
--- /dev/null
+++ b/tutorials/module_4/data_generation.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+"""
+Created on Mon Oct 20 14:40:48 2025
+
+@author: christian
+"""
+
+import numpy as np
+import pandas as pd
+import matplotlib.pyplot as plt
+
+# Parameters
+A = 1.0 # initial amplitude
+b = 0.2 # damping coefficient
+f = 1.0 # frequency (Hz)
+time = np.linspace(0, 5, 1000) # time vector
+
+# Dampened sine wave formula
+displacement = A * np.exp(-b * time) * np.sin(2 * np.pi * f * time)
+
+velocity = np.gradient(displacement, time)
+acceleration = np.gradient(velocity,time)
+
+# Plotting
+plt.figure(figsize=(8, 5))
+plt.plot(time, displacement, label='disp. (m)', color='blue')
+plt.plot(time, velocity, label='vel. (m/s)', color='red')
+plt.plot(time, acceleration, label='acc. (m/s^2)', color='black')
+plt.title('Pendulum')
+plt.xlabel('Time (s)')
+plt.ylabel('f(t)')
+plt.grid(True)
+plt.legend()
+plt.tight_layout()
+plt.show()
+
+
diff --git a/tutorials/module_4/force_displacement_data.txt b/tutorials/module_4/force_displacement_data.txt
new file mode 100644
index 0000000..825269d
--- /dev/null
+++ b/tutorials/module_4/force_displacement_data.txt
@@ -0,0 +1,23 @@
+Sample Stress–Strain Data (AISI 1080 Steel)
+
+Strain (mm/mm) Stress (MPa)
+-------------- -------------
+0.0000 0
+0.0005 100
+0.0010 200
+0.0015 300
+0.0020 400
+0.0025 500
+0.0030 510
+0.0040 520
+0.0050 540
+0.0070 600
+0.0100 700
+0.0150 800
+0.0200 850
+0.0300 820
+0.0500 750
+0.0800 650
+0.1200 500
+0.1500 300
+0.1800 0
diff --git a/tutorials/module_4/velocity-time.txt b/tutorials/module_4/velocity-time.txt
new file mode 100644
index 0000000..9a7e221
--- /dev/null
+++ b/tutorials/module_4/velocity-time.txt
@@ -0,0 +1,23 @@
+| Time (s) | Velocity (m/s) |
+| -------- | -------------- |
+| 0 | 0 |
+| 2 | 1.5 |
+| 4 | 3 |
+| 6 | 4.5 |
+| 8 | 6 |
+| 10 | 7.5 |
+| 12 | 9 |
+| 14 | 10.5 |
+| 16 | 12 |
+| 18 | 13.5 |
+| 20 | 15 |
+| 24 | 18 |
+| 28 | 21 |
+| 32 | 24 |
+| 36 | 27 |
+| 40 | 30 |
+| 42 | 25 |
+| 44 | 18 |
+| 46 | 10 |
+| 48 | 5 |
+| 50 | 0 |