This repository has been archived on 2026-01-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
physics/course2/sem3/labs_done/lab4.02_done/scripts/main.py
2025-12-28 20:41:20 +03:00

24 lines
413 B
Python

import numpy as np
import matplotlib.pyplot as plt
L = np.array([932, 832, 732, 632, 532])
dx = np.array([3.56, 3.67, 3.00, 3.11, 2.33])
K, b = np.polyfit(L, dx, 1)
lambda_nm = 632.82
lambda_mm = lambda_nm * 1e-6
d = lambda_mm / K
plt.figure()
plt.scatter(L, dx)
plt.plot(L, K * L + b)
plt.xlabel("L, мм")
plt.ylabel("Δx, мм")
plt.savefig("1.png", bbox_inches="tight", dpi=300)
plt.show()
print(K, d)