Browse Source

prepare data

Egor 2 years ago
parent
commit
70a3944292
3 changed files with 127 additions and 2 deletions
  1. 66 0
      .idea/workspace.xml
  2. 25 2
      source/backend/calc.py
  3. 36 0
      source/other/article_research/notebook.ipynb

+ 66 - 0
.idea/workspace.xml

@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="AutoImportSettings">
+    <option name="autoReloadType" value="SELECTIVE" />
+  </component>
+  <component name="ChangeListManager">
+    <list default="true" id="604b6b21-47bf-4c3b-809c-8a6a9044ac45" name="Changes" comment="" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="FileTemplateManagerImpl">
+    <option name="RECENT_TEMPLATES">
+      <list>
+        <option value="Python Script" />
+      </list>
+    </option>
+  </component>
+  <component name="Git.Settings">
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+  </component>
+  <component name="ProjectId" id="26c3Oc6tGjOn2SD5Zr76G4rIA7b" />
+  <component name="ProjectViewState">
+    <option name="hideEmptyMiddlePackages" value="true" />
+    <option name="showLibraryContents" value="true" />
+  </component>
+  <component name="PropertiesComponent">
+    <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
+    <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
+    <property name="WebServerToolWindowFactoryState" value="false" />
+    <property name="node.js.detected.package.eslint" value="true" />
+    <property name="node.js.detected.package.tslint" value="true" />
+    <property name="node.js.selected.package.eslint" value="(autodetect)" />
+    <property name="node.js.selected.package.tslint" value="(autodetect)" />
+  </component>
+  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="604b6b21-47bf-4c3b-809c-8a6a9044ac45" name="Changes" comment="" />
+      <created>1647709016967</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1647709016967</updated>
+      <workItem from="1647709019515" duration="2910000" />
+      <workItem from="1648729830503" duration="799000" />
+      <workItem from="1649507437600" duration="3387000" />
+    </task>
+    <servers />
+  </component>
+  <component name="TypeScriptGeneratedFilesManager">
+    <option name="version" value="3" />
+  </component>
+  <component name="Vcs.Log.Tabs.Properties">
+    <option name="TAB_STATES">
+      <map>
+        <entry key="MAIN">
+          <value>
+            <State />
+          </value>
+        </entry>
+      </map>
+    </option>
+    <option name="oldMeFiltersMigrated" value="true" />
+  </component>
+</project>

+ 25 - 2
source/backend/calc.py

@@ -1,2 +1,25 @@
-def g():
-    print("f")
+import numpy as np
+
+
+def prepare_data(freq, re, im):
+    """the function takes raw data and gives vectors of eq (8)"""
+    fl = freq[re.index(max(re))]
+    # fl is the frequency of loaded resonance
+    f0 = fl
+    # f0 is the frequency of unloaded resonance
+    e1, e2, e3, gamma, p = [], [], [], [], []
+    for i in range(0, len(freq)):
+        # filling vectors
+        t = 2*(freq[i] - fl)/f0
+        g = re[i] + im[i] * j
+        e1.append(t)
+        e2.append(1)
+        e3.append(-t*g)
+        gamma.append(g)
+        p.append(1/(1 + t**2*(1 + re[i]**2 + im[i]**2)))
+    data = np.array([e1, e2, e3, gamma, p], dtype=complex)
+    return data
+
+def scalar_product ():
+    pass
+

+ 36 - 0
source/other/article_research/notebook.ipynb

@@ -0,0 +1,36 @@
+{
+ "cells": [],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 2
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython2",
+   "version": "2.7.6"
+  },
+  "pycharm": {
+   "stem_cell": {
+    "cell_type": "raw",
+    "source": [
+     "\n",
+     "\n"
+    ],
+    "metadata": {
+     "collapsed": false
+    }
+   }
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}