You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Greetings. I'm using AircraftIden for system identification of a multirotor system. I'm using data from a csv file. Upon running the code below:
`import sys
sys.path.insert(0, '../')
from AircraftIden import FreqIdenSIMO, TransferFunctionFit, TransferFunctionParamModel
from AircraftIden.TransferFunctionFit import plot_fitter
import matplotlib.pyplot as plt
import numpy as np
import csv
import sympy as sp
import math
plt.rc("figure", figsize=(15,10))
plt.figure("rout->r")
simo_iden.plt_bode_plot(0)
#plt.plot(time_seq_source, gx_source, color="red")
freq, H, gamma2, gxx, gxy, gyy = simo_iden.get_freq_iden(0)
a, b, c, d, e, f, g, tau, s = sp.symbols("a b c d e f g tau s")
num = f*s*s
den = a*s*s*s*s + b*s*s*s + c*s*s + d*s + e
tfpm = TransferFunctionParamModel(num, den, tau)
fitter = TransferFunctionFit(freq, H, gamma2, tfpm, nw=20, iter_times=300, reg = 0.1)
tf = fitter.estimate(2, 20, accept_J=50)
plot_fitter(fitter, "$rout -> p$")
plt.show()
if name == "main":
siso_freq_iden(128)
`
I'm getting different results for the same dataset, each time I run the code. Each time, the transfer functions are slightly different, depending on the final fit. Can you share the reason for this, and how to make transfer function estimation more repeatable?
I've added the csv dataset and the results I'm getting below
Greetings. I'm using AircraftIden for system identification of a multirotor system. I'm using data from a csv file. Upon running the code below:
`import sys
sys.path.insert(0, '../')
from AircraftIden import FreqIdenSIMO, TransferFunctionFit, TransferFunctionParamModel
from AircraftIden.TransferFunctionFit import plot_fitter
import matplotlib.pyplot as plt
import numpy as np
import csv
import sympy as sp
import math
def siso_freq_iden(win_num=32):
#with open('/home/astik/Downloads/arducopter_sysid_data/axis_10_RATE_nohead.csv', 'r') as f:
with open('/home/astik/Downloads/arducopter_sysid_data/bill_sid_axis1_nohead.csv', 'r') as f:
reader = csv.reader(f)
data = list(reader)
arr = np.array(data)
arr = np.array(data, dtype=float)
#save_data_list = ["running_time", "yoke_pitch", "theta", "airspeed", "q", "aoa", "VVI", "alt"]
#arr = np.load("../data/sweep_data_2017_11_16_11_47.npy")
time_seq_source = arr[:, 1]
rout_source = arr[:, 23]
gx_source = arr[:, 4]*math.pi / 180
simo_iden = FreqIdenSIMO(time_seq_source,0.5, 50, rout_source, gx_source, win_num=None)
if name == "main":
siso_freq_iden(128)
`
I'm getting different results for the same dataset, each time I run the code. Each time, the transfer functions are slightly different, depending on the final fit. Can you share the reason for this, and how to make transfer function estimation more repeatable?
I've added the csv dataset and the results I'm getting below
sysid_results.zip
bill_sid_axis1_nohead.csv
The text was updated successfully, but these errors were encountered: