View PFR.py
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0.01, 1)
vk = np.array([0.1, 1, 10])
xvk_x, xvk_vk = np.meshgrid(x, vk)
y = -xvk_vk * np.log(xvk_x)
plt.plot(xvk_x.T, y.T)
plt.legend(['$V_0 / k = ' + str(i) + '$' for i in vk])
View index.html
<div class="container" id="app">
<div class="input-group-prepend">
<span class="input-group-text">.str file</span>
<input type="file" @change="fileUpload($event, 'strdata')" />
</div>
<div class="input-group">
<textarea v-model="strdata" class="form-control"></textarea>
</div>
<div class="input-group-prepend">
<span class="input-group-text">.pdb file</span>
View index.html
<div class="container" id="app">
<div class="input-group-prepend">
<span class="input-group-text">.str file</span>
</div>
<div class="input-group">
<textarea v-model="strdata" class="form-control"></textarea>
</div>
<div class="btn-group m-4" role="group">
<button type="button" class="btn btn-primary" v-on:click="goClick">.str convert to .tbl</button>
</div>
View main.py
from kivy.logger import Logger
import logging
Logger.setLevel(logging.TRACE)
from kivy.app import App
import kivy
from kivy.lang import Builder
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.camera import Camera
View flow_dir.py
import matplotlib.pyplot as plt
import numpy as np
bound = 2
r = np.linspace(-bound, bound, 20)
x, y = np.meshgrid(r, r)
vx = x
vy = x * (x - 1) * (y + 1)
plt.figure(figsize=(10, 8))
Q = plt.quiver(x, y, vx, vy)
View twsf.py
import requests
from lxml import html
from pprint import pprint
import json
import re
def getLists():
alllinks = []
for i in range(1,7):
lists = "https://twsf.ntsec.gov.tw/Article.aspx?a=40&lang=1&p=" + str(i)
View simulate_rod.py
import numpy as np
import matplotlib.pyplot as plt
def tempDist(x, L, m, h_mk):
y = (np.cosh(m * (L - x)) + h_mk * np.sinh(m * (L - x))) / \
(np.cosh(m * L ) + h_mk * np.sinh(m * L ) )
return y
# real data
# time temperture
View headRod.py
import numpy as np
import matplotlib.pyplot as plt
# time temperture
tt = """
34.6 29.5 25 25
50.0 37.1 29.8 27.6
70.1 48.5 35.6 31.6
90.2 69.5 54.2 44.8
"""
View heatUp.py
import numpy as np
import matplotlib.pyplot as plt
# time temperture
tt = """
0 34.6
1 34.7
2 35.1
3 36.0
4 37.4
View bending.py
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import t
def plotOne(x, y):
x = np.array(x)
y = np.array(y)
# https://en.wikipedia.org/wiki/Simple_linear_regression
# bx + a
head_b = np.sum((x - x.mean()) * (y - y.mean())) / np.sum((x - x.mean()) ** 2)