I am trying to measure the rise time, power overshoot and settling time of a power vs. time (signal output) graph in python. Do you know a python function that would allow me to calculate these 3 parameters?
The 3 parameters are defined as follows:
- Rise time = time to go from 10% to 90% of the 'on' power output values
- % Overshoot = ((maximum power value) - (final 'on' power value)) / (final 'on' power value)
- settling time = time for signal's power output to be within x% of a steady state value
The power (amplitude) vs. time graph is similar to the 1st graph on Matlab's stepinfo guide https://uk.mathworks.com/help/control/ref/stepinfo.html
I have a .csv file with the power and time values, so I load these in as a dataframe and plot power vs. time. But from this graph, I am not sure how to calculate the 3 parameters I need
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)')