摘要: 读txt文件 python常用的读取文件函数有三种read()、readline()、readlines() read() #一次性读取文本中全部的内容,以字符串的形式返回结果 readline() #只读取文本第一行的内容,以字符串的形式返回结果 readlines() #读取文本所有内容,并且以 阅读全文
posted @ 2019-10-06 10:11 华小电 阅读(14506) 评论(0) 推荐(1)
摘要: import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt # function that returns dz/dt def model(z,t,u): x = z[0] y = z[1] dxdt = (-x + u)/2.0 dydt = (-... 阅读全文
posted @ 2019-06-28 15:03 华小电 阅读(538) 评论(0) 推荐(0)
摘要: import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt # function that returns dz/dt def model(z,t): dxdt = 3.0 * np.exp(-t) dydt = -z[1] + 3 dzdt = [dxdt... 阅读全文
posted @ 2019-06-28 15:02 华小电 阅读(470) 评论(0) 推荐(0)
摘要: import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt # function that returns dy/dt def model(y,t): # u steps from 0 to 2 at t=10 if t<10.0: u = 0 ... 阅读全文
posted @ 2019-06-28 14:59 华小电 阅读(681) 评论(0) 推荐(0)
摘要: An example of using ODEINT is with the following differential equation with parameter k=0.3, the initial condition y0=5 and the following differential 阅读全文
posted @ 2019-06-28 14:53 华小电 阅读(1273) 评论(0) 推荐(0)
摘要: Transfer function: \[\frac{1}{Ts+1} \]写成微分方程: \[Ty'(t)+y(t)=u(t) \]向前差分: \[y'(t) = \frac{y(t+1)-y(t)}{\Delta T} \\ y(t+1)=y(t)+\frac{\Delta T}{T}(u(t) 阅读全文
posted @ 2019-06-12 22:01 华小电 阅读(3105) 评论(0) 推荐(0)
摘要: Let's first fully upgrade our current Debian Stretch system: Update Package Repository to Debian Buster Your /etc/apt/sources.list should look similar 阅读全文
posted @ 2019-05-21 17:33 华小电 阅读(2243) 评论(0) 推荐(0)
摘要: class parent(object): def implicit(self): print("Parent implicit()") def override(self): print("Parent override()") def altered(self): print("Parent a 阅读全文
posted @ 2019-05-14 16:28 华小电 阅读(3570) 评论(0) 推荐(0)
摘要: 输出结果: 运行结果: 阅读全文
posted @ 2019-05-14 15:50 华小电 阅读(385) 评论(0) 推荐(0)
摘要: class Song(): def __init__(self,lyrics): self.lyrics=lyrics def sing_a_song(self): for line in self.lyrics: print(line) happy=Song(["Happy birthday to you", "Happy... 阅读全文
posted @ 2019-05-14 14:58 华小电 阅读(1028) 评论(0) 推荐(0)