我尝试在python中测量功率与时间(信号输出)图的上升时间、功率超调量和稳定时间。你知道一个python函数可以让我计算这3个参数吗?在
3个参数定义如下: 1上升时间=从“开启”功率输出值的10%到90%的时间 2%超调量=((最大功率值)-(最终“开启”功率值))/(最终“开启”功率值) 三。稳定时间=信号功率输出在稳态值x%范围内的时间
功率(振幅)与时间的关系图类似于Matlab stepinfo指南中的第1张图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)')
目前没有回答
相关问题 更多 >
编程相关推荐