{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "eb14dc9b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, 'Ток, мА')"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 14092 characters]\n",
      "text/plain": [
       "<Figure size 576x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "\n",
    "\n",
    "#d = 0.2 mm, l = 5.2 mm\n",
    "\n",
    "#217 V -> 32 V \n",
    "\n",
    "#V\n",
    "voltage_up = [31.76, 31.48, 30.25, 29.65, 29.09, 28.33, 27.97, 27.62, 27.20, 27.05, 27] #27 скачет +- 0.2\n",
    "#mA / 0.04\n",
    "current_up = [35, 40, 46, 52, 57, 65, 70, 79, 90, 99, 110]\n",
    "\n",
    "for i in range(len(current_up)):\n",
    "    current_up[i] *= 0.04\n",
    "\n",
    "#V\n",
    "voltage_down = [27.00, 27.03, 27.07, 27.23, 27.48, 27.85, 28.37, 29.37, 30.45, 31.82]\n",
    "#mA / 0.04\n",
    "current_down = [106, 101, 93, 86, 80, 71, 63, 54, 45, 34]\n",
    "\n",
    "for i in range(len(current_down)):\n",
    "    current_down[i] *= 0.04\n",
    "\n",
    "# 36 V -> 66 V\n",
    "\n",
    "voltage_lin = [29, 30.25, 31.48, 32]\n",
    "current_lin = [0.04 * (46 + 6 * 1.25 / 1.23), 0.04 * 46, 0.04 * 40, 0.04 * (40 - 6 * 0.52 / 1.23)]\n",
    "\n",
    "plt.figure(figsize=(8, 6))\n",
    "plt.scatter(voltage_up, current_up, color = 'green', marker = 'o')\n",
    "plt.scatter(voltage_down, current_down, color = 'orange', marker = 'o')\n",
    "plt.plot(voltage_lin, current_lin, color = 'black', linewidth = 0.5)\n",
    "plt.xlabel('Напряжение, В')\n",
    "plt.ylabel('Ток, мА')\n",
    "#plt.plot(voltage_up, inverse(voltage_up, *params_up))\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "899d025a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bd2677a2",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2395d40a",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "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.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
