示例#1
0
def load_data(mod_name):
    #data_mod_name = 'swept_sine_amp_75_July_07_2009_avebodes'
    #data_mod_name = 'swept_sine_amp_75_July_07_2009_log_downsampled'
    bode_data_set = txt_data_processing.load_avebode_data_set(mod_name)

    #bode_data_set.Bode_Plot2(func=rwkbode.GenBodePlot, linetype='o')
    ## exp_bodes = bode_data_set.avebodes[0:2]
    ## th_v_exp = exp_bodes[0]
    ## a_v_exp = exp_bodes[1]
    ## f = bode_data_set.f
    ## a_theta_exp = bode_data_set.avebodes[2]

    exp_bodes = bode_data_set.avebodes
    th_v_exp = bode_data_set.find_bode('theta','v')
    a_v_exp = bode_data_set.find_bode('a','v')
    f = bode_data_set.f
    a_theta_exp = bode_data_set.find_bode('a','theta')
    return f, th_v_exp, a_v_exp, a_theta_exp
示例#2
0
from pylab import *
from scipy import *

import os

import txt_data_processing
#reload(txt_data_processing)

#from txt_data_processing import load_avebode_data_set, \
#     load_time_domain_data_set, merge_trunc_ave_data_sets

data_dir = '/home/ryan/siue/Research/PSoC_Research/SLFR_RTP/SRF_2009/June_17_2009'
import sys
if data_dir not in sys.path:
    sys.path.append(data_dir)

ds_name = 'closed_loop_swept_sine_no_accel_fb_avebodes'
data_set = txt_data_processing.load_avebode_data_set(ds_name)
figs = data_set.Bode_Plot2()

inds, mask, flog = data_set.Log_Compress_Data([0.5,1.5,4.0,10],[20,70,20])

data_set.Bode_Plot2(attr='compressed_avebodes', \
                    f_attr='compressed_f', figs=figs, \
                    clear=False, linetype='o')

data_set.save_as(os.path.join(data_dir, 'log_compressed_data_June_17_2009'))

show()
示例#3
0
reload(txt_data_processing)

import rwkbode
reload(rwkbode)

from IPython.Debugger import Pdb
#from txt_data_processing import load_avebode_data_set, \
#     load_time_domain_data_set, merge_trunc_ave_data_sets

data_dir = 'June_17_2009'
import sys
if data_dir not in sys.path:
    sys.path.append(data_dir)

log_ds_name = 'log_compressed_data_June_17_2009'
log_data_set = txt_data_processing.load_avebode_data_set(log_ds_name)

ol_act_bode = log_data_set.find_bode('theta','v')
ol_act_bode.phase = squeeze(ol_act_bode.phase)
ol_act_bode.mag = squeeze(ol_act_bode.mag)
f = log_data_set.f

raw_name = 'closed_loop_swept_sine_no_accel_fb_avebodes'
raw_data_set = txt_data_processing.load_avebode_data_set(raw_name)
raw_act_bode = raw_data_set.find_bode('theta','v')
raw_cl_bode = raw_data_set.find_bode('theta','u')
raw_a_theta_d_bode = raw_data_set.find_bode('a','u')
f_raw = raw_data_set.f

def my_ol_model(X):
    g = X[0]
示例#4
0
 def __init__(self, modname, bode_opts, label="exp."):
     self.mod = TDP.load_avebode_data_set(modname)
     self.bode_opts = bode_opts
     self.bode_attr = self.mod
     self.func = plot_exp_bode
     self.label = label
示例#5
0
from pylab import *
from scipy import *
import copy
import txt_data_processing, rwkbode, pylab_util

from systemid import Model

#load log downsampled and raw Bode data
log_ds_mod = 'swept_sine_amp_75_July_07_2009_log_downsampled'
log_ds_data = txt_data_processing.load_avebode_data_set(log_ds_mod)
log_ds_f = log_ds_data.f
a_theta_log_ds = log_ds_data.find_bode('a', 'theta')

raw_mod = 'swept_sine_amp_75_July_07_2009_avebodes'
raw_data = txt_data_processing.load_avebode_data_set(raw_mod)
raw_f = raw_data.f
a_theta_raw = raw_data.find_bode('a', 'theta')

######################
#
# Develop a model
#
######################

#both modes multiplied together
tf_c1 = Model('g*s**2*w1**2*w2**2', \
           '(s**2+2*z1*w1*s+w1**2)*(s**2+2*z2*w2*s+w2**2)' , \
           {'w1':2.5*2*pi,'z1':0.03,'w2':17.8*2*pi,'z2':0.01,'g':0.005}, \
           'all')
model_bode_c1 = rwkbode.Bode_From_TF(tf_c1, raw_f, input='theta', output='a')
示例#6
0
    ##     parser.add_option("-o", "--output", dest="output", \
    ##                       help="Output name for saving the data.",\
    ##                       default="", type="str")

    (options, args) = parser.parse_args()

    curdir = os.getcwd()
    if curdir not in sys.path:
        sys.path.insert(1, curdir)

    print("options=" + str(options))
    print("args=" + str(args))

    opts_file = args[0]
    folder, opts_name = os.path.split(opts_file)
    log_opt_dict = load_and_parse_opts(opts_file)
    load_path = os.path.join(folder, log_opt_dict["load_name"])
    data_set = txt_data_processing.load_avebode_data_set(load_path)
    freqs = log_opt_dict["freqs"]
    points = log_opt_dict["points"]
    inds, mask, flog = data_set.Log_Compress_Data(freqs, points)
    outpath = os.path.join(folder, log_opt_dict["save_name"])
    data_set.save_as(outpath)

    if options.plot:
        figs = data_set.Bode_Plot2()

        data_set.Bode_Plot2(attr="compressed_avebodes", f_attr="compressed_f", figs=figs, clear=False, linestyle="o")

        show()
示例#7
0
     load_time_domain_data_set, merge_trunc_ave_data_sets

import pylab_util

import rwkbode

data_dir = rwkos.FindFullPath('siue/Research/modeling/SLFR/data/July_07_2009')
if data_dir not in sys.path:
    sys.path.append(data_dir)


import SLFR_TMM
reload(SLFR_TMM)

ds_name = 'swept_sine_amp_75_July_07_2009_log_downsampled'

data_set = load_avebode_data_set(ds_name)
figs = data_set.Bode_Plot2(linetype='o')


k_spring = 1.0
c_spring = 0.1
K_act = 0.05
tau = 10.0*2*pi
xf = [k_spring, c_spring, K_act, tau, 1.5]

ol_model = SLFR_TMM.SLFR_TMM_OL_model(xf)
ol_model.IntegratedCurveFit(expmodname=data_set, prefix='log_compressed')
                   
show()