From 9c9c76bcc4078b86063a8c7ecbf28e0bbca6256b Mon Sep 17 00:00:00 2001 From: Lugovtsov Gleb Date: Mon, 3 Oct 2022 13:24:58 +0300 Subject: [PATCH] Lab-325 init --- 3.2.5-oscillating-circuit/processing.ipynb | 433 ++++++++++++++++++ .../raw-data/U-on-nu_0Ohm.csv | 22 + .../raw-data/U-on-nu_100Ohm.csv | 19 + .../raw-data/zug-decr_0-Ohm.csv | 5 + .../raw-data/zug-decr_100-Ohm.csv | 5 + .../raw-data/zug-incr_0-Ohm.csv | 5 + .../raw-data/zug-incr_100-Ohm.csv | 5 + 7 files changed, 494 insertions(+) create mode 100644 3.2.5-oscillating-circuit/processing.ipynb create mode 100644 3.2.5-oscillating-circuit/raw-data/U-on-nu_0Ohm.csv create mode 100644 3.2.5-oscillating-circuit/raw-data/U-on-nu_100Ohm.csv create mode 100644 3.2.5-oscillating-circuit/raw-data/zug-decr_0-Ohm.csv create mode 100644 3.2.5-oscillating-circuit/raw-data/zug-decr_100-Ohm.csv create mode 100644 3.2.5-oscillating-circuit/raw-data/zug-incr_0-Ohm.csv create mode 100644 3.2.5-oscillating-circuit/raw-data/zug-incr_100-Ohm.csv diff --git a/3.2.5-oscillating-circuit/processing.ipynb b/3.2.5-oscillating-circuit/processing.ipynb new file mode 100644 index 0000000..afb8991 --- /dev/null +++ b/3.2.5-oscillating-circuit/processing.ipynb @@ -0,0 +1,433 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 7, + "id": "4c18befe-eab7-4708-8a74-e9441ece565c", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "from scipy.optimize import curve_fit\n", + "import pandas as pd" + ] + }, + { + "cell_type": "markdown", + "id": "527687f5-fb63-42ed-8c58-8bc0947710a9", + "metadata": {}, + "source": [ + "#### Резонансная частота" + ] + }, + { + "cell_type": "markdown", + "id": "f52fc1dd-97d6-4e7a-b7dd-8a22bb8e372d", + "metadata": {}, + "source": [ + "$\\nu_0 = \\dfrac{1}{2\\pi\\sqrt{LC}}$" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "id": "04171738-ae97-463b-88b6-b03b55fdd617", + "metadata": {}, + "outputs": [], + "source": [ + "def nu_0(L, C):\n", + " return 1 / (2 * np.pi * np.sqrt(L * C))" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "id": "87c14a27-7683-433e-9705-51496e137f17", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "1591.5494309189535" + ] + }, + "execution_count": 59, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "nu_0(100e-3, 0.1e-6)" + ] + }, + { + "cell_type": "markdown", + "id": "33a9c25f-3478-497c-901a-c0950a8eda55", + "metadata": {}, + "source": [ + "## R = 0 Ом" + ] + }, + { + "cell_type": "markdown", + "id": "5090862a-7622-49a9-b593-fc9ec6c2fc4e", + "metadata": {}, + "source": [ + "freq = 1588 Hz\n", + "\n", + "period = 35.322 ms\n", + "\n", + "N = 30 cycles" + ] + }, + { + "cell_type": "markdown", + "id": "e90b3bb4-0a43-41a4-b492-56aa947dcde0", + "metadata": {}, + "source": [ + "#### Логарифмический декремент затухания для возрастающего участка" + ] + }, + { + "cell_type": "markdown", + "id": "cdea4329-0b53-42a2-adde-7732df34fce9", + "metadata": {}, + "source": [ + "$\\Theta = \\dfrac1n \\ln{\\dfrac{U_0 - U_k}{U_0 - U_{k+n}}}$" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "id": "e779f269-18e0-4fcf-8246-1d583d807edb", + "metadata": {}, + "outputs": [], + "source": [ + "def Theta_incr(U0, U1, U2, n):\n", + " return 1/n * np.log((U0 - U1) / (U0 - U2))" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "id": "bd9fdd97-683e-433d-92d4-f9de5128a7ab", + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_csv(r'raw-data/zug-incr_0-Ohm.csv')" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "id": "e5ddc315-92fa-4f83-ad2b-2c3fce1dcbb8", + "metadata": {}, + "outputs": [], + "source": [ + "U0 = df['U0[mV]']\n", + "U1 = df['U1[mV]']\n", + "U2 = df['U2[mV]']\n", + "n = df['n']" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "id": "3b8e013b-90e0-4362-9cc7-37dd8ed80e91", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0 0.111672\n", + "1 0.115525\n", + "2 0.115721\n", + "3 0.113310\n", + "dtype: float64" + ] + }, + "execution_count": 63, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Theta_incr(U0, U1, U2, n)" + ] + }, + { + "cell_type": "markdown", + "id": "e060b5da-df82-4dd3-9460-4dda42d95439", + "metadata": {}, + "source": [ + "#### Логарифмический декремент затухания для затухающего участка" + ] + }, + { + "cell_type": "markdown", + "id": "8c74f90a-5e1f-4c15-bc02-4d1e92969c3e", + "metadata": {}, + "source": [ + "$\\Theta = \\dfrac1n \\ln{\\dfrac{U_m}{U_{m+n}}}$" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "id": "8fa641b1-02ff-4dcf-a96f-a1d5f4db4796", + "metadata": {}, + "outputs": [], + "source": [ + "def Theta_decr(U1, U2, n):\n", + " return 1/n * np.log((U1) / (U2))" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "id": "3f2b73c7-ae5d-4b0d-9c06-6e8b166e8e43", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "df = pd.read_csv(r'raw-data/zug-decr_0-Ohm.csv')" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "id": "19e0dea5-398d-4a9a-9b85-b2d40b490e58", + "metadata": {}, + "outputs": [], + "source": [ + "U1 = df['U1[mV]']\n", + "U2 = df['U2[mV]']\n", + "n = df['n']" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "id": "ee60a941-494b-41eb-bbfa-8acc7f1a5748", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0 0.096905\n", + "1 0.096698\n", + "2 0.091629\n", + "3 0.091964\n", + "dtype: float64" + ] + }, + "execution_count": 67, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Theta_decr(U1, U2, n)" + ] + }, + { + "cell_type": "markdown", + "id": "4e9e0a89-497c-47c6-8d3a-fe53c8c3a800", + "metadata": {}, + "source": [ + "## R = 100 Ом" + ] + }, + { + "cell_type": "markdown", + "id": "0e45b382-3569-4936-85ab-3a7f000d3a59", + "metadata": {}, + "source": [ + "freq = 1588 Hz\n", + "\n", + "period = 12 ms\n", + "\n", + "N = 8 cycles" + ] + }, + { + "cell_type": "markdown", + "id": "0144e75d-9946-4e5c-92ae-aeb25e3c9c2e", + "metadata": {}, + "source": [ + "#### Логарифмический декремент затухания для возрастающего участка" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "id": "1b70235a-4380-4dad-b79d-e8c61456db1b", + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_csv(r'raw-data/zug-incr_100-Ohm.csv')" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "id": "19501640-3c96-4bde-b319-a8a93a8af87a", + "metadata": {}, + "outputs": [], + "source": [ + "U0 = df['U0[mV]']\n", + "U1 = df['U1[mV]']\n", + "U2 = df['U2[mV]']\n", + "n = df['n']" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "id": "6a45f573-5c8a-4305-b19a-a9b2a1c3c812", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0 0.390079\n", + "1 0.433750\n", + "2 0.410715\n", + "3 0.449025\n", + "dtype: float64" + ] + }, + "execution_count": 70, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Theta_incr(U0, U1, U2, n)" + ] + }, + { + "cell_type": "markdown", + "id": "7614fa42-560a-43f2-8d6f-1f588cf9370b", + "metadata": {}, + "source": [ + "#### Логарифмический декремент затухания для затухающего участка" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "id": "59668c21-71a4-4344-b872-404bb4f57781", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "df = pd.read_csv(r'raw-data/zug-decr_100-Ohm.csv')" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "id": "503635a4-5238-48d0-ae6c-8683229dd21a", + "metadata": {}, + "outputs": [], + "source": [ + "U1 = df['U1[mV]']\n", + "U2 = df['U2[mV]']\n", + "n = df['n']" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "id": "00f8bf87-300b-4a5c-970e-8b7ba27c704e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0 0.302753\n", + "1 0.270310\n", + "2 0.282851\n", + "3 0.315313\n", + "dtype: float64" + ] + }, + "execution_count": 73, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Theta_decr(U1, U2, n)" + ] + }, + { + "cell_type": "markdown", + "id": "efc47c94-16e9-4563-b50d-429068642829", + "metadata": {}, + "source": [ + "**50 Hz**\n", + "\n", + "L = 100.10 mH\n", + "\n", + "R1 = 0.028 Ohm\n", + "\n", + "R2 = 100.02 Ohm" + ] + }, + { + "cell_type": "markdown", + "id": "f6adb735-9274-4a05-b9b2-d85e185fec62", + "metadata": {}, + "source": [ + "**500 Hz**\n", + "\n", + "L = 100.08 mH\n", + "\n", + "R1 = 0.029 Ohm\n", + "\n", + "R2 = 100.02" + ] + }, + { + "cell_type": "markdown", + "id": "3f1ea607-25e1-4d4b-a714-1bfc49aebe29", + "metadata": {}, + "source": [ + "**1500 Hz**\n", + "\n", + "L = 100.10 mH\n", + "\n", + "R1 = 0.03 Ohm\n", + "\n", + "R2 = 100.02 Ohm" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.2" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/3.2.5-oscillating-circuit/raw-data/U-on-nu_0Ohm.csv b/3.2.5-oscillating-circuit/raw-data/U-on-nu_0Ohm.csv new file mode 100644 index 0000000..d19905d --- /dev/null +++ b/3.2.5-oscillating-circuit/raw-data/U-on-nu_0Ohm.csv @@ -0,0 +1,22 @@ +U[mV],nu[Hz] +1350,1588 +1260,1578 +1070,1568 +888,1558 +728,1548 +608,1538 +512,1528 +448,1518 +392,1508 +352,1498 +1230,1598 +1050,1608 +864,1618 +736,1628 +648,1638 +552,1648 +496,1658 +448,1668 +400,1678 +368,1688 +336,1698 \ No newline at end of file diff --git a/3.2.5-oscillating-circuit/raw-data/U-on-nu_100Ohm.csv b/3.2.5-oscillating-circuit/raw-data/U-on-nu_100Ohm.csv new file mode 100644 index 0000000..a0bfe3d --- /dev/null +++ b/3.2.5-oscillating-circuit/raw-data/U-on-nu_100Ohm.csv @@ -0,0 +1,19 @@ +U[mV],nu[Hz] +336,1588 +320,1548 +280,1518 +240,1488 +208,1458 +192,1438 +150,1418 +128,1388 +104,1348 +314,1628 +286,1658 +256,1688 +218,1728 +190,1768 +162,1818 +144,1868 +128,1928 +108,2028 \ No newline at end of file diff --git a/3.2.5-oscillating-circuit/raw-data/zug-decr_0-Ohm.csv b/3.2.5-oscillating-circuit/raw-data/zug-decr_0-Ohm.csv new file mode 100644 index 0000000..0eb8e95 --- /dev/null +++ b/3.2.5-oscillating-circuit/raw-data/zug-decr_0-Ohm.csv @@ -0,0 +1,5 @@ +U1[mV],U2[mV],n +536,272,7 +488,248,7 +440,176,10 +440,160,11 \ No newline at end of file diff --git a/3.2.5-oscillating-circuit/raw-data/zug-decr_100-Ohm.csv b/3.2.5-oscillating-circuit/raw-data/zug-decr_100-Ohm.csv new file mode 100644 index 0000000..bbf66e5 --- /dev/null +++ b/3.2.5-oscillating-circuit/raw-data/zug-decr_100-Ohm.csv @@ -0,0 +1,5 @@ +U1[mV],U2[mV],n +124,50,3 +90,40,3 +124,40,4 +124,66,2 \ No newline at end of file diff --git a/3.2.5-oscillating-circuit/raw-data/zug-incr_0-Ohm.csv b/3.2.5-oscillating-circuit/raw-data/zug-incr_0-Ohm.csv new file mode 100644 index 0000000..c3d30b5 --- /dev/null +++ b/3.2.5-oscillating-circuit/raw-data/zug-incr_0-Ohm.csv @@ -0,0 +1,5 @@ +U0[mV],U1[mV],U2[mV],n +656,184,440,7 +656,272,464,6 +656,232,488,8 +656,184,504,10 \ No newline at end of file diff --git a/3.2.5-oscillating-circuit/raw-data/zug-incr_100-Ohm.csv b/3.2.5-oscillating-circuit/raw-data/zug-incr_100-Ohm.csv new file mode 100644 index 0000000..68aa484 --- /dev/null +++ b/3.2.5-oscillating-circuit/raw-data/zug-incr_100-Ohm.csv @@ -0,0 +1,5 @@ +U0[mV],U1[mV],U2[mV],n +182,38,116,2 +182,82,140,2 +182,38,140,3 +182,82,156,3 \ No newline at end of file