我正在尝试测量python中功率与时间(信号输出)图的上升时间,功率过冲和建立时间。您知道一个允许我计算这三个参数的python函数吗?
3个参数定义如下:1.上升时间=从“接通”功率输出值的10%变为90%的时间2.过冲百分比=((最大功率值)-(最终“接通”功率值))/(最终“接通”功率值)3.建立时间=信号功率输出在稳态值的x%以内的时间
[功率(幅度)与时间的关系图类似于Matlab的stepinfo指南https://uk.mathworks.com/help/control/ref/stepinfo.html中的第一幅图
import numpy as np
import matplotlib.pyplot as plt
import csv
import pandas as pd
time = [] # initialise time array
power = [] # initialise power array
df_csv = pd.read_csv('PvsV_SOA_comma.csv') # loads .csv file as a pandas
dataframe
time = df_csv.iloc[:, 0] # sets time array equal to data in 1st (index
from 0) column of datafram, selecting all rows
power = df_csv.iloc[:, 1] # sets voltage array
plt.plot(time, voltage)
plt.xlabel('Time (s)')
plt.ylabel('Power (W)')
如果您的Power响应像二阶阶跃响应(如Matlab的stepinfo指南中所示)
您需要了解您的系统型号并使用csv文件来运行系统标识。然后得到模型参数,就可以计算出更精确的时间响应特性